parser-3.4.3/000755 000000 000000 00000000000 12234223575 013121 5ustar00rootwheel000000 000000 parser-3.4.3/depcomp000755 000000 000000 00000044267 11764751517 014524 0ustar00rootwheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -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. 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 tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. 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 tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. 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 # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done 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 "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" 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 "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/configure000755 000000 000000 00002340740 12234222475 015040 0ustar00rootwheel000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for parser 3.4.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" lt_ltdl_dir='src/lib/ltdl' SHELL=${CONFIG_SHELL-/bin/sh} lt_dlopen_dir="$lt_ltdl_dir" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='parser' PACKAGE_TARNAME='parser' PACKAGE_VERSION='3.4.3' PACKAGE_STRING='parser 3.4.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="README" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" enable_option_checking=no ac_subst_vars='ltdl_LTLIBOBJS ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LTDLOPEN LT_CONFIG_H subdirs CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS INCLTDL LTDLINCL LTDLDEPS LIBLTDL CXXCPP CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL OBJDUMP DLLTOOL AS COMPILE_APACHE_MODULE_FALSE COMPILE_APACHE_MODULE_TRUE APACHE_CFLAGS APACHE_INC APACHE MIME_LIBS MIME_INCLUDES XML_LIBS XML_INCLUDES PCRE_LIBS PCRE_INCLUDES GC_LIBS dll_extension am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX YFLAGS YACC host_os host_vendor host_cpu host build_os build_vendor build_cpu build P3S am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_build_warnings with_assertions with_sjlj_exceptions enable_safe_mode enable_execs enable_stringstream with_gc with_pcre with_xml with_mailreceive with_sendmail with_apache with_pic enable_shared enable_static enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_included_ltdl with_ltdl_include with_ltdl_lib enable_ltdl_install ' ac_precious_vars='build_alias host_alias target_alias YACC YFLAGS CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP CXXCPP' ac_subdirs_all='src/lib/ltdl' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures parser 3.4.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/parser] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of parser 3.4.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-safe-mode to enable reading and executing files belonging to group+user other then effective --disable-execs to disable any execs (file::exec, file::cgi, unix mail:send) --disable-stringstream to disable stringstream usage. when disabled table.save use more memory but it's safer on freebsd 4.x --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-build-warnings to enable build-time compiler warnings if gcc is used --with-assertions to enable assertions --with-sjlj-exceptions enable simple 'throw' from dynamic library --with-gc=D D is the directory where Boehm garbage collecting library is installed --with-pcre=D D is the directory where PCRE library is installed --with-xml=D D is the directory where Gnome XML libraries are installed --with-mailreceive=D is the directory where Gnome MIME library is installed \"--with-sendmail=COMMAND\" forces this command to send mail. example: \"--with-sendmail=/usr/sbin/sendmail -t\" (makes parser ignore user-defined sendmail commands) --with-apache=FILE FILE is the full path for APXS builds apache DSO module using apxs --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR Some influential environment variables: YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF parser configure 3.4.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by parser $as_me 3.4.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='parser' VERSION='3.4.3' 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"} # 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 -' P3S=`cd $srcdir/src ; pwd` # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac cat >>confdefs.h <<_ACEOF #define PARSER_VERSION "$VERSION (compiled on $host)" _ACEOF case $host_os in *cygwin* ) $as_echo "#define CYGWIN /**/" >>confdefs.h ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test "$YACC" != "bison -y"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: to regenerate Parser grammar YOU WOULD NEED BISON" >&5 $as_echo "$as_me: WARNING: to regenerate Parser grammar YOU WOULD NEED BISON" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking bison version" >&5 $as_echo_n "checking bison version... " >&6; } oldIFS=$IFS; IFS=. set `bison -V | sed -e 's/^GNU Bison version //' -e 's/^bison (GNU Bison) //' -e 's/$/./'` IFS=$oldIFS if test "$1" = "1" -a "$2" -lt "25"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2)." >&5 $as_echo "$as_me: WARNING: Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2)." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $1.$2 (ok)" >&5 $as_echo "$1.$2 (ok)" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_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 this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-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="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dynamic-link library extension" >&5 $as_echo_n "checking for dynamic-link library extension... " >&6; } case "$host_os" in *cygwin* ) dll_extension=dll;; * ) dll_extension=so esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dll_extension" >&5 $as_echo "$dll_extension" >&6; } # Check whether --with-build-warnings was given. if test "${with_build_warnings+set}" = set; then : withval=$with_build_warnings; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling compiler warnings" >&5 $as_echo "$as_me: WARNING: enabling compiler warnings" >&2;} CXXFLAGS="$CXXFLAGS -W -Wall -Wstrict-prototypes -Wmissing-prototypes" fi # Check whether --with-assertions was given. if test "${with_assertions+set}" = set; then : withval=$with_assertions; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling assertions" >&5 $as_echo "$as_me: WARNING: enabling assertions" >&2;} else $as_echo "#define NDEBUG /**/" >>confdefs.h fi # Check whether --with-sjlj-exceptions was given. if test "${with_sjlj_exceptions+set}" = set; then : withval=$with_sjlj_exceptions; $as_echo "#define PA_WITH_SJLJ_EXCEPTIONS /**/" >>confdefs.h fi # Check whether --enable-safe-mode was given. if test "${enable_safe_mode+set}" = set; then : enableval=$enable_safe_mode; SAFE_MODE=$enableval fi if test "$SAFE_MODE" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling reading of files belonging to group+user other then effective" >&5 $as_echo "$as_me: WARNING: enabling reading of files belonging to group+user other then effective" >&2;} else $as_echo "#define PA_SAFE_MODE /**/" >>confdefs.h fi # Check whether --enable-execs was given. if test "${enable_execs+set}" = set; then : enableval=$enable_execs; if test "$enableval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling file execs" >&5 $as_echo "$as_me: WARNING: disabling file execs" >&2;} $as_echo "#define NO_PA_EXECS /**/" >>confdefs.h fi fi # Check whether --enable-stringstream was given. if test "${enable_stringstream+set}" = set; then : enableval=$enable_stringstream; if test "$enableval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling stringstream usage" >&5 $as_echo "$as_me: WARNING: disabling stringstream usage" >&2;} $as_echo "#define NO_STRINGSTREAM /**/" >>confdefs.h fi fi # Check whether --with-gc was given. if test "${with_gc+set}" = set; then : withval=$with_gc; GC=$withval GC_LIBS="$GC/libgc.la" if test -f $GC_LIBS; then GC_OK="yes" else GC_LIBS="-L$GC -lgc" fi if test "$GC" = "yes"; then GC="" GC_LIBS="-lgc" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-gc value was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-gc value was not specified, hoping linker would find it" >&2;} fi else GC_LIBS="-lgc" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-gc was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-gc was not specified, hoping linker would find it" >&2;} fi if test -z "$GC_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgc" >&5 $as_echo_n "checking for libgc... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $GC_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern int GC_dont_gc; int main () { GC_dont_gc=0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$GC"; then as_fn_error $? "please specify path to libgc: --with-gc=D" "$LINENO" 5 else as_fn_error $? "$GC does not seem to be valid libgc installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi # Check whether --with-pcre was given. if test "${with_pcre+set}" = set; then : withval=$with_pcre; PCRE=$withval PCRE_INCLUDES="-I$PCRE/include" PCRE_LIBS="$PCRE/lib/libpcre.la" if test -f $PCRE/include/pcre.h -a -f $PCRE_LIBS; then PCRE_OK="yes" else PCRE_LIBS="-L$PCRE -lpcre" fi if test "$PCRE" = "yes"; then PCRE="" PCRE_LIBS="-lpcre" PCRE_INCLUDES="" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-pcre value was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-pcre value was not specified, hoping linker would find it" >&2;} fi else PCRE_LIBS="-lpcre" PCRE_INCLUDES="" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-pcre was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-pcre was not specified, hoping linker would find it" >&2;} fi if test -z "$PCRE_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prce" >&5 $as_echo_n "checking for prce... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *v=pcre_version(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$PCRE"; then as_fn_error $? "please specify path to PCRE: --with-pcre=D" "$LINENO" 5 else as_fn_error $? "$PCRE does not seem to be valid PCRE installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi # Check whether --with-xml was given. if test "${with_xml+set}" = set; then : withval=$with_xml; XML=$withval XML_LIBS="-lxml2 -lxslt -lexslt" if test -z "$XML" -o "$XML" = "yes"; then XML="" XML_INCLUDES="-I/usr/include/libxml2" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-xml value was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-xml value was not specified, hoping linker would find it" >&2;} else XML_INCLUDES="-I$XML/include -I$XML/include/libxml2" if test -f $XML/include/libxslt/xslt.h -a -f $XML/lib/libxml2.la \ -a -f $XML/lib/libxslt.la -a -f $XML/lib/libexslt.la; then XML_LIBS="$XML/lib/libxml2.la $XML/lib/libxslt.la $XML/lib/libexslt.la" XML_OK="yes" fi fi if test -z "$XML_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xml" >&5 $as_echo_n "checking for xml... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $XML_LIBS $XML_INCLUDES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *v=xsltEngineVersion; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$XML"; then as_fn_error $? "please specify path to Gnome XML libraries: --with-xml=D" "$LINENO" 5 else as_fn_error $? "$XML does not seem to be valid Gnome XML installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi $as_echo "#define XML /**/" >>confdefs.h fi # Check whether --with-mailreceive was given. if test "${with_mailreceive+set}" = set; then : withval=$with_mailreceive; MIME=$withval GLIB="glib-2.0" GMIME="gmime-2.4" if test -z "$MIME" -o "$MIME" = "yes"; then MIME="" MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null` MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-mailreceive value was not specified, hoping linker would find Gnome MIME library" >&5 $as_echo "$as_me: WARNING: --with-mailreceive value was not specified, hoping linker would find Gnome MIME library" >&2;} else MIME_INCLUDES="-I$MIME/include/$GMIME" MIME_LIBS="-l$GMIME" if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then MIME_LIBS="$MIME/lib/lib$GMIME.la" if test -f $MIME/lib/lib$GLIB.la; then MIME_INCLUDES="$MIME_INCLUDES -I$MIME/include/$GLIB -I$MIME/lib/$GLIB/include" else GLIB_INCLUDES=`pkg-config --cflags $GLIB 2>/dev/null` MIME_INCLUDES="$MIME_INCLUDES $GLIB_INCLUDES" fi MIME_OK="yes" fi fi if test -z "$MIME_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mime" >&5 $as_echo_n "checking for mime... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { guint v=gmime_major_version; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$MIME"; then as_fn_error $? "please specify path to Gnome MIME library: --with-mailreceive=D" "$LINENO" 5 else as_fn_error $? "$MIME does not seem to be valid Gnome MIME installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi $as_echo "#define WITH_MAILRECEIVE /**/" >>confdefs.h fi # Check whether --with-sendmail was given. if test "${with_sendmail+set}" = set; then : withval=$with_sendmail; cat >>confdefs.h <<_ACEOF #define PA_FORCED_SENDMAIL "$withval" _ACEOF fi # Check whether --with-apache was given. if test "${with_apache+set}" = set; then : withval=$with_apache; APXS=$withval if test -z "$APXS" -o "$APXS" = "yes"; then APXS=`which apxs 2>/dev/null` if test -z "$APXS"; then APXS=`which apxs2 2>/dev/null` fi fi APACHE=`$APXS -q TARGET 2>/dev/null` if test -z "$APACHE"; then as_fn_error $? "$APXS does not seem to be valid apache apxs utility path" "$LINENO" 5 fi APACHE_MAIN_INC=`$APXS -q INCLUDEDIR` APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null` APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC" APACHE_CFLAGS=`$APXS -q CFLAGS` fi if test -n "$APACHE"; then COMPILE_APACHE_MODULE_TRUE= COMPILE_APACHE_MODULE_FALSE='#' else COMPILE_APACHE_MODULE_TRUE='#' COMPILE_APACHE_MODULE_FALSE= fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= 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 LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ARGZ_H=argz.h; _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Set options # Check whether --with-included_ltdl was given. if test "${with_included_ltdl+set}" = set; then : withval=$with_included_ltdl; fi if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default " if test "x$ac_cv_header_ltdl_h" = xyes; then : ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default #include " if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 $as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lt_dladvise_preload (); int main () { return lt_dladvise_preload (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dladvise_preload=yes else ac_cv_lib_ltdl_lt_dladvise_preload=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : with_included_ltdl=no else with_included_ltdl=yes fi else with_included_ltdl=yes fi else with_included_ltdl=yes fi fi # Check whether --with-ltdl_include was given. if test "${with_ltdl_include+set}" = set; then : withval=$with_ltdl_include; fi if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else as_fn_error $? "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5 fi else with_ltdl_include=no fi # Check whether --with-ltdl_lib was given. if test "${with_ltdl_lib+set}" = set; then : withval=$with_ltdl_lib; fi if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. $as_echo "#define HAVE_LTDL 1" >>confdefs.h LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) as_fn_error $? "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5 ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 $as_echo_n "checking where to find libltdl headers... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 $as_echo "$LTDLINCL" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 $as_echo_n "checking where to find libltdl library... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 $as_echo "$LIBLTDL" >&6; } # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi subdirs="$subdirs src/lib/ltdl" # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" fi done for ac_func in strlcat strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define PA_BIG_ENDIAN /**/" >>confdefs.h ;; #( no) $as_echo "#define PA_LITTLE_ENDIAN /**/" >>confdefs.h ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "word endianness not determined for some obscure reason" "$LINENO" 5 ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" " #include #ifdef HAVE_DIRENT_H # include #else # define dirent direct # ifdef HAVE_SYS_NDIR_H # include # endif # ifdef HAVE_SYS_DIR_H # include # endif # ifdef HAVE_NDIR_H # include # endif #endif " if test "x$ac_cv_member_struct_dirent_d_type" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_DIRENT_D_TYPE 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h strings.h inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in assert.h limits.h ctype.h math.h process.h stdarg.h setjmp.h signal.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in errno.h dirent.h fcntl.h io.h sys/file.h sys/locking.h sys/select.h sys/resource.h sys/wait.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/socket.h netinet/in.h arpa/inet.h netdb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done case "$host" in *-freebsd4*) $as_echo "#define FREEBSD4 /**/" >>confdefs.h ;; *-sunos5.6* | *-solaris2.6*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lxnet" >&5 $as_echo_n "checking for main in -lxnet... " >&6; } if ${ac_cv_lib_xnet_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xnet_main=yes else ac_cv_lib_xnet_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_main" >&5 $as_echo "$ac_cv_lib_xnet_main" >&6; } if test "x$ac_cv_lib_xnet_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXNET 1 _ACEOF LIBS="-lxnet $LIBS" fi ;; *-sunos5* | *-solaris2*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 $as_echo_n "checking for main in -lsocket... " >&6; } if ${ac_cv_lib_socket_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_main=yes else ac_cv_lib_socket_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 $as_echo "$ac_cv_lib_socket_main" >&6; } if test "x$ac_cv_lib_socket_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } if ${ac_cv_lib_nsl_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_main=yes else ac_cv_lib_nsl_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } if test "x$ac_cv_lib_nsl_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ;; *-nec-sysv4*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi ;; *-cygwin*) $as_echo "#define WIN32 /**/" >>confdefs.h ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if ${ac_cv_lib_m_sin+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sin (); int main () { return sin (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sin=yes else ac_cv_lib_m_sin=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } if ${ac_cv_lib_crypt_crypt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_crypt=yes else ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } if test "x$ac_cv_lib_crypt_crypt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF LIBS="-lcrypt $LIBS" fi for ac_func in flock _locking fcntl lockf ftruncate fchmod do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done pa_func=sigsetjmp { $as_echo "$as_me:${as_lineno-$LINENO}: checking for (maybe built-in) function $pa_func" >&5 $as_echo_n "checking for (maybe built-in) function $pa_func... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SETJMP_H # include #endif int main () { $pa_func(0,0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$pa_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu for pa_func in trunc round sign do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for (maybe built-in) math function $pa_func" >&5 $as_echo_n "checking for (maybe built-in) math function $pa_func... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_MATH_H # include #endif int main () { double result=$pa_func(1.6); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$pa_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done 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 for ac_func in qsort do : ac_fn_c_check_func "$LINENO" "qsort" "ac_cv_func_qsort" if test "x$ac_cv_func_qsort" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_QSORT 1 _ACEOF else as_fn_error $? "No qsort library function." "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone variable" >&5 $as_echo_n "checking for timezone variable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { time_t test=timezone; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_TIMEZONE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daylight variable" >&5 $as_echo_n "checking for daylight variable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int test=daylight; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_DAYLIGHT 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_gmtoff in struct tm" >&5 $as_echo_n "checking for tm_gmtoff in struct tm... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct tm tm; tm.tm_gmtoff=0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_tzadj in struct tm" >&5 $as_echo_n "checking for tm_tzadj in struct tm... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct tm tm; tm.tm_tzadj=0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_TM_TZADJ 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_config_headers="$ac_config_headers src/include/pa_config_auto.h" ac_config_files="$ac_config_files Makefile src/Makefile src/types/Makefile src/classes/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/lib/Makefile src/lib/gd/Makefile src/lib/smtp/Makefile src/lib/gc/Makefile src/lib/gc/include/Makefile src/lib/pcre/Makefile src/lib/cord/Makefile src/lib/cord/include/Makefile src/lib/cord/include/private/Makefile src/lib/md5/Makefile src/lib/sdbm/Makefile src/lib/sdbm/pa-include/Makefile src/lib/json/Makefile src/lib/memcached/Makefile src/lib/curl/Makefile src/targets/Makefile src/targets/cgi/Makefile src/targets/apache/Makefile src/targets/isapi/Makefile etc/Makefile etc/parser3.charsets/Makefile bin/Makefile bin/auto.p.dist" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COMPILE_APACHE_MODULE_TRUE}" && test -z "${COMPILE_APACHE_MODULE_FALSE}"; then as_fn_error $? "conditional \"COMPILE_APACHE_MODULE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=src/include/pa_config_auto.h _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi ltdl_LIBOBJS=$_ltdl_libobjs ltdl_LTLIBOBJS=$_ltdl_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by parser $as_me 3.4.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ parser config.status 3.4.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "src/include/pa_config_auto.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pa_config_auto.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/types/Makefile") CONFIG_FILES="$CONFIG_FILES src/types/Makefile" ;; "src/classes/Makefile") CONFIG_FILES="$CONFIG_FILES src/classes/Makefile" ;; "src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/main/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/Makefile" ;; "src/sql/Makefile") CONFIG_FILES="$CONFIG_FILES src/sql/Makefile" ;; "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; "src/lib/gd/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/gd/Makefile" ;; "src/lib/smtp/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/smtp/Makefile" ;; "src/lib/gc/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/gc/Makefile" ;; "src/lib/gc/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/gc/include/Makefile" ;; "src/lib/pcre/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/pcre/Makefile" ;; "src/lib/cord/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/cord/Makefile" ;; "src/lib/cord/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/cord/include/Makefile" ;; "src/lib/cord/include/private/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/cord/include/private/Makefile" ;; "src/lib/md5/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/md5/Makefile" ;; "src/lib/sdbm/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/sdbm/Makefile" ;; "src/lib/sdbm/pa-include/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/sdbm/pa-include/Makefile" ;; "src/lib/json/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/json/Makefile" ;; "src/lib/memcached/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/memcached/Makefile" ;; "src/lib/curl/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/curl/Makefile" ;; "src/targets/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/Makefile" ;; "src/targets/cgi/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/cgi/Makefile" ;; "src/targets/apache/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/apache/Makefile" ;; "src/targets/isapi/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/isapi/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/parser3.charsets/Makefile") CONFIG_FILES="$CONFIG_FILES etc/parser3.charsets/Makefile" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "bin/auto.p.dist") CONFIG_FILES="$CONFIG_FILES bin/auto.p.dist" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_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=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # What type of objects to build. pic_mode=$pic_mode # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi parser-3.4.3/buildall000755 000000 000000 00000015335 12230230045 014630 0ustar00rootwheel000000 000000 #!/bin/sh # $Id: buildall,v 1.12 2013/10/18 12:57:09 moko Exp $ install_directory=$HOME/parser3install sendmail_command="/usr/sbin/sendmail -i -t -f postmaster" parser3_dir=`pwd` cd .. project_dir=`pwd` build_xml="yes" build_gmime="" build_apache="" build_stripped="" options="--with-included-ltdl" options="$options --with-gc=$project_dir/gc/lib" options="$options --with-pcre=$project_dir/pcre" #options="$options --disable-stringstream" echo "Building statically linked parser3\c" for PARAM in "$@"; do case "$PARAM" in "--without-xml") echo ", without xml\c" build_xml="" ;; "--with-apache") echo ", with apache module\c" options="$options --with-apache" build_apache="yes" ;; "--with-mailreceive") echo ", with mail receiving\c" options="$options --with-mailreceive=$project_dir/gnome" build_gmime="yes" ;; "--strip") echo ", without debug information\c" build_stripped="yes" ;; "--help") echo echo "Usage: buildall [--without-xml] [--with-apache] [--with-mailreceive] [--strip] [--disable-safe-mode] [other configure options ...]" exit 1 ;; *) options="$options $PARAM" ;; esac done if test "$build_xml" = "yes"; then options="$options --with-xml=$project_dir/gnome" fi bits=`getconf LONG_BIT` if test "$bits" = "64" -o "$build_apache" = "yes"; then cflags="$cflags --with-pic" else cflags="$cflags --without-pic" fi if test ! "$build_apache" = "yes"; then cflags="$cflags --disable-shared" fi download=`which fetch 2>/dev/null` if test -f "$download"; then download="fetch -p" else download="wget -c --passive-ftp" fi ############################### Support functions ################################ prepare_gz () { cd $project_dir/src if test ! -f "$1"; then echo "Downloading $lib..." $download $2$1 fi echo "Unpacking $lib..." rm -rf $lib gunzip -c $1 | tar xf - >/dev/null cd $lib } prepare_xz () { cd $project_dir/src if test ! -f "$1"; then echo "Downloading $lib..." $download $2$1 fi echo "Unpacking $lib..." rm -rf $lib xzcat $1 | tar xf - >/dev/null cd $lib } cleanup () { cd .. rm -rf $lib } #################################### Building #################################### echo mkdir src >/dev/null 2>&1 if test ! -f "$project_dir/gc/lib/libgc.a"; then # libgc="gc6.8" # FreeBSD 4.X is not supported in newer gc version lib="gc-7.2" prepare_gz ${lib}d.tar.gz http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/ echo "Configuring $lib..." CPPFLAGS="-DUSE_LIBC_PRIVATES -DUSE_MMAP -DDONT_ADD_BYTE_AT_END" \ ./configure --prefix=$project_dir/gc \ --disable-threads \ --disable-shared \ --silent $cflags echo "Building $lib..." make install cleanup fi if test ! -f "$project_dir/pcre/lib/libpcre.a"; then lib="pcre-8.33" prepare_gz $lib.tar.gz ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ echo "Configuring $lib..." ./configure --prefix="$project_dir/pcre" \ --with-match-limit-recursion=10000 \ --enable-utf8 \ --enable-unicode-properties \ --disable-shared \ --disable-cpp \ --disable-pcregrep-libz \ --disable-pcregrep-libbz2 \ --silent $cflags echo "Building $lib..." make install cleanup fi if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxml2.a"; then lib="libxml2-2.9.1" prepare_gz $lib.tar.gz ftp://xmlsoft.org/libxml2/ #sax1, output, tree, xinclude[in libxslt], html[in libxslt, mode=html?], xptr[xinclude], pattern -- needed! echo "Configuring $lib..." ./configure --prefix=$project_dir/gnome \ --without-catalog \ --without-iconv \ --without-threads \ --without-debug \ --without-iso8859x \ --without-legacy \ --without-push \ --without-python \ --without-writer \ --without-readline \ --without-regexps \ --without-schemas \ --without-schematron \ --without-modules \ --without-ftp \ --without-http \ --without-docbook \ --without-zlib \ --without-lzma \ --disable-shared \ --silent $cflags echo "Building $lib..." make install cleanup fi if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxslt.a"; then lib="libxslt-1.1.28" prepare_gz $lib.tar.gz ftp://xmlsoft.org/libxslt/ echo "Configuring $lib..." CFLAGS="-D__stub_clock_gettime -Dclock_gettime=choke_me" \ ./configure --prefix=$project_dir/gnome \ --with-libxml-prefix=$project_dir/gnome \ --without-debug \ --without-debugger \ --without-crypto \ --without-plugins \ --disable-shared \ --silent $cflags echo "Building $lib..." make install cleanup fi if test "$build_gmime" = "yes"; then glib_ldflags="" gmime_cflags="" gmime_ldflags="-L$project_dir/gnome/lib/" os=`uname` if test "$os" = "FreeBSD"; then gmime_cflags="CFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include" glib_ldflags="LDFLAGS=-L/usr/local/lib" gmime_ldflags="$gmime_ldflags -L/usr/local/lib" fi if test ! -f "$project_dir/gnome/lib/libglib-2.0.a"; then lib="glib-2.28.8" prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/glib/2.28/ echo "Configuring $lib..." ./configure --prefix=$project_dir/gnome \ --enable-dtrace=no \ --enable-debug=no \ --enable-iconv-cache=no \ --disable-fam \ --disable-selinux \ --disable-xattr \ --disable-shared \ --enable-static \ --silent $cflags $gmime_cflags $glib_ldflags echo "Building $lib..." make install cleanup fi if test ! -f "$project_dir/gnome/lib/libgmime-2.4.a"; then lib="gmime-2.4.32" prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/gmime/2.4/ echo "Configuring $lib..." ./configure --prefix=$project_dir/gnome \ --disable-glibtest \ --disable-mono \ --disable-shared \ --enable-static \ --silent $cflags $gmime_cflags LDFLAGS="$gmime_ldflags" PKG_CONFIG_PATH="$project_dir/gnome/lib/pkgconfig" echo "Building $lib..." make install cleanup fi fi cd $parser3_dir if test ! -f "Makefile"; then echo "Configuring parser3..." ./configure --prefix=$install_directory "--with-sendmail=$sendmail_command" $options --silent $cflags $gmime_cflags fi echo "Building parser3..." make install if test $? -ne 0; then exit 1; fi if test "$build_stripped" = "yes"; then strip ${install_directory}/bin/parser3 fi echo "DONE" echo echo "********************************************************************************************************" echo "Now you can copy $install_directory/bin to your cgi-bin directory" echo "Read more about installing Parser here:" echo " http://www.parser.ru/en/docs/lang/install4apachecgi.htm in English" echo " http://www.parser.ru/docs/lang/install4apachecgi.htm in Russian" echo "********************************************************************************************************" parser-3.4.3/Makefile.in000644 000000 000000 00000055457 12234222475 015204 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS config.guess config.sub depcomp \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck 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)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src etc bin ACLOCAL_AMFLAGS = -I src/lib/ltdl/m4 EXTRA_DIST = operators.txt parser3.sln gnu.vcproj buildall acsite.m4 all: 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'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .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) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | 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-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(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 $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(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) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../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 \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__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 installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am commit: # trick to make 'make' happy at check out time # and avoid redundant remaking: aclocal+autoconf+automake cvs commit -m "no message" -f configure.in acsite.m4 aclocal.m4 Makefile.am Makefile.in configure src/include/pa_config_auto.h.in # 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: parser-3.4.3/ChangeLog000644 000000 000000 00002671062 12233760207 014706 0ustar00rootwheel000000 000000 2013-10-29 moko * src/lib/json/json.vcproj: json.c -> pa_json.C * src/lib/json/pa_json.C: C++ compatibility addes, related to issue #892 * src/: classes/json.C, lib/json/Makefile.am, lib/json/json.c, lib/json/json.h, lib/json/pa_json.C: json.c -> pa_json.C (for exceptions to be thrown thougth json library), related to issue #892 * src/main/pa_charset.C: avoid compilation bug in Debian 6.0.8 x32, related to issue #896 2013-10-24 moko * configure.in, src/include/pa_version.h: 3.4.3rc -> 3.4.3 2013-10-23 moko * README: actualization 2013-10-22 moko * src/targets/apache/mod_parser3.c: Adopted apache 2.4 compatibility patch from Sergey Kirpichev * tests/: 297.html, results/297.processed: non-working getter fix test for issue #948 * src/: include/pa_request.h, main/pa_request.C: Now getter is not called when saving value of $match variable in ^string.match[] to increase compatibility (related to issue #948). * src/: include/pa_request.h, targets/cgi/parser3.C: minor header usage optimization 2013-10-21 moko * tests/: 182.html, results/182.processed: local path removed for compatibility * tests/: 244.html, 253.html, 254.html, 275.html, 281.html, results/244.processed, results/253.processed, results/254.processed, results/275.processed, results/281.processed: try_catch -> try-catch * tests/: 288.html, 294.html, 296.html, results/288.processed, results/294.processed, results/296.processed: try_catch -> try-catch 2013-10-20 moko * tests/: 296.html, results/296.processed: test for xsl exception for issue #938 added. * src/: include/pa_xml_exception.h, main/pa_stylesheet_connection.C: forgotten to be replaced XmlException is now replaced (once again closes issue #938) 2013-10-19 misha * bin/auto.p.dist.in: - more mime-types are added 2013-10-18 moko * buildall: disable clock_gettime detection to avoid librt linking (which in turn depends on libpthread), related to issue #943 2013-10-18 misha * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/apache/ApacheModuleParser3Core.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: - new locations for libxml2 includes where added to vcproj files 2013-10-18 moko * src/classes/: hashfile.C, op.C: hopefully last part of issue #948 fix * tests/: 295.html, results/295.processed: test for issue #948 updated * src/classes/table.C: hopefully last lost part for issue #948 fix. :) * tests/: 295.html, results/295.processed: test for issue #948 added * src/: classes/hash.C, classes/string.C, classes/table.C, include/pa_request.h, types/pa_method.h: for getters and setters to be executed request.put_element should be called, not context.put_element (fixes issue #948) 2013-10-17 moko * src/classes/xdoc.C: libxml 2.9.1 compatibility with define LIBXML2_NEW_BUFFER check (closes issue #943) * buildall: libxml 2.9.1 build is broken --without-reader. 2013-10-16 moko * configure.in, src/include/pa_version.h: 3.4.3b -> 3.4.3rc * tests/: 294.html, results/294.processed: test for issue #938 * src/: classes/xdoc.C, classes/xnode.C, include/pa_xml_exception.h, main/pa_xml_exception.C: XmlException now calls fixUTF8 if source charset is UTF-8 (closes issue #938) * buildall: pcre-8.30 -> pcre-8.33 libxml2-2.8.0 -> libxml2-2.9.1 libxslt-1.1.26 -> libxslt-1.1.28 * src/: include/pa_charset.h, lib/pcre/pa_pcre_internal.h, main/pa_charset.C: fixUTF8 method added to replace invalid UTF-8 to '?', related to issue #938 2013-10-15 moko * src/: include/pa_common.h, main/pa_charset.C, main/pa_common.C, main/untaint.C: json chars 0x01-0x1F now are escaped as \u00XX, minor optimizations (closes issue #896) * tests/results/: 292.processed, 293.processed: results updated to comply with issue #896 * tests/: 292.html, 293.html, results/292.processed, results/293.processed: tests for json escaping 2013-10-14 moko * src/: include/pa_common.h, main/pa_common.C: minor rearrangements and cleanup, code moved from .h to .C, no changes in code 2013-10-12 moko * tests/results/119.processed: updated test result commited * tests/: 291.html, results/291.processed: test for issue #894 added * src/types/pa_wcontext.h: base methods call support function get_somebody_entered_some_class should not be true forever, as wcontext can have many get_elements calls (fixes issue #894) 2013-10-11 moko * tests/: 290.html, results/290.processed: test for junction GPF issue #942 added * src/types/pa_vmethod_frame.h: GPF if method junctions is passed to native method fixed (closes issue #942) * tests/: 158.html, results/158.processed: test for csv-string[] added * src/classes/table.C: minor fixes for table.csv-string[] (closes feature #907) * src/classes/table.C: ^table.csv-string[] from misha@ (implements feature #907) 2013-10-09 moko * src/: main/pa_request.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.C: GET_default, SET_default now works properly not only in objects, but in classes as well (closes issue #903) * tests/: 289.html, results/289.processed: GET/SET_default now works in classes, not only objects, test case added, related to issue #903 * tests/: 288.html, results/288.processed: test for endless recursion bug added (related to issue #903) 2013-10-05 moko * src/: classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmemcached.C, types/pa_vmemcached.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: optimization: put_element no longer has "bool areplace" argument, related to issue #903 2013-10-03 moko * tests/results/182.processed: result for $.replace(false) test commited * src/classes/date.C: ^date::create(number) processed correctly (fixes issue #901) * src/classes/image.C: as_no_junction removed, as param can be expression (closes issue #931) * tests/233.html: test for issue #931 added 2013-10-02 moko * tests/: 182.html, 182_dir/a5.p: test for $.replace(true) modified, test for $.replace(false) added * src/main/compile_tools.h: forgotten class replace returned. :) 2013-09-30 moko * tests/: 141.html, results/141.processed: md5 tainting test added * src/: classes/op.C, include/pa_request.h, main/compile.y, main/compile_tools.h, main/pa_request.C: allow_class_replace implemented; $.replace option added to ^process and ^use 2013-08-27 moko * src/classes/: file.C, json.C, math.C, string.C, xdoc.C: cstr_to_string_body_untaint should be called with charsets for possible uri language and connection for possible sql language. related to issue #857 * buildall: and -> or fixed 2013-08-26 moko * buildall: prepare_ functions logic changed to support gc-7.2d.tar.gz extracting to gc-7.2 directory 2013-08-23 moko * src/include/pa_config_fixed.h: gc and xml libs are now linked statically 2013-08-22 moko * src/classes/string.C: String::Empty used (related to issue #912) append_know_length removed (related to old GPF bug) 2013-08-21 moko * src/classes/math.C: untaint(L_AS_IS) added for md5 and sha1 * src/classes/math.C: ^math:digest[...;$file] support added (related to ticket #857 * tests/: 141.html, results/141.processed: ^math:digest[...;$file] implemented * src/types/pa_vhashfile.h: warning war * src/: classes/json.C, classes/op.C, include/pa_hash.h, include/pa_request.h, main/pa_request.C, types/pa_value.h: anti_endless_json_string_recoursion removed from request; json_string_recoursion added to json_options; $.indent[indent value] now supported and passed within recoursion closes feature #937 * tests/: 287.html, results/287.processed: test for feature #937 2013-07-31 moko * src/lib/json/: json.c, pa_json.C: STATE__X -> STATE_XX for cygwin compilation having #define _S * src/main/pa_globals.C: cleanup 2013-07-30 moko * src/: classes/table.C, include/pa_common.h, main/pa_charset.C, main/pa_common.C: vs2003 warning war * src/lib/json/: json.c, pa_json.C: vs2003 warning war * src/lib/json/: json.c, pa_json.C: vs2003 compilation fix * src/lib/md5/pa_sha2.c: warning war 2013-07-29 moko * src/lib/json/: json.c, json.h, pa_json.C, pa_json.h: some libjson patches from github * src/: classes/bool.C, classes/double.C, classes/int.C, classes/memcached.C, include/pa_config_includes.h, types/pa_vfile.C, types/pa_vfile.h: warning war * src/lib/json/json.vcproj: C++ -> C * src/lib/json/: json.c, pa_json.C: C++ warning revert * src/lib/json/: json.c, pa_json.C: windows compatibility * src/lib/json/: json.c, pa_json.C: windows compatibility * src/lib/json/: json.c, pa_json.C: warning war * src/lib/json/: json.c, pa_json.C: win32 compilation issues fixes * src/include/pa_config_fixed.h: uint16_t added * configure.in: uint16_t check added * src/: classes/json.C, lib/json/JSON_parser.C, lib/json/JSON_parser.h, lib/json/Makefile.am, lib/json/json.c, lib/json/json.h, lib/json/json.vcproj, lib/json/pa_json.C, lib/json/pa_json.h: JSON_parser with non-free licence is replaced with similar GPL licenced libjson (fixes issue #892) 2013-07-25 moko * parser3.sln: dependencies added * parser3.sln, src/targets/apache/ApacheModuleParser3.vcproj, src/targets/apache/ApacheModuleParser3Core.vcproj: win32 apache module support * src/targets/apache/mod_parser3_core.C: win32 cleanup * src/targets/apache/mod_parser3.c: win32 apache 2.2 module 2013-07-23 moko * src/: include/pa_memory.h, main/pa_memory.C: non-working PA_DEBUG_GC_MEMORY removed * src/: main/pa_globals.C, targets/cgi/parser3.C: PA_DEBUG_DISABLE_GC compilation fix * src/: classes/op.C, classes/table.C, include/pa_request.h, main/pa_request.C: outdated RESOURCES_DEBUG removed * src/: main/pa_os.C, targets/cgi/parser3.C: headers cleanup, garbage cleanup * src/main/pa_common.C: warning war * src/: include/pa_http.h, main/pa_http.C: headers cleanup * src/: include/pa_common.h, main/pa_common.C: WIN32 -> _MSC_VER, minor cleanup * src/: include/pa_dir.h, main/pa_dir.C: loaddir under cygwin now uses cygwin, not WIN32 implementation * src/main/pa_exec.C: WIN32 -> _MSC_VER, under cygwin unix exec is able to exec shell scripts * src/classes/math.C: ifdef WIN32 cleanup * src/types/pa_vmemcached.C: LT_MODULE_EXT used * bin/auto.p.dist.in: libpq.so -> libpq. * src/classes/curl.C: LT_MODULE_EXT used * src/include/pa_config_fixed.h: LT_MODULE_EXT defined 2013-07-22 moko * src/include/: pa_config_fixed.h, pa_config_includes.h: win32 includes fix * src/: main/pa_common.C, targets/cgi/parser3.C: includes cleanup * configure.in, src/include/pa_config_includes.h, src/lib/smtp/comms.C, src/lib/smtp/smtp.C, src/lib/smtp/smtp.h, src/main/pa_exec.C: includes cleanup * src/targets/cgi/parser3.C: 2012->2013 * src/include/pa_version.h: 3.4.2 -> 3.4.3b * configure.in, src/include/pa_config_includes.h, src/include/pa_http.h, src/lib/json/JSON_parser.h, src/main/pa_random.C, src/main/pa_socks.C, src/types/pa_vstatus.C: cygwin support cleanup * configure.in: dirent.h check added * src/: include/pa_config_includes.h, include/pa_dir.h, main/pa_dir.C: includes cleanup, dirent.h check added filePath not copied 2013-07-21 moko * src/lib/cord/cord.vcproj: unused cordprnt.c removed * src/targets/cgi/: Makefile.am, getopt.c, getopt.h, parser3.vcproj: unused getopt.h / getopt.c removed * operators.txt, src/classes/file.C, tests/022.html, tests/results/022.processed: ^file:list[path][$.filter[regexp] $.stat(true)] usage commented * configure.in, src/classes/file.C, src/include/pa_dir.h, src/main/pa_dir.C: ^file:list[] now has dir column and when $.stat(true) it has size/*date columns modified patch from misha@ that closes issue #914. * src/: include/pa_config_includes.h, main/pa_globals.C: PA_RELEASE_ASSERTS removed * src/lib/md5/pa_md5c.c: minor cleanup * src/lib/json/: JSON_parser.C, JSON_parser.h: headers cleanup, localeconv()->decimal_point usage remoed (related to issue #934) * src/lib/cord/: Makefile.am, cordprnt.c, include/cord.h: unused cordprnt.c removed * src/lib/sdbm/: sdbm.c, sdbm_pair.c, pa-include/pa_apr.h, pa-include/pa_errno.h, pa-include/pa_file_io.h, pa-include/pa_strings.h: includes cleanup * src/lib/md5/pa_md5c.c: headers cleanup 2013-07-20 moko * src/lib/cord/: cordbscs.c, cordprnt.c, cordxtra.c: includes cleanup 2013-07-19 moko * src/classes/math.C: extern "C" added for crypt 2013-07-18 moko * src/classes/math.C: fix redhat7.2 build 2013-07-17 moko * configure.in, src/include/pa_config_includes.h, src/include/pa_config_fixed.h: headers actualized (inttypes.h added for uint8/32/64_t) * src/lib/md5/: pa_md5.h, pa_md5c.c, pa_sha2.c, pa_sha2.h: pa_config_includes.h used for uint32/64_t 2013-07-16 moko * src/: include/pa_string.h, main/pa_string.C, types/pa_vform.C, types/pa_vform.h, types/pa_vobject.C, types/pa_vobject.h: warning war * src/main/compile.tab.C: compile.y was updated * src/main/compile.y: warning war * src/: include/pa_exception.h, main/pa_exception.C, main/pa_xml_exception.C: warning war * src/: include/pa_common.h, main/pa_common.C: warning war * configure.in: beauty :) * tests/: 141.html, results/141.processed: sha256/512 added 2013-07-13 moko * src/lib/md5/md5.vcproj: sha2 added * src/: lib/md5/pa_sha2.c, lib/md5/pa_sha2.h, lib/md5/Makefile.am, classes/math.C: sha2 support (sha256/sha512 digest) 2013-07-08 moko * src/classes/image.C: directory read or other read problem message fixed (related to issue #933) 2013-07-07 moko * bin/auto.p.dist.in: windows-1251 commented to remove auto.p dependense from $charsetsdir directory existance and content (and UTF-8 is default allready) * AUTHORS: + misha + moko. :) 2013-07-06 moko * src/: classes/curl.C, include/pa_globals.h, include/pa_sql_driver_manager.h, lib/memcached/pa_memcached.C, main/pa_globals.C, main/pa_sql_driver_manager.C: pa_dlinit added for lt_dlinit to be called once and lt_dlexit called at right place (related to issue #925) 2013-07-04 moko * src/types/: pa_vfile.C, pa_vfile.h, pa_vstring.C: VString::as_vfile now uses vfile.set_binary_string to avoid content-type to be set, as it brokes badly designed logic in response output. This hopefully finishes issue #928. * tests/results/: 256.processed, 286.processed: file now displayed as name, size, mode, content-type * src/main/pa_common.C: read error now reported cottectly (fixes issue #933 2013-06-28 moko * tests/: 286.html, results/286.processed: test extended * tests/: 286.html, results/286.processed: Test for issue #928 added. it tests default content-type change. * src/types/pa_vfile.C: closes issue #928 - default content-type now updated 2013-06-25 moko * src/: classes/file.C, types/pa_vfile.C, types/pa_vfile.h: default content-type for text/binary files without name added; ^file::create[$f;...] options now works properly and $f properties are default (fixes issue #928) 2013-05-16 misha * src/include/pa_opcode.h: - define for OBJECT_POOL optimisation is added * src/main/pa_table.C: - a tiny memory optimisation while creating table if specified limit is bigger than source rows count * src/classes/table.C: - ^table.foreach[k;v]{code}[separator] is added ( new feature: #858 ) 2013-04-29 moko * src/classes/curl.C: CURL_IPRESOLVE_V4 now set by default, $.ipresolve(0|1|2) added (closes issue #891) * src/lib/curl/curl.h: CURL_IPRESOLVE added 2013-04-24 moko * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: ^memcache.release[] added, calls memcached_quit (refs #893) 2013-04-22 moko * src/: include/pa_string.h, main/pa_common.C: no more double slashes in file path (fixes bug #872) * src/: classes/curl.C, lib/curl/curl.h: minor fixes related to CURLOPT_ENCODING renamed into CURLOPT_ACCEPT_ENCODING (issue #739) * tests/results/266.processed: $.max_params added (feature #915) * src/: include/pa_common.h, main/pa_http.C: response-charset option added to file::load (closes issue #867) 2013-04-20 misha * src/classes/curl.C: - forgotten CURL_ACCEPT_ENCODING option is commited 2013-03-15 misha * src/classes/: hash.C, table.C: - Optimisation: do not create multiple empty strings while ::sql. uae String::Empty instead 2013-03-14 misha * src/classes/reflection.C: - for user classes ^reflection:method_info[] returns $.max_params and $.extra_param with $.call_type if they available ( new feature: #915 ) * src/classes/file.C: - ^file:delete[] now supports an option $.exception(false) that suppress any exception while deleting file ( new feature: #916 ) * src/classes/curl.C: - parsing cookies after curl:load now should work :) 2013-03-12 misha * src/types/pa_vfile.C: - if specified file_name is empty string set default name for the file 2013-03-11 misha * src/classes/curl.C: - after $f[^curl:load[...]] the cookies are also available in $f.cookies * src/: include/pa_http.h, main/pa_http.C: - parsing cookies is moved to a separate method 2013-03-10 moko * src/include/pa_config_fixed.h: typedef unsigned int uint32_t added * src/lib/memcached/pa_memcached.h: typedef unsigned int uint32_t removed (declared by autoconf) * configure.in: AC_TYPE_SSIZE_T, AC_TYPE_UINT32_T added for uint32_t define 2013-03-10 misha * src/classes/file.C: ^file:delete and ^file:move now support option $.keep-empty-dirs(true) ( new feature: #884 ) * src/: include/pa_common.h, main/pa_common.C: - option for keeping empty dirs is added 2013-03-10 moko * src/classes/: bool.C, double.C, int.C: default can be present, but default check removed from ^int/double/bool.int/double/bool for string.int/double/bool compatibility (related to issue #913) * src/classes/string.C: ^string.int/dobule/bool no longer internally throws exception if default is present (closes issue #913) 2013-03-09 misha * src/types/: pa_vhash.h, pa_vregex.h, pa_vtable.h: - tiny optimisations ( #845 ) * src/types/pa_venv.C: - added $env:fields ( new feature: #906 ) 2013-03-08 moko * src/main/pa_http.C: GPF on ^cookies:save fixed, $file.cookies now creates correct table (fixes issue #910) * src/classes/op.C: r.connection() -> r.connection(false) to allow use outside of 'connect' operator (fixes issue #911) * tests/results/: 096.processed, 122.processed: test results updated as doubles now printed with 15 significant digits, not 5 (fixes issue #882) * src/types/pa_vdouble.h: %.15g now used to format doubles instead of broken has_frac() ? "%g": "%.0f" logic (fixes issue #882) 2013-02-21 moko * src/classes/table.C: _locate_name_value does not check arguments count, so we check it in advance (fixes issue #905) 2012-10-23 moko * buildall: old shell for and echo compatibility (for six) 2012-10-19 moko * buildall: --strip added --disable-safe-mode listed in usage 2012-10-17 misha * src/classes/op.C: - apply-taint should not throw "outside connect" exception with sql lang now 2012-10-17 moko * src/main/pa_request.C: bugfix: safe mode should be inited for each request (for apache module) 2012-09-26 moko * src/doc/doxygen.cfg: png -> svg 2012-09-25 moko * tests/: 141.html, results/141.processed: md5 hmac added, long key test added * src/classes/math.C: HMAC for MD5 added, bugfix for tempdigest double use when key is long 2012-09-16 moko * src/classes/math.C: Format -> Method Encode -> Format * tests/: 141.html, results/141.processed: math:digest hmac test added 2012-09-14 moko * src/classes/math.C: SHA1ReadDigest added and used in ^sha1. ^digest[sha1|md5;data; $.encode[base64|hex] $.hmac[key]] basic implementation added 2012-09-12 moko * src/doc/: doxygen.cfg, footer.htm, index.dox, string.dox, targets.dox: doxygen.cfg and footer.htm updated for doxygen 1.7.3 targets.dox and string.dox slightly actualized 2012-08-31 moko * ChangeLog: now generated with patched cvs2cl.pl 2012-07-29 moko * tests/285.html, src/main/execute.C, tests/results/285.processed: result should be pushed after VMethodFrame destructor is called, as it deletes junctions from stack params (fixes issue #868) 2012-07-23 moko * INSTALL, README: buildall script usage documented, other outdated info updated. * buildall-with-xml, buildall-without-xml: replaced by buildall 2012-07-21 moko * buildall: glib does not compile when threads are disabled... * src/types/pa_vmail.C: g_assertion fixes for empty input * src/types/pa_vmail.C: yet another fix (strange GPF on object unref, can't unref nested objects) * src/types/pa_vmail.C: another check added 2012-07-19 moko * buildall: usage added * buildall: new buildall script that unites buildall-with-xml, buildall-without-xml, --with-apache and --with-mailreceive * configure.in: support for static gmime and dynamic glib linking. fixes for FreeBSD 2012-07-17 moko * configure.in: --with-mailreceive replaced --with-static-mailreceive and --with-shared-mailreceive pathlink removed 2012-07-16 moko * src/types/pa_vmail.C: updated to work gmime 2.6, headers now capitalized, content now decoded and text content converted to $request:charset. all properties are accessed by functions, this ready for dynamic load. 2012-06-28 moko * src/targets/apache/Makefile.am: fix for apache cflags for Linux 32 bit 2012-06-27 moko * buildall-with-xml, buildall-without-xml: fetch requires -p for passive ftp * src/lib/ltdl/ltdl.vcproj: release build fixed * configure.in: 3.4.2 RC -> 3.4.2 2012-06-22 moko * src/types/pa_vfile.C: returned empty mode to stated files (issue #815) * tests/: 284.html, results/284.processed: output options test (feature #265) 2012-06-22 misha * tests/215.html: - little changes 2012-06-21 moko * src/: classes/json.C, classes/xdoc.C, types/pa_vxdoc.C, types/pa_vxdoc.h: output_options returned and used (bugfix for feature #265) * buildall-with-xml, buildall-without-xml: --with-match-limit=10000 breaks long .*, default 10M restored. (issue #216) * tests/: 283.html, results/283.processed: test for issue #815 added * src/types/: pa_vfile.C, pa_vstring.C: bugfix: ^#0D not altered again, cstrm not required. * src/lib/ltdl/: argz.c, ltdl.c, libltdl/lt__glibc.h: fixes for Win32 and broken FreeBSD (issue #45) * src/lib/ltdl/ltdl.vcproj: preopen.c and config.h removed * src/main/pa_string.C: warnings war * src/: classes/mail.C, include/pa_dir.h, include/pa_http.h, lib/json/JSON_parser.h, lib/smtp/smtp.h, main/pa_random.C, main/pa_socks.C, targets/apache/pa_threads.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_vstatus.C: compilation under cygwin fixed 2012-06-19 moko * src/lib/ltdl/: config_fixed.h, ltdl.vcproj: compilation under Windows fixed * parser3.sln: removed antique pcre_ctype * src/include/pa_config_fixed.h: required for INT_MAX / UINT_MAX * src/include/pa_config_fixed.h: undefined reference to __imp__pcre_* fix for Windows * src/: include/pa_charset.h, lib/pcre/Makefile.am, lib/pcre/pa_pcre_internal.h, lib/pcre/pcre_internal.h: pcre_internal.h -> pa_pcre_internal.h for Windows compatibility (win32/pcre has own copy of pcre_internal.h _pcre_default_tables define fixed 2012-06-18 moko * src/classes/memcached.C: flush -> clear * src/classes/memcached.C: memcached does not support quotes even in server name * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C: version() called on open to check servers existance. $.key(true) syntax now supported 2012-06-17 moko * src/include/: pa_config_fixed.h, pa_config_includes.h: old stuff cleanup * src/classes/table.C, tests/282.cfg, tests/282.html, tests/results/282.processed: encloser at the EOF bug fixed, incorrectly enclosed data now processed more logicaly (fixes #339) 2012-06-15 moko * buildall-without-xml: sync with buildall-with-xml * buildall-with-xml: download auto-detected between fetch and curl * configure.in: --with-gc and --with-pcre now also processed correctly * aclocal.m4, configure, src/include/pa_config_auto.h.in: now aclocal -I src/lib/ltdl/m4/ && autoheader && automake && autoconf should be run on rol1 using automake / aclocal (GNU automake) 1.11.1 autoconf (GNU Autoconf) 2.68 * configure.in: new PARSER_VERSION logic * src/include/pa_version.h: new pa_version.h logic * src/: classes/curl.C, classes/file.C, classes/image.C, classes/xdoc.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vrequest.C, types/pa_vstring.C: feols_normalized -> fis_text_content set_binary added * src/targets/cgi/parser3.C: gcc compilation warnings fixed 2012-06-15 misha * src/: classes/curl.C, classes/file.C, classes/image.C, classes/xdoc.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vrequest.C, types/pa_vstring.C: - ^file::create[text;content] EOLs in content now is normalized. ( new feature: #815 ) 2012-06-15 moko * configure.in: --disable-version-update added to disable version update with host information (for debian package) whitespace optimized * configure.in: version changed to 3.4.2 RC no-pic added for libtool * src/include/pa_version.h: Nice pa_version.h default. Please keep it. 2012-06-14 moko * src/classes/hash.C, src/types/pa_vhash.h, tests/281.html, tests/results/281.processed: "hash flocked" error removed for safe operations like ^h._count[] ( new feature: #335 ) * src/targets/apache/Makefile.am: libmod_parser3 -> mod_parser3 * buildall-with-xml, buildall-without-xml: --with-static -> --with * configure.in: --with-static/shared xml replaced with --with-xml, xml compilation check added * configure.in: --with-static/shared-gc, --with-static-pcre are replaced with --with-gc and --with-pcre test for pcre linking added 2012-06-13 moko * configure.in: apxs2 check optimized * src/targets/cgi/Makefile.am: preserve-dup-deps requires .a, not .la, includes optimized * buildall-with-xml: --with-pic looks better for -fPIC * configure.in: switched to convenience library in static linking * src/targets/apache/Makefile.am: switched to convenience library usage to avoid libtool warnings * src/lib/: cord/Makefile.am, gd/Makefile.am, json/Makefile.am, md5/Makefile.am, memcached/Makefile.am, sdbm/Makefile.am, smtp/Makefile.am: switched to convenience library usage * src/sql/Makefile.am: pa_sql_driver.h should be in includes * src/targets/apache/Makefile.am: updated for libtool usage * bin/auto.p.dist.in: .cfg removed from charset names. * buildall-without-xml: --with-included-ltdl added * buildall-without-xml: sync with buildall-with-xml * buildall-with-xml: --with-included-ltdl added $cflags added for -fPIC for x64 $download added for wget success check added * buildall-without-xml: --with-dynamic-stdcpp removed * configure.in: disable-static returned * src/targets/cgi/Makefile.am: Automake 1.9 does not support LIBTOOLFLAGS 2012-06-12 moko * configure.in, src/targets/cgi/Makefile.am: disable-static not compatible with LIBTOOLFLAGS for unknown reasons * buildall-with-xml: --with-dynamic-stdcpp removed * configure.in: static/dynamic -lstdc++ linking option removed apxs2 check added * src/targets/cgi/Makefile.am: static/dynamic -lstdc++ linking option removed 2012-06-10 moko * src/targets/cgi/Makefile.am: --preserve-dup-deps libtool option added * src/targets/cgi/pp3.cmd: old PAF stuff * Makefile.am: ACLOCAL_AMFLAGS = -I src/lib/ltdl/m4 added and some beauty * depcomp: from libtool 2.4.2 * configure.in: ltdl directory removed, it has correct Makefile.in 2012-06-09 moko * Makefile.am, aclocal.m4, config.guess, config.sub, configure, install-sh, ltmain.sh, missing, src/include/pa_config_auto.h.in: autogenerated files updated after libtool update * src/lib/ltdl/: COPYING.LIB, Makefile.am, README, acinclude.m4, aclocal.m4, argz.c, argz_.h, config-h.in, config.h, config_auto.h.in, config_fixed.h, configure, configure.ac, configure.in, lt__alloc.c, lt__dirent.c, lt__strl.c, lt_dlloader.c, lt_error.c, ltdl.c, ltdl.h, slist.c, config/compile, config/config.guess, config/config.sub, config/depcomp, config/install-sh, config/ltmain.sh, config/missing, libltdl/lt__alloc.h, libltdl/lt__dirent.h, libltdl/lt__glibc.h, libltdl/lt__private.h, libltdl/lt__strl.h, libltdl/lt_dlloader.h, libltdl/lt_error.h, libltdl/lt_system.h, libltdl/slist.h, loaders/dld_link.c, loaders/dlopen.c, loaders/dyld.c, loaders/load_add_on.c, loaders/loadlibrary.c, loaders/preopen.c, loaders/shl_load.c, m4/argz.m4, m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: libtool updated to version 2.4.2 * configure.in: preparation for new libtool * configure.in: Some beauty added :) * src/targets/apache/Makefile.am: := -> = * src/lib/pcre/: Makefile.am, config.h: config.h removed once again. :) * src/include/pa_config_includes.h, configure.in: limits.h added, previously was taken from pcre_internal.h. :) * src/lib/pcre/Makefile.am: config.h returned * src/lib/pcre/config.h: still need this. :) * src/lib/pcre/pcre_internal.h: extracts from real pcre_internal.h * configure.in: --with-charsets removed; --with-mysql-client & co removed * buildall-with-xml, buildall-without-xml: pcre_internal.h extracts now in parser tree, no need to copy * src/lib/pcre/: Makefile.am, config.h, ibm-1250.ucm, ibm-1251.ucm, ibm-1254.ucm, ibm-1257.ucm, pcre_parser_ctype.c, pcre_parser_ctype.vcproj, ruspart_win2koi.pl, win-koi.tab: debian/patches/101_pcre.patch - local copy of pcre_internal.h extracts now used old trash removed * bin/auto.p.dist.in: all charsets are listed, utf-8 by default, rare charsets/drivers are commented, sql driver quessing removed (debian/patches/103_auto_p.patch) * etc/parser3.charsets/Makefile.am: charsets now in share (debian/patches/104_automake.patch) + all charsets are copied * buildall-with-xml, buildall-without-xml: curl option removed + extra arguments now supported 2012-06-08 misha * src/classes/table.C: - one params.as_hash usage was rolled back: the 2nd option in ^table.hash[] could be hash or table so .as_hash will throw an exception when table option is specified * src/: classes/curl.C, classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_exception.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: - MethodParams::as_hash is optimized and improved (whitespaces are allowed as empty options) - MethodParams::as_table is added - above methods are used for parsing methods' options ( new feature: #9 ) * src/types/: pa_vclass.C, pa_vclass.h: - method get_hash is added to vclass. now class fields can be accessible as a hash: $h[^hash::create[$asd:CLASS]] * src/types/: pa_vhash.h, pa_vhashfile.h: - vhash and vhashfile now have get_fields method so their fields can be accessed with ^reflection:fields[...] & ^reflection:field[...] 2012-06-06 misha * tests/280.html: - tests for ^reflection:method[obj-or-class;method], ^reflection:field[obj-or-class;field] and ^reflection:fields[obj-or-class] are added 2012-06-05 misha * src/classes/reflection.C: - ^reflection:method[class or object;method name] and ^reflection:field[class or object;field name] are added * src/types/pa_vstateless_class.C: - Method::get_vjunction method is used * src/types/pa_method.h: - Method::as_vjunction method is added 2012-06-05 moko * src/targets/Makefile.am: cgi now build with apache module * src/classes/memcached.C: flish ttl fixed 2012-06-04 moko * src/classes/json.C, src/classes/op.C, tests/279.html, tests/results/279.processed: ^json:parse[] now supports $.taint option (new feature #833) 2012-06-04 misha * src/: include/pa_common.h, main/pa_common.C, types/pa_vcookie.C: - search_stop method was moved from pa_vcookie.C to pa_common.C 2012-06-03 misha * src/main/pa_http.C: - ^file:load[...;http://...] - all received cookies are parced and stored into $.cookies ( new feature: #31 ) 2012-05-30 misha * tests/: 182_dir/a3.p, 182_dir/a4.p, 182.html: - test for adding incomplete class into a scope while @USE is found * src/main/compile.y: - add incomplete class into a scope while @USE and @CLASS instructions are found ( bugfix: #838 ) 2012-05-30 moko * src/types/pa_vclass.C, tests/278.html, tests/results/278.processed: removed "property has no getter method" exception when GET_DEFAULT present (fixes #269) * src/classes/json.C, tests/277.html: ^json:string[], $.default -> $._default 2012-05-29 moko * src/types/pa_vvoid.h: $STRICT-VARS(true) implemented to check uninitialized values usage (new feature: #154) 2012-05-28 moko * tests/277.html, src/classes/json.C, src/classes/reflection.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vbool.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vint.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vstring.h, src/types/pa_vtable.C, tests/results/277.processed, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h: ^json:string[$o; $.default[$method]] implemented for VObject (new feature #803) * src/classes/json.C, src/lib/json/JSON_parser.h, tests/277.html, tests/results/277.processed: json numbers are now treated as double ( new feature: #834 ) * src/: classes/math.C, include/pa_string.h, main/pa_charset.C, main/pa_string.C, types/pa_vdouble.h, types/pa_vint.h: pa_atoui added for out of range checks, zero division in vint/vdouble check added ( fixes #832 ) * tests/: 275.html, results/275.processed: tests for pa_atoui added ( fixes #832 ) 2012-05-28 misha * buildall-with-xml: - --without-lzma option is added to libxml2 configure * tests/256.html: - test for ^json:string[-file-;$.file[stat]] is added - tests for unsupported values for options $.file, $.table and $.date are added * src/: classes/json.C, types/pa_value.h: - ^json:string[...] now accepts "stat" $.file[] option's value in addition to existed "text" and "base64" ( new feature: #835 ) * tests/276.html: - test for ^reflection:delete[$object-or-class;field-name] * src/classes/reflection.C: - ^reflection:delete[$object-or-class;field-name] is added ( new feature: #268 ) 2012-05-27 misha * buildall-with-xml: - libxml2 2.7.8 => 2.8.0 2012-05-24 misha * src/include/pa_common.h: - method lastposafter was removed * src/classes/file.C: - use strrpbrk & rskipchars instead of lastposafter - ^file:dirname[] & Co proper handle windows file paths ( bug fix: #783 ) - ^file:dirname[] & ^file:basename[] now work as *nix commands * src/main/pa_request.C: - use strrpbrk instead of lastposafter * src/: include/pa_string.h, main/pa_string.C: - strrpbrk & rskipchars were added * tests/270.html: - more tests for ^file:find[] * tests/065.html: - more tests for ^file:dirname[] & Co * src/include/pa_version.h: - must be "win32" here. it is auto-generated on *nix 2012-05-24 moko * src/classes/math.C: ^math:convert[] now supports uint32 and throws overflow exception ( new feature: #830 ) * tests/: 275.html, results/275.processed: test for ^math:convert[] uint32 support and overflow added ( new feature: #830 ) 2012-05-23 moko * src/: classes/table.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: bool "return string as-is" removed from as_expr_result. ( new feature: #831 ) * tests/results/244.processed: test changed after bug #782 fix commited * tests/results/229.processed: test results for bug #782 commited * tests/: 254.html, results/254.processed: uid now just compared, not printed. :) 2012-05-20 moko * src/classes/reflection.C: ^reflection:uid[$object] added ( new feature: #341 ) * tests/: 254.html, results/254.processed: test for ^reflection:uid[] added * tests/: 254.html, results/254.processed: test for ^reflection:uid[$obj] added 2012-05-17 misha * src/main/untaint.C: - do not replace ' char by _26 while exploding filespec-tainting ( new feature: #829 ) 2012-05-12 moko * src/types/pa_vvoid.h: is_string now also checked, but get_* - not. 2012-05-08 moko * src/types/pa_vmethod_frame.h: bug #782 fixed * tests/229.html: test for bug #782 * tests/results/259.processed, src/main/pa_request.C, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vstring.h, src/types/pa_vvoid.C, src/types/pa_vvoid.h: feature #154 - first empty param now string; defined locals are empty strings; $STRICT-VARS(true) added 2012-04-27 moko * src/targets/apache/Makefile.am: ../../lib/memcached/libmemcached.a added 2012-04-27 misha * buildall-with-xml, buildall-without-xml: - prce 8.12 => pcre 8.30 ( #827 ) 2012-04-25 moko * src/: classes/json.C, classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: memcached_add implemented. * src/classes/curl.C: stderr -> f_stderr for Windows compatibility 2012-04-23 moko * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: open allows options hash for new memcached(options) function * src/classes/curl.C: check_safe_mode added, stderr now rewritten, not appended 2012-04-21 moko * src/classes/curl.C: '' added. :) * src/classes/classes.vcproj: new curl.h location * src/classes/curl.C: verbose output redirection from stderr to file curl option added 2012-04-20 moko * src/: classes/curl.C, lib/curl/curl.h: lib/curl/curl.h now contains what we need from curl, #ifdef HAVE_CURL removed * configure, configure.in, src/classes/Makefile.am, src/include/pa_config_auto.h.in, src/include/pa_version.h, src/lib/Makefile.am, src/lib/curl/Makefile.am, src/lib/curl/curl.h: curl.h header now in src/lib/curl, not configure option 2012-04-19 moko * src/: classes/double.C, classes/inet.C, classes/int.C, classes/string.C, lib/gc/include/gc_allocator.h, types/pa_vform.C: PVS-Studio detected errors fixes, unused options from sql_result_string removed. (closes issue #468) * src/types/pa_vmemcached.C: empty string fix * src/types/: pa_value.C, pa_value.h, pa_vmemcached.C, pa_vstring.C, pa_vstring.h: serialization helpers moved to pa_vmemcached.C 2012-04-18 moko * src/targets/apache/mod_parser3.c: "Parser3 module requires apache2-mpm-prefork" error displayed in threaded mpm. * src/targets/apache/: mod_parser3.c, mod_parser3_core.C: pa_setup_module_cells delayed to avoid GPF on init with php5-xsl installed (issue #354) 2012-04-16 moko * src/types/pa_vmemcached.C: call to memcached_result_create and memcached_result_free removed 2012-04-14 moko * src/lib/memcached/pa_memcached.h: uint32_t for Windows defined * src/types/pa_vmemcached.C: check_key added and used 2012-04-13 moko * src/: include/pa_string.h, types/pa_value.C, types/pa_value.h, types/pa_vmemcached.C, types/pa_vstring.C, types/pa_vstring.h: Serialization_data now added and used, VString now serialized with languages into memcached. 2012-03-28 moko * src/: types/pa_vmemcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h: result lengths added 2012-03-27 moko * src/types/pa_vmemcached.C: strdup added 2012-03-24 moko * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: memcached: mget, flush, fttl added 2012-03-20 moko * configure, configure.in: Makefiles.in updated for memcached * src/targets/cgi/Makefile.am: cleanup * src/: types/Makefile.am, types/pa_vmemcached.C, types/pa_vmemcached.h, targets/cgi/Makefile.am: memcached initial * src/: classes/Makefile.am, classes/memcached.C, lib/memcached/Makefile.am, lib/memcached/constants.h, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, lib/memcached/types.h, lib/Makefile.am: memcached initial 2012-03-16 moko * src/main/execute.C: ident now works under Linux + ident displays filenames (closes issue #818) * src/types/: Makefile.am, pa_vmethod_frame_global.h, pa_vmethod_frame_local.h: cleanup: pa_vmethod_frame_global.h pa_vmethod_frame_local.h removed * src/: classes/bool.C, classes/classes.C, classes/classes.awk, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_http.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_pool.h, include/pa_random.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/pcre_parser_ctype.c, lib/sdbm/pa_file_io.C, lib/sdbm/pa_strings.C, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_http.C, main/pa_memory.C, main/pa_os.C, main/pa_pool.C, main/pa_random.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, main/helpers/simple_folding.pl, sql/pa_sql_driver.h, targets/apache/mod_parser3.c, targets/apache/mod_parser3_core.C, targets/apache/pa_httpd.h, targets/apache/pa_threads.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vmethod_frame_global.h, types/pa_vmethod_frame_local.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: ident now works under Linux + ident displays filenames (closes issue #818) Copyright updated 2012-03-13 moko * src/main/pa_string.C: compilation fix for feature #741 2012-03-09 misha * tests/193.html: - tests for ^string:base64[encoded] are updated * src/main/pa_common.C: - ^string:base64[encoded;$.strict(true)] now detects invalid base64 chars in the middle of encoded stricg ( new feature: #55 ) * src/include/pa_exception.h: - new exception type for base64 decoding is added 2012-03-06 misha * tests/274.html: - tests for ^date::today[] and ^date.sql-string[datetime|date|time] are added * src/classes/date.C: - constructor ^date::today[] is added ( new feature: #811 ) - ^date.sql-string[] now can accept one param -- strings "datetime", "date" or "time" - comments tidying up * src/types/pa_vdate.h: - get_sql_string now can print datetime, date and time 2012-03-03 misha * tests/193.html: - tests for ^string:base64[encoded;$.strict(true)] are added * tests/results/auto.p: - try-catch operator is added * src/: classes/file.C, classes/string.C, include/pa_common.h, main/pa_common.C: - $.strict(true|false) option is added to base64 decode methods ( new feature: #55 ) * src/main/pa_common.C: - base64 decode memory usage was decreased ( new feature: #819 ) 2012-02-28 moko * src/classes/hash.C: ident test 2012-02-27 misha * src/classes/file.C: - PARSER_VaRSION => PARSER_VeRSION 2012-01-08 misha * tests/273.html: - tests for ^string.replace[from;to] are added * src/: classes/string.C, include/pa_dictionary.h, main/pa_dictionary.C, main/pa_string.C: - ^string.replace[from;to] is added ( new feature: #741 ) - ^string.replace[one subst here] is slightly optimized 2011-12-07 misha * src/classes/table.C: - $t[^table::create{$empty}] now creates named table with one empty column ( bugfix: #63 ) 2011-11-30 misha * src/classes/json.C: - it's possible to set user's method for parsing arrays: ^json:parse[...;$.array[$hook]] ( new feature: #763 ) * tests/272.html: - test for ^json:parse[...;$.array[$hook]] 2011-11-23 misha * src/: classes/curl.C, classes/file.C, classes/image.C, classes/table.C, classes/xdoc.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: - constructor ^file::create[mode;filename;content[;options]] now accepts binary mode and file-content - new constructor's format: ^file::create[string-or-file-content[;$.name[filename] $.mode[text|binary] $.content-type[...] $.charset[...]]] ( new feature: #65 ) * src/: include/pa_request.h, main/pa_request.C: - new method mime_type_of(const String*) is added * src/include/pa_exception.h: - new exception constant FILE_NAME_MUST_BE_SPECIFIED is added * src/classes/table.C: - bug with negative offset transformed into a feature. it means pointing to a row from the end of the table ( new feature: #810 ) 2011-11-19 misha * src/classes/table.C: - íåñêîëüêî signed/unsigned warnings óáðàíû â ìåòîäå _select ( new feature: #810 ) * src/types/pa_vxdoc.C: - checkout if $.encoding and $.charset options were specified together is simplified 2011-11-12 misha * src/main/pa_request.C: - forgotten fix for escaping filename in HTTP content-disposition header (a part of bug #361 ) * src/classes/json.C: - ^json:string[$.class_name[jmethod]] now checks for ancestors' classes as well ( new feature: #456 ) * src/classes/op.C: - exceptions for ^break[] and ^continue[] "without cycle" now have types "parser.break" and "parser.continue" instead of "parser.runtime" ( new feature: #799 ) 2011-11-11 misha * tests/results/: 099.processed, 100.processed, 205.processed, 237.processed: - since bug #361 was fixed the content of filename in HTTP headers is quoted * tests/results/270.processed: - result for test 270 * tests/: 065.html, results/065.processed: - more tests for ^file:basename[] & Co were added * tests/270_dir/: 270.txt, subdir/270.txt: - stuff for 270.html * tests/270.html: - tests for ^file:find[] are added * src/types/pa_vxdoc.C: - now it's possible to specify encoding using option $.charset. option $.engoding is still supported but these options can not be specified together * src/classes/xdoc.C: - charset.isUTF8 is used instead of comparation charset name with string "UTF-8" ( bugfix: #759 ) 2011-10-11 misha * src/: classes/xdoc.C, types/pa_vxdoc.C, types/pa_vxdoc.h: - new option was added: ^xdoc.file[$.name[èìÿ ôàéëà]] (new feature: #622) 2011-09-30 misha * src/types/pa_vrequest.C: - saving empty $request:post-body causes exception "saving stat-ed file" ( bugfix: #395 ) 2011-05-30 misha * src/classes/string.C: - fixed bug which was added with params.as_hash into string:sql 2011-05-29 misha * src/types/pa_value.C: - filename in content-disposition header must be quoted ( bugfix: #361 ) 2011-05-27 misha * src/classes/: image.C, xdoc.C: - $.mode must be set for newly created file * src/classes/: hash.C, mail.C: - little tunning with get_hash usage * src/include/pa_exception.h: - one more string for exception was added 2011-05-25 misha * tests/269.html: - tests for checking input params in some dom methods * src/classes/: xdoc.C, xnode.C: - validation of some input params was added. it isn't possible not wo create xdoc with invalid tagName. ( bugfix: #160 ) * src/include/: pa_exception.h, pa_xml_exception.h: - exception's string "data must be string" was mover from pa_exception.h to pa_xml_exception.h * src/classes/: xnode.C, xnode.h: - methods as_xmlqname, as_xmlncname, as_xmlname and as_xmlnsuri were added * src/main/pa_xml_exception.C: - XmlException accepts more options * src/include/pa_xml_exception.h: - XmlException accepts more options - XML-related exception's strings were added * src/: classes/xdoc.C, types/pa_vxdoc.h: - code cleanup (unused output_options were removed) 2011-05-19 misha * src/classes/: file.C, hash.C, string.C, table.C, void.C: - params.as_hash is used more while parsing methods hash-options 2011-05-18 misha * operators.txt: - info about json-serialization of xdoc was added * tests/256.html: - tests for json-serialization xdoc were added * src/types/pa_vxdoc.C: - ups. I've forgot about "method" :) * src/: types/pa_value.h, types/pa_vxdoc.C, types/pa_vxdoc.h, classes/json.C, classes/xdoc.C: - now json:string can serialize xdoc-objects. options (the same as ^xdoc.string[]) could be specified in $.xdoc[] ( new feature: #265 ) 2011-05-15 misha * tests/268.html: - tests for ^table.count[with options] were added * src/classes/table.C: - method ^table.count[] now can accept options ( new feature: #93 ): ^table.count[column] returns number of columns for named table; ^table.count[cells] returns number of cells in the current row; ^table.count[] & ^table.count[rows] return number of rows in a table. * tests/267.html: - test for checking switch/case in boolean mode was added * src/classes/op.C: - if switch's or case's value is bool, they are compared as bool values, not as double values: new feature: #351 2011-05-06 misha * tests/242.html: - EOL before EOF was added * tests/169.html: - tests for splitting empty string and void were added * src/main/pa_string.C: - fix of fix (^empty_string.split[...] returned table with one empty cell) 2011-04-03 misha * src/include/pa_version.h, configure.in: - version in head was changed to 3.4.2b 2011-03-30 misha * src/types/pa_vregex.C: - \w & Co now contain unicode properties as well ( new feature #294 ) 2011-03-29 misha * buildall-with-xml, buildall-without-xml: - PCRE stack usage is limited to approx. 6 MB. previous limits were too big for real life. bugfix: #216 2011-03-04 moko * etc/parser3.charsets/cp866.cfg: Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP866.TXT * etc/parser3.charsets/cp866.cfg: cp866 initial version from vlalek@ 2011-02-22 misha * src/include/pa_charset.h, operators.txt: - some methods mustn't be under #ifdef XML or parser can't be compiled without xml support 2011-02-21 misha * src/targets/apache/: Makefile.am: - mention ApacheModuleParser3.vcproj was removed * src/types/pa_vjunction.C: - EOL before EOF was added (warning removed) 2011-02-20 misha * tests/: 266.html, 266.p: - tests for checking $.inherited and $.overridden in ^reflection:method_info[...] were added * src/classes/reflection.C: - beautifying result of ^reflection:method_info[] ($.overridden/inherited) 2011-02-18 misha * src/main/: pa_charset.C, pa_http.C, untaint.C: - use pa_isalpha and pa_isalnum instead of isalpha and isalnum - bug with redundand quoting lowercased latin chars while building email body was fixed * src/include/pa_common.h: - pa_isalpha and ps_isalnum methods were added (they check for latin chars only) 2011-02-16 misha * src/main/pa_charset.C: - bugfix: in some cases the calculating string size for transcoding gave too small value (should ever look for availability char in dest charset inspite of the char size) 2011-02-04 moko * tests/223.html: header values now not url-encoded (issue #195) 2011-02-01 misha * buildall-with-xml, buildall-without-xml: - 8.10 => 8.12 2011-01-31 misha * src/main/pa_request.C: - throw exception if param file_name in use_file is empty 2011-01-08 moko * src/classes/curl.C: compilations errors fixed 2010-12-29 moko * tests/: 265.html, results/265.processed: test for issue #200 added * src/main/pa_string.C: empty regex result check added (fixes issue #200) * src/main/pa_http.C: pa_http_safe_header_name corrected a bit * tests/results/223.processed: header values now not url-encoded (issue #195) * src/: classes/curl.C, include/pa_http.h, main/pa_http.C, main/untaint.C: L_HTTP_HEADER now used in http headers values, pa_http_safe_header_name added for headers names (fixes bug #195) 2010-12-18 misha * src/: types/types.vcproj, classes/classes.vcproj: - arp-include => pa-include 2010-11-28 moko * src/lib/sdbm/sdbm.vcproj: apr -> pa (.vcproj) * src/lib/sdbm/: pa_strings.C, sdbm.c, pa-include/pa_strings.h: apr -> pa * configure.in: apr -> pa * src/types/: pa_vhashfile.C, pa_vhashfile.h: apr -> pa * src/: lib/sdbm/pa-include/Makefile.am, lib/sdbm/Makefile.am, classes/Makefile.am, types/Makefile.am: apr -> pa * src/lib/sdbm/: Makefile.am, apr_file_io.C, apr_strings.C, pa_file_io.C, pa_strings.C, sdbm.c, sdbm_hash.c, sdbm_lock.c, sdbm_pair.c, sdbm_pair.h, sdbm_private.h, sdbm_tune.h, pa-include/pa_apr.h, pa-include/pa_errno.h, pa-include/pa_file_info.h, pa-include/pa_file_io.h, pa-include/pa_sdbm.h, pa-include/pa_strings.h: apr -> pa (apache2 module apr name conflict resolved) 2010-11-27 misha * buildall-with-xml, buildall-without-xml: - typo fixed: libz2 -> libbz2 2010-11-26 misha * src/: types/pa_vregex.C, classes/hash.C, classes/table.C: - warnings removed 2010-11-25 moko * operators.txt: $.indent(true) * operators.txt: another bugfix. :) * operators.txt: bugfix. :) * buildall-with-xml: libxml2-2.7.8 + with-apache 2010-11-24 moko * configure: apxs support * configure.in: apxs support -Bstatic gc removed for OS X * src/targets/: Makefile.am, apache/Makefile.am: apxs support * src/main/: pa_globals.C, pa_xml_io.C: the rest converted to THREAD_LOCAL usage * src/: classes/curl.C, include/pa_config_includes.h, main/pa_globals.C: THREAD_LOCAL defined and used 2010-11-23 moko * src/: classes/op.C, main/pa_os.C: microseconds, not milliseconds should be passed to pa_sleep, and only fractional part (bugfix: #188) * src/targets/apache/mod_parser3.c: 1.3 compatibility * src/targets/apache/: mod_parser3.c, mod_parser3_core.C: GC_dont_gc=1, as in cgi version * src/targets/apache/mod_parser3.c: warning war * src/targets/apache/: mod_parser3.c, mod_parser3_core.C, pa_httpd.h: version removed, some trash removed * src/targets/apache/mod_parser3.c: version removed (we don't want to show it), warning war * src/targets/apache/: mod_parser3.c, mod_parser3_core.C, pa_httpd.h: parser_status_allowed removed + merge config functions removed (override is the default) + beauty * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: option to hide $status used in apache module removed 2010-11-18 moko * operators.txt: $.table[compact] added for ^json:string[] 2010-11-16 moko * src/targets/apache/mod_parser3.c: some cleanup done * src/main/untaint.C: bugfix: first, second String::Body argument is hashcode; second, info.fragment_begin is original, not resulting length * src/classes/file.C: new feature: $.stdin now untainted * tests/results/264.processed: new feature: $.stdin[] now untainted * tests/cat.sh: new feature: stdin arg to test $.stdin[value] * src/classes/op.C: ^apply-taint[] method added * tests/: 264.html, results/264.processed: ^apply-taint[] test added; $.stdin untaint test added 2010-11-15 moko * src/targets/apache/mod_parser3.c: outdated MODULE_MAGIC_NUMBER removed * src/targets/apache/: mod_parser3.c, mod_parser3_core.C, pa_httpd.h: 2x2 calculated under apache2. :) 2010-11-13 moko * src/targets/apache/mod_parser3.c: initial changes to build module with apache 2.x includes * src/targets/apache/: Makefile.am, mod_parser3.c, mod_parser3_core.C, pa_httpd.h, pa_threads.C: initial commit for united apache 1.3 / apache 2.x DSO module 2010-11-09 moko * src/types/pa_method.h: check added to dissallow @method[name;*] syntax * tests/: 263.html, results/263.processed: test from method[*args] added * src/types/: pa_method.h, pa_vmethod_frame.h: closes #26: variable number of params can now be passed to a method declared with *arg 2010-11-06 moko * src/classes/table.C: formating fixed. :) * src/classes/table.C: closes #4: ^table.select now supports $.limit(), $.offset, $.reverse() options * tests/: 262.html, results/262.processed: test for ^table:select with options added (feature #4) * src/include/pa_array.h: remove function added * src/types/: pa_vhash.C, pa_vhash.h: avoiding temporal String object in get_element/put_element, using static one. 2010-11-04 moko * src/types/pa_vregex.C: closes #6: exeption now thrown if invalid options is passed * tests/: 256.html, results/256.processed: $.table[compact] feature now tested; k and p in handler now tested. * src/types/: pa_value.h, pa_vtable.C, pa_vtable.h: fixes #153, $.table[compact] feature added * src/classes/json.C: key is now passed to handler in value_json_string; ^json:string result now process tainting inside and returns clean string, related to issue #153 * src/main/untaint.C: bugfix: charset can be null (in ^string:save[] as example), thus check is added 2010-10-31 moko * src/classes/string.C: error message changed (fixes issue #149) 2010-10-29 moko * src/main/pa_http.C: ":port" is now added to "Host:" header if port is not default (fixes issue #155); exception on invalid port added. * src/main/untaint.C: '*' is now not urlencoded to allow header "Accept: */*" to be passed 2010-10-28 moko * src/classes/curl.C: bugfix: detect_charset() was throwing exception on unknown charset even if response_charset was specified 2010-10-27 moko * src/classes/string.C: ^string.append removed for void compatibility 2010-10-26 moko * src/classes/json.C: libjson supports array at top level, we too (GPF fixed) 2010-10-25 moko * tests/: 253.html, results/253.processed: libjson supports array at top level, parser now supports it as well. * tests/261.html, tests/results/261.processed, src/types/pa_vstring.h: empty string is now void compatible (allows $empty.key) 2010-10-22 misha * src/types/pa_vcookie.C: - fix for session cookie (was introduced while adding additional expires checkout) * tests/030.html: - test for session cookie was added 2010-10-21 moko * src/: classes/string.C, classes/void.C, main/execute.C, types/pa_vvoid.C, types/pa_vvoid.h: void now inherited from string (feature #111) * tests/: 261.html, results/261.processed: checks void from string inheritance (feature #111) * src/classes/: bool.C, classes.h, curl.C, date.C, double.C, file.C, hash.C, hashfile.C, image.C, inet.C, int.C, json.C, reflection.C, regex.C, string.C, table.C, void.C: used_directly() now true by default 2010-10-17 moko * src/: include/pa_string.h, main/pa_http.C, main/untaint.C: files upload now uses binary blocks instead of L_FILE_POST tainting. (bugfix: #128) * tests/: 223.html, results/223.processed: binary file upload test added, GPF (issue #128) also checked in this test 2010-10-13 misha * tests/260.html: - test for math:convert * src/classes/math.C: - error in math:convert was fixed * operators.txt: - info about ^math:convert[number](from-base;to-base) was added * src/classes/math.C: - method ^math:convert[number](from-base;to-base) for converting number represention from one base to another was added ( new feature: #23 ) 2010-10-13 moko * src/main/compile.tab.C: [] now is empty string, not void * src/main/compile.y: [] now is empty string, not void * src/types/pa_vvoid.h: void now passed as parameter * tests/: 259.html, results/259.processed: to test difference between void and empty string (see ticket #111) * tests/results/152.processed: $sEmpty[] is now empty string, not void * tests/256.html: $s[$void] is no longer empty string * tests/254.html: empty string is no longer void 2010-10-12 misha * src/types/pa_vcookie.C: - check if $.expires value can be converted to date during cookies set up ( bugfix: #104 ) * tests/041.html: - more tests for ^table.locate were added * src/classes/table.C: - ^table.locate[field;value;options] didn't work ( bugfix: #129 ) - exception comment for incorrect options ^table.locate[field;value;options] was fixed 2010-10-10 moko * src/: classes/reflection.C, main/execute.C: constructor returning another object feature returned * tests/results/258.processed: test result updated as constructor returning another object feature returned * tests/: 258.html, results/258.processed: test for constructor returning another object 2010-10-08 misha * tests/257.html: - whitespaces after @METACOMMANDS and their options shouldn't cause exceptions any longer 2010-10-06 moko * src/classes/: hash.C, table.C: length from sql server is now ignored, as sql string can contain 0x00 inside (bugfix: #119) 2010-10-02 misha * operators.txt: - the X mark was removed from ^cache[file]. it is usable to delete cache file. 2010-10-02 moko * tests/: 253.html, results/253.processed: hook_key added for key checking * src/classes/json.C: null key bug fixed 2010-09-29 misha * tests/: 256.html, 256.txt: - tests for ^json:string[] were added 2010-09-25 moko * src/classes/json.C: small fixed * tests/results/: 253.processed, 255.processed: just updated * tests/: 253.html, 253_json.txt, 255.html, results/253.processed, results/255.processed: charset transcode test added for json:parse 2010-09-24 moko * src/types/pa_value.h: warning war :) * src/: classes/json.C, include/pa_request.h, types/pa_value.h, types/pa_vfile.C, types/pa_vtable.C: $.indent implemented for ^json:string 2010-09-22 moko * src/main/pa_charset.C: parser charset tables declare only white-space before 0x20, thus adding the missing chars * etc/parser3.charsets/: koi8-r.cfg, koi8-u.cfg: updated to conform to http://unicode.org/Public/MAPPINGS/VENDORS/ 2010-09-21 misha * src/main/compile.y: - some semicolons were added (VS2010 don't want to compile grammar if they are absent) * tests/: make_tests.cmd, run_tests.cmd: - path tools is changed * src/classes/classes.vcproj: - pathes to ls and gawk are changed * src/main/main.vcproj: - path to bison is changed 2010-09-21 moko * etc/parser3.charsets/: windows-1250.cfg, windows-1251.cfg, windows-1254.cfg, windows-1257.cfg, x-mac-cyrillic.cfg: updated to conform to http://unicode.org/Public/MAPPINGS/VENDORS/ 2010-09-20 misha * src/types/pa_vtable.C: - add EOLs while json-serializing table * src/classes/json.C: - add EOL while json-serializing hash * src/lib/json/JSON_parser.C: - 'ES' replaced by 'ESC' because some compilers don't like 'ES'. 2010-09-17 misha * operators.txt: - info about json class was added * src/classes/json.C: - ^json:string[object] * src/: include/pa_request.h, main/pa_request.C: - stuff for preventing infinite recursion while executing json:string was added * src/include/pa_string.h: - method append_quoted was added * src/types/: pa_value.C, pa_value.h, pa_vbool.h, pa_vdate.h, pa_vdouble.h, pa_vfile.C, pa_vfile.h, pa_vint.h, pa_vstring.h, pa_vtable.C, pa_vtable.h, pa_vvoid.h: - method get_json_string was added to Value & Co * src/classes/date.C: - methods get_gmt_string and get_sql_string were used * src/types/pa_vdate.h: - methods get_gmt_string and get_sql_string were added 2010-09-10 moko * src/targets/cgi/parser3.C: vsnprintf now not called twice in die_or_abort (backport from 3.4.1) * src/targets/cgi/parser3.C: vsnprintf now not called twice in die_or_abort (bugfix: #106) 2010-09-09 moko * src/classes/json.C: warning war. :) 2010-09-08 misha * src/lib/json/Makefile.am: - additional include directories were added (for pa_memory.h and gc.h) * src/lib/json/json.vcproj: - JSON_parser.c => JSON_parser.C - compile as C++ instead default - additional include directory was added (for gc.h) * src/types/pa_vform.C: - little code reformating * src/classes/file.C: - $.content-type option now can be specified in ^file::create ( new feature: #102 ) 2010-09-08 moko * src/lib/json/: JSON_parser.C, JSON_parser.h: json lib now uses pa_malloc/pa_free 2010-09-07 moko * tests/results/254.processed: VStateless_class:put_element exception was fixed * src/types/: pa_value.h, pa_vstateless_class.h: now VStateless_class:put_element barks self.type, not this.type (bugfix: #105) 2010-09-06 moko * src/classes/reflection.C: bugfix: new String() is required for exception handling * tests/: 254.html, results/254.processed: test modified 2010-09-05 moko * tests/: 254.html, results/254.processed: ^reflection:copy test added * src/: classes/reflection.C, include/pa_request.h: ^reflection:copy implemented (new feature: #100) 2010-09-03 moko * src/lib/json/JSON_parser.C: c++ compatiblity * tests/: 253.html, 253_json.txt, results/253.processed: $.distinct option testing added 2010-09-02 moko * src/classes/json.C: $.distinct[first|last|all] added 2010-09-01 moko * tests/results/253.processed: json test result * tests/: 253.html, 253_json.txt: json test added * src/classes/json.C: json.C update to actual version + hash key creation bugfix 2010-08-31 misha * src/lib/json/JSON_parser.C, src/lib/json/JSON_parser.h, src/lib/json/Makefile.am, src/lib/json/json.vcproj, src/lib/Makefile.am, src/classes/Makefile.am, src/classes/classes.vcproj, src/classes/json.C, parser3.sln: - json library was added 2010-08-30 moko * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vobject.C: cosmetic optimization in request:execute_method usage * src/: include/pa_charset.h, main/pa_charset.C: small optimization, just to decrease number of lines. :) 2010-08-27 misha * src/classes/op.C: - taint[json] was added * tests/: 250.html, 251.html, 252.html: - tests for taint[json] were added * src/main/pa_exec.C: - warning fix was rolled back. * src/: main/pa_charset.C, main/untaint.C, include/pa_charset.h, include/pa_string.h: - taint[json] was added - escaping was slightly modified 2010-08-25 misha * src/classes/file.C: - typo in file:sql exception was fixed * src/main/pa_exec.C: - warning about declared and not used variable forced_allow was removed 2010-08-14 misha * src/classes/hash.C: - two warnings about signed/unsigned mismatch were removed 2010-08-11 moko * tests/: 249.html, results/249.processed: default setter and anti-recursive default getter test added * src/: classes/reflection.C, include/pa_request.h, main/execute.C, types/pa_value.h, types/pa_vclass.C, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: default setter support + anti-recursive default getter support ( new feature: #13 ) * src/include/pa_hash.h: optimization: threshold member removed from hash, reducing sizeof(hash) 2010-08-10 misha * tests/196.html: - junction-method was added to the test * tests/248.html: - ups. typo :) * tests/248.html: - test for checking .match with 4 params * tests/: 247.html, 247_utf8.txt, 247_utf8_bom.txt, 247_windows1251.txt: - test for "transcode file from utf-8 to $request:charset during loading if the BOM code is detected" * src/main/: pa_common.C, pa_http.C: - transcode file from utf-8 to $request:charset during loading if the BOM code is detected ( new feature: #98 ) 2010-08-05 misha * src/classes/image.C: - ^image.replace now can accept only 2 params. in this case the whole image is affected ( new feature: #95 ) 2010-08-04 misha * tests/246.html: - test tor ^hash._at[] was added * src/classes/hash.C: - ^hash._at[first|last|[-]N] ( new feature: #53 ) * src/include/pa_hash.h: - methods for accessing the first and the last values of ordered hash were added (first_value and last_value) * src/classes/file.C: - now ^file::base64 accepts up to 4 params (similar to others file's methods): ^file::base64[mode;user-file-name;encoded;options] ( new feature: #68 ) * src/types/pa_vmethod_frame.h: - helper method as_hash was added 2010-08-01 moko * src/classes/op.C: to correctly process $result[] in code, called from ^process * tests/245.html: $result in ^process[] test added * src/: classes/op.C, classes/reflection.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C: optimization: VMethodFrame(junction, caller) replaced with VMethodFrame(method, caller, self) op_call(VMethodFrame &frame, bool constructing) removed, construct(class,method) added * tests/results/: 192.processed, 244.processed: request::construct added * tests/: 244.html, 245.html, results/244.processed, results/245.processed: object creation exceptions and ^process tests added 2010-07-28 misha * tests/make_tests.cmd: - win32 EOLs * tests/: run_parser.cmd, run_tests.cmd: - cmd files for executing tests on Win32 were added (The system timezone should be GMT+3) 2010-07-26 misha * tests/: 212.html, results/212.processed: - sizes were removed mecause they could be different on different OSs * tests/065.html: - make it "win32 friendly" 2010-07-25 misha * src/main/compile.y: - all EOLs between methods are removed during compilation ( new feature: #47 ) * tests/results/149.processed: - prepare tests to trim trailing methods' EOLs * tests/149.html: - prepare tests to trim trailing methods' EOLs * tests/: results/006.processed, results/014.processed, 006.html, 014.html, 022.html: - prepare tests to trim trailing methods' EOLs * tests/: 059.html, 071.html, 149.html, results/059.processed, results/071.processed, results/022.processed: - prepare tests to trim trailing methods' EOLs * tests/: results/073.processed, results/109.processed, results/142.processed, results/144.processed, results/149.processed, 073.html, 096.html, 109.html, 142.html, 144.html: - prepare tests to trim trailing methods' EOLs * tests/: 096.html, 107.html, 109.html, 142.html, 144.html, 149.html, 152.html, results/096.processed, results/107.processed, results/109.processed, results/142.processed, results/144.processed: - prepare tests to trim trailing methods' EOLs 2010-07-24 moko * tests/results/: 156.processed, 224.processed: fix for #54 changed the hash order in this test * tests/014.html: to check hash order, hash no is longer sorted before print * src/include/pa_hash.h: hash copy constructor now keeps order (bugfix: #54) 2010-07-23 moko * tests/results/224.processed: @auto[] is no longer inherited * src/types/pa_vstateless_class.C, tests/227.html, tests/results/227.processed: @auto[] is no longer inherited (bugfix: #57) 2010-07-22 misha * src/classes/table.C: - don't skip comment lines during table::load if encloser or separator is set as '#' ( new feature: #30 ) * src/targets/cgi/parser3.C: - don't run as cgi if env:PARSER_VERSION was set for preventing infinite loot ( bugfix: #12 ) * src/classes/file.C: - set PARSER_VARSION env before external script executing 2010-07-13 misha * tests/058.html: - test for suppressing @border was added - test for user attribute was added * tests/results/186.processed: unescaping from \uXXXX * tests/186.html: unescaping from \uXXXX * tests/: 239.html, results/239.processed: method call type * src/types/: pa_vjunction.C, pa_vjunction.h: - bugfix: #90 : $junction_method.CLASS_NAME (+CLASS) 2010-07-07 misha * buildall-with-xml, buildall-without-xml: - moving to pcre 8.10 on *nix 2010-07-05 misha * src/: classes/curl.C, classes/file.C, classes/hash.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, main/pa_common.C, main/pa_http.C: - exception comment strings "options must be hash", "options must be hash, not code" and "called with invalid option" were replaced by constatns - exception comment string "invalid option passed" was replaced by "called with invalid option" (now in different methods are the same exception comment string) * src/include/pa_exception.h: - more exception strings were defined * src/: main/compile.y, main/compile_tools.C, main/compile_tools.h, types/pa_vstateless_class.h: - now we can define possible method's call type ( new feature: #5 ) 1. @OPTIONS\nstatic|dynamic (no option == any) -- for all classe's methods 2. @static:method[params] (only static keyword could be used here) -- for specified methods * src/main/pa_common.C: - junction points should not be deleted on win32 during dirs cleanup ( bugfix: #83 ) - optimisation in dirs cleanup 2010-07-03 misha * tests/: 158.html, 160.html, 161.html, 162.html, 163.html, results/158.processed, results/160.processed, results/161.processed, results/162.processed, results/163.processed: - prepare tests to trim trailing methods' EOLs * tests/results/169.processed: - prepare tests to trim trailing methods' EOLs * tests/results/: 168.processed, 169.processed: - prepare tests to trim trailing methods' EOLs * tests/: results/170.processed, results/167.processed, results/168.processed, results/169.processed, 167.html, 168.html, 169.html: - prepare tests to trim trailing methods' EOLs * tests/: results/170.processed, results/171.processed, results/172.processed, results/173.processed, results/174.processed, results/175.processed, 170.html, 171.html, 172.html, 173.html, 174.html, 175.html: - prepare tests to trim trailing methods' EOLs * tests/: results/176.processed, results/180.processed, results/184.processed, results/185.processed, results/191.processed, results/192.processed, results/196.processed, results/197.processed, results/198.processed, 176.html, 180.html, 184.html, 185.html, 191.html, 192.html, 196.html, 197.html, 198.html: - prepare tests to trim trailing methods' EOLs * tests/: 199.html, 208.html, 209.html, 213.html, 214.html, results/199.processed, results/208.processed, results/209.processed, results/213.processed, results/214.processed: - prepare tests to trim trailing methods' EOLs 2010-06-29 misha * tests/: 220.html, 218.html, results/218.processed, results/215.processed, results/217.processed, 215.html, 217.html: - prepare tests to trim trailing methods' EOLs * tests/: results/224.processed, 224.html, 223.html, results/223.processed, results/220.processed: - prepare tests to trim trailing methods' EOLs * tests/results/: 226.processed, 230.processed: - prepare tests to trim trailing methods' EOLs * tests/: 229.html, results/229.processed: - prepare tests to trim trailing methods' EOLs * tests/: 232.html, 235.html, results/232.processed, results/235.processed, 226.html, 227.html, 228.html, 230.html, results/226.processed, results/227.processed, results/228.processed, results/230.processed: - prepare tests to trim trailing methods' EOLs 2010-06-16 moko * tests/: 229.html, results/229.processed: elseif now supported in ^if * src/classes/op.C: new feature: #56 elseif now supported in ^if 2010-06-03 misha * src/main/pa_common.C: - bugfix #74 -- memmove should be used instead of memcopy for overlaped regions 2010-05-25 misha * src/main/pa_common.C: - wanring about unused vars was removed * src/: include/pa_request.h, main/execute.C, main/pa_request.C: - get_method_filename was moved to execute.C 2010-05-23 misha * src/main/pa_request.C: - more accurate detection of method's file 2010-05-22 misha * src/classes/reflection.C: - bugfix: core during detection of .file if filespec isn't detected successfully 2010-05-20 misha * src/main/pa_request.C: - fix in get_method_filename * src/include/pa_request.h: - new feature: #24 -- searching included file in @USE/^use is changed. if its filespec doesn't start from '/' it will be searched in caller file directory * src/classes/reflection.C: - ^reflection:method_info returns file where the method is defined * src/: include/pa_request.h, main/compile.y, main/pa_request.C, classes/op.C: - new feature: #24 -- searching included file in @USE/^use is changed. if its filespec doesn't start from '/' it will be searched in caller file directory * src/: classes/file.C, include/pa_common.h: - method lastposafter is moved to pa_common.h 2010-05-18 misha * src/: main/pa_common.C, include/pa_common.h, classes/string.C, types/pa_vcookie.C: new feature: #71 ^string:js-unescape and cookie parser decode \uXXXX as well as %uXXXX 2010-05-17 misha * src/classes/curl.C: beauty: - unused param is removed in method _curl_version_action - some spaces were removed or replaced by tabs * src/classes/table.C: - bugfix: #72 core with empty value during ^table.hash[...;name_of_the_last_column][$.type[string]] 2010-05-16 misha * src/classes/curl.C: new: #61 more curl options were added (contributed by Sumo) 2010-04-29 pretender * src/main/pa_string.C: fixes #63 Split result from empty string now empty string. * src/types/pa_vtable.C: bugfix: #35 All empty table cells are now string type. 2010-04-28 pretender * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: bugfix: #59 OPTIMIZE_BYTECODE_GET_CLASS macrodefinition removed 2010-04-19 pretender * src/main/execute.C: fixes #60 Stacktrace now contains info for OP_CONSTRUCT_OBJECT and OP_GET_CLASS * src/: include/pa_common.h, main/pa_common.C, main/pa_exec.C: fixes #64 Now file.missing exception generates in unsafe mode to. * src/classes/file.C: fixes #48 Now not throw "not save environment variable" exception in grpunlim version. 2010-04-05 misha * src/classes/string.C: - new feature: 4th param was added to match. if specified its value is returned in case of nothing was found 2010-04-01 misha * src/main/pa_request.C: - bugfix: on *nix URIs like /a/b/// caused multiple execution of /a/b/auto.p 2010-03-19 misha * src/main/execute.C: - core in $table1.$table2 was fixed * src/targets/cgi/parser3.C: - core in sigpipe was fixed 2010-01-27 misha * src/main/pa_common.C: - bugfix: there are no excaption.type if trying to open file by path /existing-file/non-exixting-file 2010-01-26 misha * src/types/: pa_vrequest.C, pa_vrequest.h: - $request:post-body was added (returns file) 2009-12-22 misha * src/classes/curl.C: - method 'option' was renamed to 'options' - now parser doesn't have class curl if it was built without it 2009-12-15 misha * configure.in: - little cheat with curl include dir was added 2009-12-05 misha * src/classes/curl.C: - some fixes 2009-12-04 misha * src/include/pa_config_fixed.h, src/classes/classes.vcproj, src/classes/curl.C, src/classes/file.C, src/classes/Makefile.am, buildall-with-xml, buildall-without-xml, configure.in: - curl class was added * src/include/pa_hash.h: - hash-iterator was added * buildall-with-xml, buildall-without-xml: - option --passive-ftp was added to pcre 2009-11-27 misha * src/classes/image.C: - don't add @border attribute to output of ^image.html[] if it was specified by user with empty value * src/types/pa_vxdoc.C: - bugfix: core if xdoc doesn't have the root element and we are trying to access .documentElement 2009-11-11 misha * src/classes/table.C: - in ^table.flip[] look at number of columns instead of number of items in first row for named tables 2009-11-10 misha * operators.txt: - info about hash-options in ^file::create was added * tests/237.html: - test for ^file::create[...;$.charset[...]] was added 2009-11-09 misha * buildall-with-xml: - moving to libxml 2.7.6 * tests/236.html: - tests for comparations cords with functions were added * src/include/pa_string.h: - optimisation: cacheing of cstr was added * src/main/pa_http.C: - little optimisation * src/: classes/table.C, lib/gc/include/gc_allocator.h: - bugfix: GPF mallocs + stringstream (table.save) * src/classes/file.C: - file::create now accepts 4th param: options with $.charset * src/lib/cord/: cordxtra.c, include/private/cord_pos.h: - fixed bug in cord (comparation cords with functions was buggy) 2009-11-06 misha * src/main/pa_string.C: - bugfix: calculation string.length sometimes was buggy * src/classes/string.C: - bugfix: Temp_value_element wasn't destroyed if exception occured during match/replace * src/: main/pa_charset.C, include/pa_charset.h: - method lengthUTF8Char was added * src/classes/op.C: - clean tainting lang was added for user's usage * src/lib/cord/: cordbscs.c, cordxtra.c: - some rare GPF were fixed: checkouts are required after GC_MALLOC * src/types/pa_vregex.C: - check UTF8 only during 1st iteration * operators.txt: - actually, there is no ^untaint[xml] in file::create 2009-10-15 misha * tests/: 235.html, 235_attach.txt: - tests for preparing email were added * tests/234.html: - more tests for checking ^taint[uri] escaping were added * src/: include/pa_string.h, main/pa_charset.C, main/pa_http.C, main/pa_request.C, main/untaint.C, types/pa_vmail.C: - little hacking: for dealing with transcoding+^taint[uri] transcode_and_untaint was replaced by untaint_and_transcode 2009-10-13 misha * tests/: 121.html, results/121.processed: - test transcoding + url-escaping now * tests/results/auto.p: - more helpers' methods were added * src/main/pa_globals.C: - die instead of abort 2009-10-06 misha * src/main/pa_common.C: - don't allocate memory during capitalization if input string is already capitalized * src/targets/isapi/parser3isapi.C: - pass pre-capitalized headers * src/targets/cgi/parser3.C: - pass pre-capitalized headers - don't use format function because it calls malloc * src/include/pa_common.h: - more capitalized headers were added * src/main/pa_common.C: - in safe mode clear executable bits during file writing 2009-10-05 misha * src/main/pa_charset.C: - use iterators in pa_charset.C itself 2009-10-03 misha * src/: types/pa_vimage.h, classes/image.C: - ^img.font[], ^img.text[] & ^img.length[] can work in utf-8 now * src/: include/pa_charset.h, main/pa_charset.C: - class UTF8_string_iterator was added * src/classes/image.C: - respect utf-8 when calculate alphabet length * src/classes/mail.C: - check from before get message.cstr 2009-10-02 misha * tests/233.html: - test for image.font, image.length, image.text with text in utf-8 were added * src/main/pa_common.C: - use pa_malloc_atomic instead of new * buildall-with-xml, buildall-without-xml: - comment about gc version for freebsd 4 was added 2009-10-01 misha * src/main/pa_exec.C: - bugfix: allocate a bit more (for terminator) - read_pipe were slightly optimized 2009-09-28 misha * src/main/: pa_common.C, pa_uue.C: - some magic numbers were removed * src/types/pa_vmail.C: - forgot about space after ':' * src/types/pa_vmail.C: - escape filenames while preparing mail body - small simplifications * src/: include/pa_uue.h, main/pa_uue.C: - pa_uuencode now has inout params like pa_base64 * src/: types/pa_vmail.C, types/pa_vmail.h, classes/mail.C: - new option $.debug-print(1) was added to mail:send - changes for using uue_encode which uses less memory * src/main/pa_common.C: - pa_base64_encode uses less memory now * src/: include/pa_uue.h, main/pa_uue.C: - pa_uuencode reduces less memory now 2009-09-26 misha * src/types/pa_vmail.C: - default encoding now is base64 * buildall-with-xml: - moving to libxml 2.7.5 and libxslt 1.1.26 2009-09-25 misha * src/types/pa_vmail.C: - capitalization of headers was added to sending mail as well * buildall-with-xml: - catalog package was removed from libxml * src/main/pa_xml_io.C: - fix in removing file:// protocol for win32 absolute path * src/include/pa_common.h: - one more capitalized header was added 2009-09-22 misha * INSTALL: - comment about building just httpd binary while building apache module was added 2009-09-21 misha * buildall-with-xml: - moving to the latest versions of xml libs: libxml 2.7.4 and libxslt 1.1.25 2009-09-19 misha * tests/231.html: - test for encoding cookie in win-1251 2009-09-18 misha * tests/: 224.html, 224.p: - tests for ^reflection:fields[class or object] were added * operators.txt: - info about method ^reflection:fields[class or object] was added * src/classes/reflection.C: - method ^reflection:fields[class or object] was added * src/types/: pa_value.h, pa_vclass.C, pa_vclass.h, pa_vobject.h: - methods get_fields were added * tests/232.html: - tests for @GET[name] * src/classes/table.C: - some changes in handling hash-options for creare, join and locate * src/types/: pa_vobject.C, pa_vobject.h: - @GET[] now could be defined with option: the type of requested value 2009-09-17 misha * tests/212.html: - tests for .pattern and .options were added * src/types/: pa_vregex.C, pa_vregex.h: - $regex.pattern and $regex.options were added 2009-09-11 misha * tests/: 223.html, 223_utf8.txt, 223_win1251.txt: - test was rewrited. it checks not just one case of sending cookies during file::load[http], but also sending headers and fields (including files) 2009-09-10 misha * src/main/untaint.C: - workaround in file-spec lang for old Macs was removed => now parser can open files with Russian 'r' in filename * src/main/untaint.C: - bugfix: client charset whould be analized while escaping cookies but now source charset * src/main/pa_http.C: - bugfix: the values of http headers didn't ^tainted[uri] so it was possible to make request with incorrect http header * src/main/pa_http.C: - capitalization of http headers during file::load[http was slightly changes - bugfix: all headers which parser sends during file::load[http should be transcoded and only then escaped * src/main/untaint.C: - a bit more comments were added * src/classes/: file.C, string.C: - types where changes (minus 2 warnings) * src/include/pa_common.h: - 2 capitalized strings for making http headers during file::load[http were added 2009-09-08 misha * operators.txt: - changes in file.save and string.save were added * tests/: 230.html, 230.txt: - tests for checking options in file.save and string.save were added * src/main/pa_request.C: - http headers names, which are passed to SAPI::add_header_attribute are lowercased now (it'll be capitalized in that method) * src/: types/pa_vfile.C, types/pa_vfile.h, classes/file.C, classes/string.C: - file_write accepts Request_charsets and asked charset and cound transcode content before writing - string.save and file.save have option $.charset now * src/: include/pa_common.h, main/pa_common.C, classes/table.C, classes/xdoc.C: - file_write accepts Request_charsets and asked charset and cound transcode content before writing * src/include/pa_exception.h: - new exception comment string was defined 2009-09-07 misha * src/main/compile.y: - grammar $name\ name stops now for regex sub-pattern\s 2009-09-04 misha * src/main/pa_http.C: - capitalization of http headers during file::load[http was implemented 2009-09-03 misha * src/: main/pa_common.C, main/pa_http.C, main/pa_request.C, include/pa_common.h, include/pa_sapi.h, types/pa_vcookie.C, types/pa_vmail.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: - back to storing response http headers in lowercase - capitalize them during output 2009-08-31 misha * src/classes/table.C: - allow call with any brackets (it could be useful in methods with explict result declaration) * src/classes/table.C: - bugfix: ^table.sort{...} doesn't work correctly if $request:charset==koi8-r 2009-08-30 misha * src/: include/pa_common.h, main/pa_request.C: - http headers were changed: content-type => Content-type and so on * src/classes/file.C, src/include/pa_common.h, src/include/pa_request.h, src/main/pa_http.C, src/main/pa_request.C, src/types/pa_vcookie.C, src/types/pa_vmail.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, tests/results/001.processed, tests/results/002.processed, tests/results/003.processed, tests/results/004.processed, tests/results/005.processed, tests/results/006.processed, tests/results/007.processed, tests/results/008.processed, tests/results/009.processed, tests/results/010.processed, tests/results/011.processed, tests/results/012.processed, tests/results/013.processed, tests/results/014.processed, tests/results/015.processed, tests/results/016.processed, tests/results/017.processed, tests/results/018.processed, tests/results/019.processed, tests/results/020.processed, tests/results/021.processed, tests/results/022.processed, tests/results/023.processed, tests/results/024.processed, tests/results/025.processed, tests/results/026.processed, tests/results/027.processed, tests/results/028.processed, tests/results/029.processed, tests/results/030.processed, tests/results/031.processed, tests/results/032.processed, tests/results/033.processed, tests/results/034.processed, tests/results/035.processed, tests/results/036.processed, tests/results/037.processed, tests/results/038.processed, tests/results/039.processed, tests/results/040.processed, tests/results/041.processed, tests/results/042.processed, tests/results/043.processed, tests/results/044.processed, tests/results/045.processed, tests/results/046.processed, tests/results/047.processed, tests/results/048.processed, tests/results/049.processed, tests/results/050.processed, tests/results/051.processed, tests/results/052.processed, tests/results/053.processed, tests/results/054.processed, tests/results/055.processed, tests/results/056.processed, tests/results/057.processed, tests/results/058.processed, tests/results/059.processed, tests/results/060.processed, tests/results/061.processed, tests/results/062.processed, tests/results/063.processed, tests/results/064.processed, tests/results/065.processed, tests/results/066.processed, tests/results/067.processed, tests/results/068.processed, tests/results/069.processed, tests/results/070.processed, tests/results/071.processed, tests/results/072.processed, tests/results/073.processed, tests/results/074.processed, tests/results/075.processed, tests/results/076.processed, tests/results/077.processed, tests/results/078.processed, tests/results/079.processed, tests/results/080.processed, tests/results/081.processed, tests/results/082.processed, tests/results/083.processed, tests/results/084.processed, tests/results/085.processed, tests/results/086.processed, tests/results/087.processed, tests/results/088.processed, tests/results/089.processed, tests/results/090.processed, tests/results/091.processed, tests/results/092.processed, tests/results/093.processed, tests/results/094.processed, tests/results/095.processed, tests/results/096.processed, tests/results/097.processed, tests/results/098.processed, tests/results/099.processed, tests/results/100.processed, tests/results/101.processed, tests/results/102.processed, tests/results/103.processed, tests/results/104.processed, tests/results/105.processed, tests/results/106.processed, tests/results/107.processed, tests/results/108.processed, tests/results/109.processed, tests/results/110.processed, tests/results/111.processed, tests/results/112.processed, tests/results/113.processed, tests/results/114.processed, tests/results/115.processed, tests/results/116.processed, tests/results/117.processed, tests/results/118.processed, tests/results/119.processed, tests/results/120.processed, tests/results/121.processed, tests/results/122.processed, tests/results/123.processed, tests/results/124.processed, tests/results/125.processed, tests/results/126.processed, tests/results/127.processed, tests/results/128.processed, tests/results/129.processed, tests/results/130.processed, tests/results/131.processed, tests/results/132.processed, tests/results/133.processed, tests/results/134.processed, tests/results/135.processed, tests/results/136.processed, tests/results/138.processed, tests/results/139.processed, tests/results/140.processed, tests/results/141.processed, tests/results/142.processed, tests/results/143.processed, tests/results/144.processed, tests/results/145.processed, tests/results/146.processed, tests/results/147.processed, tests/results/148.processed, tests/results/149.processed, tests/results/150.processed, tests/results/151.processed, tests/results/152.processed, tests/results/153.processed, tests/results/154.processed, tests/results/155.processed, tests/results/156.processed, tests/results/157.processed, tests/results/158.processed, tests/results/159.processed, tests/results/160.processed, tests/results/161.processed, tests/results/162.processed, tests/results/163.processed, tests/results/164.processed, tests/results/165.processed, tests/results/166.processed, tests/results/167.processed, tests/results/168.processed, tests/results/169.processed, tests/results/170.processed, tests/results/171.processed, tests/results/172.processed, tests/results/173.processed, tests/results/174.processed, tests/results/175.processed, tests/results/176.processed, tests/results/177.processed, tests/results/178.processed, tests/results/179.processed, tests/results/180.processed, tests/results/181.processed, tests/results/182.processed, tests/results/183.processed, tests/results/184.processed, tests/results/185.processed, tests/results/186.processed, tests/results/187.processed, tests/results/188.processed, tests/results/189.processed, tests/results/190.processed, tests/results/191.processed, tests/results/192.processed, tests/results/193.processed, tests/results/194.processed, tests/results/195.processed, tests/results/196.processed, tests/results/197.processed, tests/results/198.processed, tests/results/199.processed, tests/results/200.processed, tests/results/201.processed, tests/results/202.processed, tests/results/203.processed, tests/results/204.processed, tests/results/205.processed, tests/results/206.processed, tests/results/207.processed, tests/results/208.processed, tests/results/209.processed, tests/results/210.processed, tests/results/211.processed, tests/results/212.processed, tests/results/213.processed, tests/results/214.processed, tests/results/215.processed, tests/results/216.processed, tests/results/217.processed, tests/results/218.processed, tests/results/219.processed, tests/results/220.processed, tests/results/221.processed, tests/results/222.processed, tests/results/223.processed, tests/results/224.processed, tests/results/225.processed, tests/results/226.processed, tests/results/227.processed, tests/results/228.processed, tests/results/229.processed: - http headers were changed: content-type => Content-type and so on 2009-08-27 misha * src/: main/pa_random.C, include/pa_random.h, targets/cgi/parser3.C: - year was updated :) 2009-08-26 misha * tests/: 224.html, 224.p: - test for creating of parser object using constructor without params - little bugfix in test * src/main/compile_tools.h: - bugfix: should't call autouse while checking existed class while processing partial option * src/classes/reflection.C: - bugfix: core when creating object with reflection and constructor doesn't have params 2009-08-24 misha * tests/229.html: - tests for checking the number of parameters were added * src/types/: pa_value.C, pa_vmethod_frame.h: - bugfix: the actual number of method's parameters wasn't checked correctly (the bug was introduced in 3.4.0) 2009-08-22 misha * src/main/pa_http.C: - ^file::load[http://...;$.body[]] : $.body transcoded, but tainted pieces are escaped only when content-type==url-encoding * tests/228.html: - test for checking ^file::load[http://...;$.body[]] * src/types/: pa_vform.C, pa_vform.h: - bugfix: attempt to detect post charset was too early (charsets is empty at this moment) 2009-08-21 misha * src/: include/pa_string.h, main/pa_http.C, main/pa_request.C, main/untaint.C: - some fixes with transcode+untaint 2009-08-15 misha * src/main/pa_exec.C: - number of argv in file::exec/cgi on unix was increaced to 100 (was 50) * tests/227.html: - test for checking overriding properties in static classes was added * tests/: 226.html, 226.p: - test for @autoload[] was added * src/: include/pa_request.h, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_request.C, classes/reflection.C: - autouse was implemented 2009-08-14 misha * src/classes/reflection.C: - outdated checkout was removed * src/classes/reflection.C: - optimization - method ^dynamical was added. * src/: types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, main/execute.C: - optimization * src/types/pa_vclass.C: - exception if base on sytem class 2009-08-12 misha * src/types/: pa_vclass.C, pa_vclass.h, pa_vstateless_class.C, pa_vstateless_class.h: - little optimisation 2009-08-11 misha * tests/224.html: - method_params => method_info - checking for $.inherited * src/classes/reflection.C, operators.txt: - method method_params was renamed to method_info and now it returns class name, if method was defined in ancestor * tests/225.html: - tests for cheching properties in hierarhical classes were added * src/: types/pa_property.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, main/compile.y, main/execute.C, classes/classes.C: - problems with properties in new classes implementation were fixed 2009-08-10 misha * src/main/execute.C: - now constructor shouldn't be defined in class. it could be defined in parent. 2009-08-09 misha * src/classes/reflection.C: - ^reflection:methods doesn't return base's methods 2009-08-08 misha * src/: classes/classes.h, classes/date.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/mail.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_hash.h, main/execute.C, main/pa_http.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vproperty.C, types/pa_vproperty.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h, types/types.vcproj: - new classes implementation * buildall-with-xml, buildall-without-xml: - gc has a bug if USE_MUNMAP is used. so it is disabled as a workaround. 2009-08-05 misha * src/: main/pa_common.C, include/pa_common.h: - not needed parameter was removed * src/main/pa_http.C: - bugfix: error was during detecting content-type of file which was loaded by http 2009-08-01 misha * src/main/execute.C, src/main/compile.y, src/include/pa_opcode.h, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, INSTALL: - OPTIMIZE_BYTECODE_CONSTRUCT_OBJECT and OPTIMIZE_CONSTRUCT_OBJECT can't be disabled with defines any longer 2009-07-29 misha * src/classes/reflection.C, tests/results/224.processed: - for native methods with any call type now returned empty call_type value * src/: classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, include/pa_hash.h, include/pa_request.h, main/pa_request.C: - break in cycles was optimized * INSTALL: - more defines were described 2009-07-28 misha * operators.txt: - some changes in information about reflection class * tests/: 224.html, 224.p: - tests for reflection class * src/classes/reflection.C: - some bugs were fixed, method classes was added, refactoring 2009-07-26 misha * src/classes/classes.vcproj: - reflection class wass added to project * operators.txt: - information about reflection class was added * src/classes/reflection.C: - class was redesigned 2009-07-24 misha * src/classes/: Makefile.am, reflection.C: - class reflection was added * src/types/pa_vstateless_class.h: - method for reflection method's in classes was added 2009-07-22 misha * src/main/compile_tools.h: - bugfix: $object.$var was over-optimized. it failed if $object1.$object2.field 2009-07-16 misha * src/: lib/cord/cordbscs.c, lib/cord/cordprnt.c, lib/cord/cordxtra.c, lib/cord/include/cord.h, include/pa_string.h, main/pa_string.C: - optimization: CORD_str, CORD_to_const_char_star, CORD_to_char_star and CORD_substr have one more arg: length of cord 2009-07-15 misha * src/main/pa_http.C: - bugfix: $.cookies' values should be force tainted in ^file::load[http://...;$.cookies[]] * src/classes/: op.C, regex.C, string.C: - new string with exception was used * src/include/pa_exception.h: - new string with exception was added * tests/223.html: - test for checking cookie-encoding during ^file::load[http was added * tests/: 221.html, 222.html: - tests for checking type of $table.fields.field were added * src/types/pa_vtable.C: - not used var decl was removed * src/include/pa_string.h: - use cached string length in Body::mid. it improves speed of match with brackets in pattern * src/lib/cord/include/cord.h: - make CORD_substr_checked available outside 2009-07-14 misha * src/types/pa_vtable.C: - $table.fields.a return string even if column is empty (sometime returned void) - $table.fields was added for nameless tables * src/targets/cgi/getopt.c: - one warning resolved * src/main/pa_string.C: - potentian bug fixed * src/classes/op.C: - small optimization in taint/untaint 2009-07-13 misha * tests/156.html: - test for $cookie[...$.httponly(false)...] was added * src/types/pa_value.C: - bugfix: $cookie[...$.httponly(false)...] souldn't add the attribut to output 2009-07-11 misha * src/targets/: cgi/parser3.vcproj, isapi/parser3isapi.vcproj: - stack size was increaced to 2MB (default=1MB) 2009-07-08 misha * src/main/pa_string.C: - link to UTF-8 description was added * src/include/pa_hash.h: - hash keeps element's order in more places (ex: ._keys[]) * tests/220.html: - test for checking order of elements in hash in foreach was added * tests/172.html: - small changes in printing hash * tests/129.html: - small changes in printing hash * src/: include/pa_common.h, include/pa_hash.h, include/pa_request.h, types/pa_value.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: - hash now keeps order of elements * tests/014.html: - small changes in printing hash 2009-07-07 misha * src/classes/op.C: - new taint language "parser-code" was added * tests/219.html: - test for auto untaint parser code in process was added * src/classes/op.C: - tainted pieces in body of process are auto-untainted now: ^ -> ^^, $ -> ^$ etc. * src/: include/pa_string.h, main/untaint.C: - new language L_PARSER_CODE for auto-untaint in process was added * src/: classes/file.C, classes/hash.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_string.h, main/pa_charset.C, main/pa_http.C, main/pa_request.C, main/pa_xml_io.C, main/untaint.C, types/pa_value.h, types/pa_vhash.h, types/pa_vmail.C, types/pa_vobject.h, types/pa_vstring.h: - some code cleanup 2009-07-06 misha * src/classes/: file.C, hash.C, image.C, mail.C, op.C, string.C, table.C, void.C, xdoc.C: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * src/types/: pa_vcookie.C, pa_vhash.h, pa_vhashfile.C, pa_vimage.C, pa_vmail.C, pa_vobject.h, pa_vregex.C, pa_vrequest.C, pa_vstring.h, pa_vvoid.h: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * src/main/: pa_charset.C, pa_common.C, pa_exec.C, pa_http.C, pa_request.C, pa_sql_driver_manager.C, pa_xml_io.C: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * src/include/pa_string.h: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * tests/218.html: - test for checking automatic file-spec-taint was added * src/: types/pa_vhashfile.C, types/pa_vimage.C, types/pa_vmail.C, types/pa_vregex.C, types/pa_vrequest.C, types/pa_vstring.C, classes/file.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C: - optimizations and simplification of string.cstr(...) * src/: include/pa_string.h, main/untaint.C, main/pa_common.C, main/pa_exec.C, main/pa_request.C, main/pa_sql_driver_manager.C: - optimizations and simplification of string.cstr(...) 2009-07-04 misha * tests/217.html: - test for recursion detection was added * src/: types/types.vcproj, main/main.vcproj, classes/classes.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj: - RuntimeTypeInfo was removed from .vcproj * src/types/pa_wwrapper.h: - dynamic_cast was removed * tests/: 195.html, 195_utf8.txt, 195_windows1251.txt: - tests for uploading files and case-insensitive http-method were added * tests/: 216.html, 216_dir/1, 216_dir/2.txt: - test for checking tainted pattern in ^file:list[] was added 2009-07-03 misha * src/: classes/classes.vcproj, main/main.vcproj, types/types.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj: - enable runtime info (needed for dynamic_cast) - little options changes * src/main/pa_http.C: - file::load[http works now with uploading files _and_ changing $.charset 2009-06-29 misha * src/types/pa_vregex.C: - ^untaint[regex][] for all tainted data while creating pattern 2009-06-25 misha * src/classes/image.C, operators.txt: - options' names for ^image.font were changed to $.space, $.width and $spacing - default space width now == gif's width 2009-06-24 misha * tests/215.html: - tests for $file.mode were added * operators.txt: - added info about $file.mode and changes in ^image.font[ * src/: types/pa_vimage.h, classes/image.C: ^image.font - third param now could be omited - third param now could be hash (with all widths options: $.space-width, $.letter-width) - it's possible to specify tracking ($.letter-space) * src/classes/file.C: - file objects now could have mode field (text|binary) * src/types/: pa_vfile.C, pa_vfile.h: - method set_method was added 2009-06-23 misha * src/: include/pa_string.h, main/pa_string.C, classes/string.C: - trim can work with utf-8 chars now 2009-06-20 misha * src/: classes/hash.C, main/pa_string.C: - string length cacheing was implemented * src/classes/table.C: - string length cacheing was implemented * src/include/pa_string.h: - string length cacheing was implemented 2009-06-17 misha * src/main/execute.C: - value param was removed from WContext::WContext * src/types/: pa_vcode_frame.h, pa_vmethod_frame.C, pa_wcontext.h, pa_wwrapper.h: - value param was removed from WContext::WContext - field wcontext was removed from VCodeFrame (using fparent instead) * tests/214.html: - test with hash copying 2009-06-16 misha * tests/: 062.html, results/062.processed: - evaluation hardcoded strings doesn't work in expression anymore * src/main/execute.C: - less calls for get_constructing() - little refactoring * src/: types/pa_wcontext.h, types/pa_wwrapper.h, include/pa_request.h: - less calls for get_constructing() * src/classes/: hash.C, hashfile.C: - fixed bug which was introduced with OPTIMIZE_SINGLE_STRING optimization 2009-06-14 misha * src/: classes/date.C, classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/regex.C, classes/table.C, classes/xdoc.C, classes/xnode.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, main/execute.C: - create object for storing object's fields only for parser objects 2009-06-13 misha * buildall-with-xml, buildall-without-xml: - new option was added for building GC (it slightly reduces memory usage) * src/types/: pa_wcontext.h, pa_wwrapper.h: - optimization of single string write * src/main/execute.C: - bytecode optimization of ^class:constructor - optimization of single string write * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.h: - bytecode optimization of ^class:constructor 2009-06-09 misha * src/targets/cgi/parser3.C: - type size_t was changed to int in main (better compatibility) 2009-06-08 misha * src/main/compile.y: - I've forgot to commit it :( 2009-06-07 misha * src/include/pa_opcode.h: - more optimizations for WITH_SELF, WITH_READ and WITH_ROOT * src/main/: compile.y, compile_tools.C, compile_tools.h, execute.C: - more optimizations for WITH_SELF, WITH_READ and WITH_ROOT - little refactoring 2009-06-06 misha * tests/213.html: - tests for 3rd match string-param were added * src/classes/string.C: - 3rd match param could be string now * src/main/: compile.y, compile_tools.h: - much more bytecode's sequences optimized to WITH_SELF__VALUE__GET_ELEMENT and GET_OBJECT_ELEMENT 2009-06-05 misha * src/main/pa_http.C: - bugfix: content-length was not calculated if $.body was specified 2009-06-04 misha * src/classes/op.C: - optimizing write_assign_lang in connect * src/classes/op.C: - optimizing write_assign_lang in taint/untaint * src/main/execute.C: - little refactoring - optimizing write_assign_lang in taint/untaint * src/include/pa_opcode.h: - little refactoring * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: - optimizations for $self.field, ^self.method, $self.field[...] and $self.field(...) were added 2009-06-03 misha * src/types/pa_venv.C: - pa_strdup was replaced by strdup 2009-06-02 misha * src/: main/compile.y, main/compile_tools.h, main/execute.C, include/pa_opcode.h: - refactoring in last optimizations ($a[...], $a(...), $.a[...], $.a(...)). a bit less optimizations now but code is much easy and it is ready for further improvements. 2009-05-27 misha * src/: types/pa_junction.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmethod_frame.h, main/execute.C: - changed in destructing junctions * src/main/: pa_charset.C, pa_string.C: - more safe creation on String:Body 2009-05-26 misha * src/: main/pa_common.C, main/pa_http.C, include/pa_common.h: - one method detect_charset was deleted - bug was fixed in this method (error while detecting charset in content_type withot last ';') * src/types/: pa_vform.C, pa_vform.h: - detect post charset only once 2009-05-25 misha * src/classes/file.C: - bugfix: file::exec didn't work after optimizing of helper_length 2009-05-24 misha * src/main/compile_tools.h: - $a[$b.c] and $a[$b.$c] optimisations were added - little refactoring * src/main/execute.C: - core while printing in debug log non-printable values was fixed - $a[$b.c] and $a[$b.$c] optimisations were added * src/include/pa_opcode.h: - new opcodes for $a[$b.c] and $a[$b.$c] were added 2009-05-23 misha * src/: lib/cord/cordbscs.c, lib/cord/cordxtra.c, lib/cord/include/cord.h, include/pa_string.h, main/untaint.C: - CORD_cat optimization * src/: include/pa_opcode.h, main/compile_tools.h, main/execute.C: - call constr optimisation under separate define now * src/main/: compile_tools.h, execute.C: - bugfix: $a[] $b[$a] -- in $b should be string, not void * src/main/compile.y: - little fix for rem-cut optimisation * src/: include/pa_opcode.h, main/compile_tools.C, main/compile_tools.h, main/execute.C: - optimisations for $a[^b[...]], $.a[^b[...]], $a(^b[...]) and $.a(^b[...]) * INSTALL: - description of some #defined were added * src/types/: pa_vfile.C, pa_vfile.h: - fill .'text' field only before 1st access (memory usage is reduced if don't access to .text field) * src/include/pa_array.h: - array grows step now not static (it reduces numbers of reallocs) 2009-05-20 misha * src/include/pa_opcode.h: - bytecode optimization for $a(1), $.b(2), $c[d] and $.e[f] was added * src/main/: compile.y, compile_tools.C, compile_tools.h, execute.C: - bytecode optimization for $a(1), $.b(2), $c[d] and $.e[f] was added * src/main/execute.C: - debug printing moved in defines * src/main/: compile.y, compile_tools.C, compile_tools.h: - bugfix and little refactoring for OP_GET_OBJECT_ELEMENT + OP_GET_OBJECT_VAR_ELEMENT optimisation 2009-05-19 misha * src/main/: compile.y, compile_tools.C, compile_tools.h, execute.C: - $a.$b & ^a.$b bytecode optimisation * src/include/pa_opcode.h: - new opcodes were added (for $a.$b & ^a.$b optimisation) * src/main/compile.y: - compiler now generate new opcodes: OP_GET_ELEMENT_FIELD and OP_GET_ELEMENT_FIELD__WRITE for $a.b and ^a.b - compiler now cut off ^rem{ with all content ; any number of params } * src/main/execute.C: - code for handle new opcodes OP_GET_ELEMENT_FIELD and OP_GET_ELEMENT_FIELD__WRITE was added * src/main/: compile_tools.C, compile_tools.h: - new parameter was added for LA2V and LA2S * src/include/pa_opcode.h: - new defines which can be used for disable some bytecode optimisation and new opcodes were added 2009-05-17 misha * src/lib/cord/cordxtra.c: - bugfix. * tests/212.html: - .size[] and .study_size[] were added to tests * operators.txt: - info about regex class was added * tests/212.html: - tests for regex class were added 2009-05-16 misha * buildall-with-xml, buildall-without-xml: - moving from gc6.8 to gc7.1 * tests/022.html: - test for ^file:list[path;] (empty second param) was added * src/classes/file.C: - bugfix: ^file:list[path;] [empty second param) should work 2009-05-15 misha * src/classes/table.C: - automatically disable stringstream usage on freebsd4 * src/lib/cord/cordxtra.c: - var decl should be at the beginning of scope * tests/211.html: - test with different types of access to hash was added * tests/210.html: - test which checks for loosing tainting in hash's keys was added * tests/208.html: - some parser work added. or stime == 0 %-) * src/lib/cord/cordbscs.c: - little hack was added to cord * src/lib/cord/cordxtra.c: - cacheing of cord chars was added * src/include/pa_version.h, configure.in: - moko have made a lot of optimisations for increacing version number more dramatically :) * src/classes/date.C: - little refactoring: use constructor which accepts formated string * src/: include/pa_string.h, main/pa_string.C: - String constructor which can print formatted string was added 2009-05-14 misha * src/include/pa_string.h: - type was fixed * src/: classes/hashfile.C, classes/op.C, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_hash.h, include/pa_request.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_xml_io.h, main/pa_charset.C, main/pa_charsets.C, main/pa_string.C, main/pa_stylesheet_connection.C, types/pa_value.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vstateless_class.C, types/pa_vstateless_class.h: - hash_code caching was implemented (seaches should be faster now) * src/: classes/file.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_charset.C, main/pa_http.C, main/pa_request.C, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_venv.C, types/pa_vform.C, types/pa_vhashfile.C, types/pa_vregex.C, types/pa_vrequest.C: - String constructors don't have that stupid true/false param which means 'tainted'. they accept lang instead. * src/types/pa_vmethod_frame.h: - bugfix: taint/untaint didn't work with OPTIMIZE_RESULT * src/types/: pa_method.h, pa_vstateless_class.C: - less warnings wher OPTIMIZE_RESULT and OPTIMIZE_CALL not defined 2009-05-13 misha * src/: types/pa_method.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_venv.C, types/pa_vhashfile.C, types/pa_vint.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vstateless_class.C, main/execute.C, main/pa_charset.C, main/pa_common.C, main/pa_request.C, main/pa_string.C, include/pa_string.h, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, classes/xdoc.C: - result optimisation - helper_length parameter removed from string constructors 2009-05-11 misha * tests/209.html: - tests for ^hash::create[hash] were added * tests/208.html: - tests for $status:rusage, $status:memory, ^memory:compact[] were added * tests/207.html: -tests for abs, sign, trunc, frac, exp, log, log10 were added * tests/206.html: - test for try with finally was added 2009-05-10 misha * tests/205.html: - test for ^file::create[...] was added * tests/204.html: - test for ^response:clear[] was added * tests/038.html: - tests for trigonometric functions were added * tests/014.html: - tests for ^hash.containts and ^hash.delete were added - more tests for .add, .sub, .union, .intersects and .intersections * tests/065.html: - test for ^file:dirname was added * tests/030.html: - test for $cookie:fields was added * tests/203.html: - test for ^h._keys[column name] was added * tests/201.html: - tests for .trim were added * tests/202.html: - tests for last-day, date:calendar[type](YYYY;MM;DD) were added * tests/200.html: - tests for .sort(), .sort{}, .flip[] and .offset[type](N) were added * tests/185.html: - more tests for .left(N), .right(N), .min(N;M) and .pos[c](N) were added * tests/141.html: - test for math:sha1 was added * tests/063.html: - tests for .mod(N), .inc[] & .dec[] were added 2009-05-09 misha * src/main/compile.y: - rollback 2009-05-05 misha * src/main/pa_exec.C: - little optimisation: somewhere length() was replaced by is_empty() * src/: include/pa_string.h, main/pa_charset.C: - little optimisation: somewhere length() was replaced by is_empty() * src/classes/table.C: - little optimisation: somewhere length() was replaced by is_empty() * src/: classes/file.C, classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, main/pa_exception.C: - little optimisation: somewhere length() was replaced by is_empty() 2009-05-04 misha * src/: types/pa_method.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, main/execute.C, include/pa_request.h, classes/hash.C, classes/op.C, classes/table.C: - more optimisations were added: some operators don't switch write context anylonger 2009-05-01 misha * src/main/compile.y: - slightly more opcode optimisations for WITH_WRITE + VALUE + GET_ELEMENT -> OP_VALUE__GET_ELEMENT * src/main/execute.C: - simplifying process for getters 2009-04-30 misha * tests/: 198.html, 199.html: - new line fixes (should be 0x0A) * tests/results/199.processed: - test for checking $result into ^rem was added * tests/199.html: - test for checking $result into ^rem was added * tests/: 022.html, 096.html: - þsort after :list was asses (on some OS it returns list in different order) * src/: include/pa_array.h, include/pa_request.h, include/pa_stack.h, main/execute.C, types/pa_vmethod_frame.h: - changes in stack impl - get_element() optimisation: 3rd param removed - bugfix: problems with reading empty input param - defines SAVE_CONTEXT and RESTORE_CONTEXT were added and used * tests/results/198.processed: - test for reading empty local var was added * tests/198.html: - test for reading empty local var was added 2009-04-29 misha * src/main/compile.y: - bugfix: couldn't compile because OP_VALUE__GET_ELEMENT should be unde #ifdef * src/: include/pa_array.h, include/pa_opcode.h, include/pa_request.h, main/compile.y, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: - we can work without opcode OP_STORE_PARAM, so it was removed 2009-04-28 misha * src/: include/pa_opcode.h, main/compile.y, main/execute.C: - op-codes optimisation: 1. VALUE+GET_CLASS=>VALUE_GET_CLASS 2. WITH_READ+VALUE+GET_ELEMENT=>VALUE__GET_ELEMENT (not all yet) 3. WITH_READ+VALUE+GET_ELEMENT__WRITE=>VALUE__GET_ELEMENT__WRITE 4. WITH_READ+VALUE+GET_ELEMENT_OR_OPERATOR=>VALUE__GET_ELEMENT_OR_OPERATOR * src/main/compile_tools.h: - new stuff for op-codes optimisation * src/: main/pa_string.C, classes/string.C: - !length() => is_empty() 2009-04-27 misha * src/types/pa_vregex.h: - back explicit vars initialisation 2009-04-24 misha * src/classes/string.C: - ups. typo fixed * src/main/execute.C: - more replacements '*new VBool' to 'VBool::get' - checks for ^break[], ^continue[] and parser.interrupted were optimised * src/classes/string.C: - number of params.count() calls was slightly reduced 2009-04-23 misha * src/: classes/image.C, include/pa_string.h, main/pa_charset.C: - make it x64 friendly * src/: classes/image.C, include/pa_string.h, main/pa_charset.C: - parser is x64 friendly now 2009-04-22 misha * src/types/pa_vhashfile.C: - coder friendly exception about exceeding record size was added * src/classes/file.C: - use vregex object instead of direct calls methods from pcre lib * src/: classes/file.C, include/pa_string.h, main/pa_string.C, classes/string.C: - use vregex object instead of direct calls methods from pcre lib * src/: include/pa_common.h, main/pa_common.C: - method print_pcre_exec_error_text was moved to class vregex * src/classes/: Makefile.am, classes.vcproj, regex.C: - class regex was added * src/types/: Makefile.am, pa_vregex.C, pa_vregex.h, types.vcproj: - class vregex was added 2009-04-21 misha * buildall-with-xml, buildall-without-xml: - pcre 7.8 -> pcre 7.9 * src/: types/pa_junction.h, types/pa_value.C, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_wcontext.C, types/pa_wcontext.h, main/execute.C, classes/op.C: - junction-optimisation (destructors) * src/include/pa_array.h: - free under if now 2009-04-19 misha * src/main/untaint.C: - ^taint[js] now escapes \x0D as well 2009-04-18 misha * src/include/pa_version.h: :q : CV: ---------------------------------------------------------------------- * src/types/: pa_vjunction.h, pa_vstateless_class.C: - little refactoring * src/: include/pa_array.h, include/pa_hash.h, types/pa_vmethod_frame.h: - destructors under #ifdef now * src/include/pa_memory.h: - define for using destructors was added * src/: types/pa_method.h, types/pa_vstateless_class.C, main/execute.C: - some junctions will be cached now * src/include/pa_hash.h: - hash destructor frees pairs now * src/include/pa_array.h: - inline was added to destructor * src/types/pa_method.h: - comment was changed 2009-04-17 misha * src/: include/pa_array.h, include/pa_hash.h, types/pa_vmethod_frame.h: - destructors were added * src/types/: pa_method.h, pa_vmethod_frame.h: - write_to_result renamed to always_use_result * src/main/: compile.y, compile_tools.h: - rollback changes in compiler: full backward compatibility is better * src/types/pa_vmethod_frame.h: - set flag write_to_result if find result in var's hash * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: - optimisation in method_frame * src/include/pa_array.h: - optimisation in array (allocate elements only when needed) * src/types/pa_vresponse.C: - check for $response:headers field before looking at custom fields * src/types/pa_vmethod_frame.h: - if flag write_to_result was set, not needed to check existance var with name 'result' in var's hash * src/main/compile.y: - compiler was changed: now it detects writings to $result and set flag writo_to_result in method * src/classes/string.C: - little optimisation: no needed to write number with lang * src/main/pa_charset.C: - methods readChar and skipChar which is used for read utf8-strings were renamed - is_escaped was renamed to isEscaped (to the same name convention) * src/: types/pa_method.h, main/compile_tools.h: - flag write_to_result added. compiler get this info from code. 2009-04-16 misha * src/types/: pa_wcontext.h, pa_vmethod_frame.h: - create new String only before 1st write * src/include/pa_string.h: - not needed template removed * src/: types/pa_vbool.h, types/pa_vfile.h, types/pa_vimage.C, types/pa_vjunction.C, types/pa_vproperty.C, types/pa_vstateless_class.C, types/pa_vxdoc.C, types/pa_vxnode.C, main/pa_request.C, classes/bool.C, classes/double.C, classes/hash.C, classes/int.C, classes/string.C, classes/table.C, classes/void.C, classes/xnode.C: - bool optimisation (use only 2 bool objects) 2009-04-15 misha * src/lib/cord/cordxtra.c: - more optimisation * src/: include/pa_string.h, main/untaint.C: - String::append optimisation * src/include/pa_hash.h: - get_by_hash_code added (it works faster then get and can sometime be used) * src/main/pa_string.C: - String::length optimisation * src/main/pa_charset.C: - rollback changeing readChar to skipChar. these methods read different strings * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: - fresult_initial_void removed + some optimisation - if $result defined we don't write to context anymore * src/main/pa_charset.C: - readChar => skipChar (in this place we need just skip char) * src/: types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vrequest.C, types/pa_vtable.C, main/execute.C, classes/table.C: - VVoid::get() => new VVoid (one void-instance) * src/types/pa_vvoid.h: - added get() method for retreave one instance 2009-04-11 misha * tests/196.html: - tests for $cookie:CLASS_NAME & Co were added * tests/197.html: - test for parser://test in xml was added * src/classes/string.C: - small optimisation * src/types/: pa_venv.C, pa_venv.h, pa_vconsole.h: - small optimisation 2009-04-10 misha * buildall-with-xml, buildall-without-xml: - moving from pcre-7.7 to pcre-7.8 * src/types/pa_vclass.C: - normalizing todo-comments: '@todo' now * src/types/: pa_vcookie.C, pa_vcookie.h: - $cookie:CLASS_NAME was added * src/types/: pa_vrequest.C, pa_vrequest.h: - $request:CLASS and $request:CLASS_NAME were added * src/types/pa_vconsole.h: - $console:CLASS and $console:CLASS_NAME were added * src/types/: pa_venv.C, pa_venv.h: - $env:CLASS and $env:CLASS_NAME were added * src/types/: pa_vmail.C, pa_vdate.h: - normalizing todo-comments: '@todo' now * src/targets/cgi/parser3.C: - size_t -> int for calming down compirer * src/main/pa_string.C: - little code cleanup * src/main/pa_common.C: - describe one more UTF-8 related error during PCRE compile/execute * src/classes/: image.C, inet.C, string.C, xdoc.C, xnode.C: - normalizing todo-comments: '@todo' now * src/types/: pa_vmath.C, pa_vmath.h: - $math:E was added * src/main/pa_charset.C: - type changed for making compiler happy 2009-03-10 misha * src/targets/cgi/parser3.C: make g++ happy with the type of argc in main() 2009-02-01 misha * src/main/pa_http.C: - bugfix: double CRLF before the end of boundary 2009-01-25 misha * tests/: 194.html, 194_dir/194.p: - test for @GET[] was added * src/classes/file.C: - more changes for parsing different number of params for file::load * tests/193.html: - tests for exception while base64-decode binary to string was added * tests/192.html: - tests for file::load with different number of options * src/classes/math.C: - ups. forgot '+1' * src/: classes/table.C, classes/file.C, include/pa_common.h, include/pa_http.h, main/pa_xml_io.C, main/pa_common.C, main/pa_http.C: - ^file::load[...;http://...;] now can post files (new option $.encode[multipart-form/data] should be specified) - $.method[] option for file::load now is not case-sensitive * src/: include/pa_string.h, main/untaint.C: - for file post the new taint language L_FILE_POST was added * src/: include/pa_random.h, main/Makefile.am, main/pa_random.C, main/main.vcproj, classes/math.C, include/Makefile.am: - some stuff was moved to separate files 2009-01-23 misha * src/classes/math.C: - little optimisation in ^math:sha1[] - spaces to tabs were converted 2009-01-12 misha * src/main/pa_http.C: - value of $.method[] option force uppercased now * src/: targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vform.C, types/pa_vmail.C: - some constants changed their names * src/main/pa_common.C: - changes in formating * src/: classes/file.C, main/pa_http.C: - some constants changed their names * src/include/pa_http.h: - some spaces were converted to tabs * src/include/pa_common.h: - some constants changed their names * src/classes/file.C: - fixed 4-th paramether for file::load - little code rewriting * src/types/pa_vfile.C: - little code rewriting * src/: main/pa_common.C, main/pa_http.C, main/untaint.C, types/pa_value.h: - some formating changes * src/include/pa_common.h: - some formating spaces transformed to tabs * src/classes/string.C: - exception while base64-decode binary to a string 2009-01-11 misha * configure.in: - version changed to 3.3.1b 2008-09-05 misha * src/lib/pcre/Makefile.am: file Makefile.am was added on branch release_3_3_0 on 2008-09-05 10:59:35 +0000 2008-09-04 misha * tests/: 130.html, 131.html: - these exceptions not typeless anymore * src/classes/op.C: - exception with 'invalid taint language' not typeless anylonger * src/classes/image.C: - some exceptions while operations with image not typeless anymore * src/: types/pa_vhashfile.C, main/pa_common.C, classes/file.C, main/pa_exec.C, main/pa_http.C: - some exceptions while operations with files not typeless anymore * src/: classes/date.C, types/pa_value.C, types/pa_vcookie.C, types/pa_vdate.h: - exceptions while checking date range not typeless anymore * src/include/pa_exception.h: - exception type string for invalid date range was added 2008-09-03 misha * src/: classes/file.C, main/pa_string.C: - exception while pce operations not typeless anymore * src/include/pa_exception.h: - exception type for pce operations was added * tests/: 191.html, 191_a.p, 191_b.p: - tests for calling .CLASS and .CLASS_NAME insite classes * src/classes/table.C: - don't save table header whiile ^table.save[append;filename] if file exists 2008-09-02 misha * src/main/compile.y, src/main/compile_tools.h, src/types/pa_vstateless_class.h, src/main/compile.tab.C, tests/182_dir/a1.p, tests/182_dir/a2.p: - append option was renamed to partial and it login changed: we must mark class as partial for allow their modifications in future. 2008-08-29 misha * tests/results/022.processed: - testing taint[regex] in mask for file:list * tests/022.html: - testing taint[regex] in mask for file:list * tests/022_dir/b[b].txt: - file for testing taint[regex] in mask for file:list was added * src/classes/file.C: - bugfix: ^taint[regex][] didn't works in file:list 2008-08-26 misha * src/types/pa_vobject.C: - we must get .CLASS and .CLASS_NAME from last derived object * src/classes/image.C: - many strings "image.format" replaced by IMAGE_FORMAT constant string - handle GPS info while parse exif - understand some more exif tags * src/include/pa_exception.h: - string "image.format" was added 2008-08-21 misha * src/: main/pa_string.C, classes/file.C: - use method for print pcre_exec text error * src/main/pa_common.C: - method for print pcre_exec text error was added * src/include/pa_common.h: - method declaration for print pcre_exec text error was added 2008-08-19 misha * src/main/execute.C: - bugfix: opcodes must be in separate namespace while debug execution as well * tests/: 015.html, results/015.processed: - test for escaping some parser chars was added 2008-08-18 misha * tests/: 190.html, 190.p, results/190.processed: - test for $caller.self.field + default getter in one class was added * tests/: 189.html, results/189.processed: - test for ^date::create[date object] * tests/: 188.html, results/188.processed: - tests for match with UTF-8 strings * src/main/pa_string.C: - option 'U' (ungreedy) was added to ^string.match[] * ChangeLog: - parser 3.3.0 beta13 2008-08-15 misha * src/lib/pcre/: LICENCE, Makefile.am, README, Tech.Notes, get.c, internal.h, pcre.3, pcre.3.html, pcre.3.txt, pcre.c, pcre.h, pcre.vcproj, study.c, maketables.c, pcre_dftables.vcproj, dftables.c: - old PCRE files removed * src/lib/pcre/config.h: - configuration for PCRE library * src/targets/: cgi/parser3.vcproj, isapi/parser3isapi.vcproj: - use PCRE library from win32\pcre instead of parser3\src\lib\pcre * src/: classes/file.C, main/pa_string.C: - moved to new PCRE library and set flag UTF8 if $request:charset is UTF-8 * src/: include/pa_charset.h, main/pa_charset.C, main/pa_globals.C, include/pa_config_fixed.h: - moved to new PCRE library * src/: main/main.vcproj, types/types.vcproj, classes/classes.vcproj, lib/Makefile.am: - use PCRE library from win32\pcre instead of parser3\src\lib\pcre * src/: include/pa_opcode.h, include/pa_operation.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/compile.tab.C: - opcodes were moved to separate namespace 2008-08-14 misha * src/types/pa_vstateless_class.C: - newline at the end missed * src/main/untaint.C: - char '-' also prefixed by '\' while regex tainting 2008-08-11 misha * tests/: 187.html, 187.p, results/187.processed: - tests for $caller.self, $caller.self.field and $caller.self.field[value] were added * src/types/pa_vmethod_frame.h: - still need to check 'self' runtime as well (for $caller.self) 2008-07-25 misha * tests/: 021.html, 032.html, 033.html, 047.html, 055.html, 059.html, 061.html, 064.html, 067.html, 068.html, 085.html, 086.html, 098.html, 109.html, 121.html: - set correct charsets in tests with international characters 2008-07-23 misha * src/main/pa_http.C: - escape $cookies as %uXXXX while file::load[...;http:// * src/: main/pa_string.C, main/pa_globals.C, classes/file.C: - pcre now everywhere in separate namespace * src/types/pa_vmethod_frame.h: - looking for caller before looking for vars * src/main/: compile.y, compile.tab.C: - characters '@' and '#' now can be escaped by '^' 2008-07-22 misha * src/classes/string.C, tests/186.html: - names changes: escape=>js-escape, unescape=>js-unescape 2008-07-21 misha * tests/results/186.processed: - test for string escape/unescape * tests/186.html: - test for string escape/unescape * src/classes/string.C: - string has escape and unescape methods now * src/: include/pa_string.h, main/pa_string.C: - escape method was added * src/: include/pa_charset.h, main/pa_charset.C: - more escape method-layers added (with different params) 2008-07-18 misha * tests/results/185.processed: - test for ^str.pos[substr](offset) was added * tests/185.html: - test for ^str.pos[sub](offset) added * src/classes/string.C, src/classes/void.C, operators.txt: - ^string.pos[substr](offset) -- 2nd param accepted now * src/main/pa_string.C: - .pos works fine with offset for utf-8 strings 2008-07-17 misha * src/: include/pa_string.h, main/pa_string.C, classes/string.C: - helper length added for mid for small optimisation 2008-07-16 misha * tests/: 185.html, results/185.processed: - tests for length/left/right/mid/pos with utf-8 strings * src/classes/string.C: - left/right/mid/length/pos works fine for utf-8 strings * src/main/untaint.C: - comments removed * src/: include/pa_string.h, main/pa_string.C, include/pa_charset.h, main/pa_charset.C: - methods for working with pos/mid for strings in utf-8 were added 2008-07-15 misha * tests/: 184.html, results/184.processed: - test for case body as expression: $var(^switch(1){^case(1)(true)..}) * src/classes/op.C: - case body can be expression now: $var(^switch(1){^case(1)(true)..}) * tests/: results/183.processed, 183.html: - added test for testing new cookie encoding (%uXXXX) * src/main/untaint.C: - cookies outputs as %uXXXX now. while decoding for backward compatibility they decoded from %XX in request:charset too * src/: types/pa_vcookie.C, types/pa_vcookie.h, main/pa_request.C: - cookie class now decode cookies before first access after last request:charset changing (as form class). * src/main/pa_charset.C: - added method escape for escaping cookies as %uXXXX - before transcode calculate required space for dest string. it reduce mem usage for transcode * src/include/pa_charset.h: - added method escape for escaping cookies as %uXXXX * src/include/pa_string.h: - taint lang (internal) L_HTTP_COOKIE was added. will used for escaping cookies as %uXXXX * src/include/pa_common.h: - escape method has new option for skip converting '+' to a space char * src/main/: pa_common.C, pa_http.C: - skip BOM code before transcode - escape method has new option for skip converting '+' to a space char 2008-07-08 misha * src/classes/op.C: - bugfix in switch - case "stops" on 1st match (no UE if more then 1 case matches anylonger) - optimization: doing searching.as_string() || searching.as_double() only once 2008-07-04 misha * src/types/pa_vdate.h: - is_evaluated_expr returning true added so now ^date::create[date object] works * src/classes/string.C: - left and right added as aliases for start and end in ^string.trim[] 2008-07-03 misha * src/classes/file.C: - allow $.limit for file::sql as well * src/classes/file.C: - allow $.offset option for file::sql - force send limit=1 to query for use sql specifics authomatically * src/classes/: hash.C, string.C, table.C: - don't throw exception if $.limit value if empty. autoconvert it as everywere 2008-07-02 misha * configure.in: - time to change version number to 3.3.0 %-) * src/include/pa_version.h: - time to change version number to 3.3.0 %-) 2008-06-26 misha * src/classes/: file.C, hash.C, string.C, table.C, void.C: - $.limit(0) fixes * src/sql/pa_sql_driver.h: - new drivers API and new version (10.0) - $.limit(0) fixes * src/sql/pa_sql_driver.h: - SQL_NO_LIMIT added (preparations to new API) * src/: include/pa_sql_driver_manager.h, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, classes/op.C: - document_root added * src/main/compile.tab.C: - error message was changed 2008-06-25 misha * src/main/compile.y: - error message was changed 2008-06-24 misha * tests/176_dir/: a.p, d.p: - @OPTION => @OPTIONS * tests/: 182.html, 182_dir/a1.p, 182_dir/a2.p, 182_dir/a3.p: - tests for @OPTIONS\nappend * tests/: 176.html, results/176.processed: - @OPTION => @OPTIONS * src/main/: compile.y, compile.tab.C: - stuff for @OPTIONS\nappend * src/main/compile_tools.h: - new methods for @OPTIONS\nappend * src/types/pa_vmethod_frame.h: - ALL_VARS_LOCAL_NAME moved fo compile.y 2008-06-17 misha * src/main/: compile.y, compile.tab.C: - bugfix in 'def' compilation: ^if(default){true. it's incorrect. must be exception} 2008-06-16 misha * tests/: 181.ent, 181.html, results/181.processed: - test for checking external reference loading with 'http://localhost' prefix while creating xdoc * tests/180.html: - use ^inet:ntoa[] and ^inet:aton[] instead of ^math:long2ip[] and ^math:ip2long[] * src/types/: pa_vobject.C, pa_vobject.h: - get_scalar_value method added which use scalar stateless class method when user object used in scalar context - use get_scalar_value when user object requested in scalar context * src/main/pa_common.C: - size must be int but not size_t or we can't compare with 0 sprintf result * src/: types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, main/execute.C, main/pa_request.C: - go back to one VMethodFrame with internal switch between local/global vars * src/types/pa_vclass.C: - register scalar if method @GET[] was specified * src/types/: pa_vstateless_class.C, pa_vstateless_class.h, pa_vstateless_object.h: - stateless class and object now has private scalar field and getter/setter for working with it * src/classes/math.C: - methods math:long2ip & math:ip2long were moved to inet static class * src/classes/: classes.vcproj, inet.C, Makefile.am: - inet static class added (^inet:aton[IP], ^inet:ntoa(number)) * tests/: 180.html, results/180.processed: - tests for ^math:long2ip(long) and ^math:ip2long[IP] * src/classes/math.C: - ^math:ip2long[IP] added 2008-06-11 misha * src/main/pa_xml_io.C: - use file_read_text again because of we need cut BOM code and remove DOS newline chars. but don't transcode it anyway. * src/: include/pa_common.h, include/pa_http.h, main/pa_common.C, main/pa_http.C: - option for disable transcoding while file_read and file_read_text added 2008-06-10 misha * tests/: 179.html, 179.p, results/179.processed: - test for many classes in 1 file * src/main/: compile.C, compile_tools.h: - compile return list of classes now. * src/main/: compile.y, compile.tab.C: - compile return list of classes now. internals. * src/main/pa_request.C: - compile return list of classes now. try call @conf and @auto for each returned class * src/include/pa_request.h: - compile return list of classes now * src/types/pa_vstateless_class.h: - typedef ArrayClass added (for return list of classes when compile buf) 2008-06-07 misha * src/main/pa_request.C: - constructing VRequest object with 3rd param -- form * src/types/: pa_vrequest.C, pa_vrequest.h: - constructor acceps 3rd param: form. needed for get post_charset * src/types/: pa_vform.C, pa_vform.h: - VForm::get_post_charset() added * src/: include/pa_common.h, main/pa_common.C, main/pa_http.C, types/pa_vform.C, types/pa_vform.h: - some polish 2008-06-06 misha * src/types/: pa_vform.C, pa_vform.h: - if POST -- try detec charset and decode chars from it but not from response:charset * src/main/pa_http.C: - detect_charset moved out of here * src/: include/pa_common.h, main/pa_common.C: - more helpers methods moved here - unescape_chars accepn one charset now * src/main/pa_http.C: - new constants used - don't allow $.content-type in ^file::load[;http://;$.method[POST]] - add charset info while ^file::load[;http://;$.method[POST]] - option $.omit-post-charset(true) added to ^file::load[;http://] for disabling charset during post * src/types/pa_vform.C: - new constants used * src/include/pa_common.h: - some constants were added * src/: classes/form.C, types/pa_vform.C: - use StrStartFromNC instead of StrEqNc * src/main/pa_common.C: - new method for caseless search c-substring in c-string - use isxdigit instead of is_hex_digit * src/include/pa_common.h: - new method for caseless search c-substring in c-string 2008-06-05 misha * tests/results/178.processed: - test for testing default getter * tests/178.html: - test for testing default getter * tests/178_dir/: 178a.p, 178b.p, 178c.p, 178d.p, 178e.p: - classes for test for testing default getter * src/main/execute.C: - default getter soul * src/types/: pa_vobject.C, pa_vobject.h: - get default getter if requested objects' field not found * src/types/pa_vclass.C: - register default getter if defined - get default getter if requested field not found * src/types/pa_vstateless_object.h: - method get_default_getter was added * src/types/: pa_vstateless_class.C, pa_vstateless_class.h: - pointer to default getter and methods for get/set it were added * src/types/: pa_junction.h, pa_vjunction.h: - junction has auto_name field (for default getter) 2008-06-04 misha * src/main/pa_xml_io.C: - load external xml in binary mode (no transcoding, no cutting BOM code, no fixing line breaks) and get it to libxml "as is" 2008-06-03 misha * src/main/pa_common.C: - use store_Char instead of transcodeCharFromUTF8 * src/: include/pa_charset.h, main/pa_charset.C: - method store_Char added, transcodeCharFromUTF8 -- removed 2008-06-02 misha * tests/: results/177.processed, 177.html: - test for checking .[acm]date after local ^file::load[] was added * tests/: results/176.processed, 176.html: - test for checking @OPTION\locals + @method[vars][locals] added * tests/results/auto.p: - CLASS_PATH specified for checking use 2008-05-30 misha * src/main/: compile.y, compile.tab.C: - changes in compiler: @OPTION\nlocals + @method[vars][;locals;] were added * src/main/execute.C: - code of OP_CALL and OP_CALL__WRITE was moved to separate method op_code - switch from VMethodFrame to VMethodFrameGlobal + VMethodFrameLocal * src/include/pa_request.h: - code of OP_CALL and OP_CALL__WRITE was moved to separate method op_code * src/main/pa_request.C: - use VMethodFrameGlobal instead of VMethodFrame now * src/types/pa_vstateless_class.h: - stateless class have bool flag all_vars_local as well * src/types/: pa_vmethod_frame.h, pa_vmethod_frame_global.h, pa_vmethod_frame_local.h, Makefile.am: - who children for VMethodFrame were added: one (global) works as VMethodFrame before and second (local) write all vars in self vars scope * src/types/pa_method.h: - method has bool flag all_vars_local now 2008-05-29 misha * tests/: 129.html, results/129.processed: - more tests for ^table.hash[] * src/classes/hash.C: - ^hash::sql has a new option: $.type[hash|string|table] as ^table.hash[] one. * src/classes/op.C: - ^try has 3rd param now: finally code which executed anyway after try or catch section 2008-05-27 misha * src/classes/table.C: - bugfix: ^table.hash[key][$.type[table]] must not fail if $.distinct(1) wasn't specified 2008-05-26 misha * src/classes/op.C: - allow ^throw[my type] 2008-05-22 misha * configure.in, configure: - version number updated to 3.2.4b * src/classes/: op.C, string.C: - trim format string before eval/format * tests/: results/175.processed, 175.html: - more tests for different format strings in .format[] * src/types/pa_vform.C: - while decoding get values decode %uXXXX as well (not only %XX) * src/main/pa_common.C: - unescape_chars can decode %uXXXX if charset specified - checks for format before print number (^d.format[>...<], ^eval($d)[>...<]) - formating with spaces (instead of tabs) removed * src/include/pa_common.h: - unescape_chars can decode %uXXXX if charset specified * src/: include/pa_charset.h, main/pa_charset.C: - method for get char in requested charset from utf code was added 2008-05-19 misha * tests/: 174.html, results/174.processed: - test for ^hashfile.cleanup[] added * src/classes/hashfile.C: - optimization: don't create any key or value variable if it's name weren't specified (^hf.foreach[;v]{...}) 2008-05-16 misha * src/classes/hash.C: - optimization: don't create any key variable if variable name wasn't specified (^h.foreach[;v]{...}) 2008-05-15 misha * src/classes/op.C: - small changes * src/classes/hashfile.C: - code reformating (as hash.foreach) * src/classes/hash.C: - calculate var_context once before foreach 2008-05-14 misha * src/classes/hashfile.C: - incorrect vars context calculation for ^hashfile.foreach[;]{} fixed * src/classes/: hash.C, table.C: - little optimisation * src/classes/file.C: - bugfix: double absolute path while loading file * tests/: 174.html, results/174.processed: - tests for hashfile were added * buildall-with-xml: - moving to libxslt 1.1.24 2008-04-30 misha * src/classes/file.C: - stat file while loading (local only) so .adate, .mdate and .cdate available without additional ::stat 2008-04-28 misha * src/classes/file.C: - $.name and $.content-type available for stated file 2008-04-14 misha * src/targets/cgi/parser3.C: - new year in copyright %-) * src/include/pa_version.h: - new version number in head 2008-04-10 misha * tests/: 080.html, results/080.processed: - cut '0' from exponential part because of on diff OS it differ (20 or 020 for ex) * tests/: 119.html, results/119.processed: - check for encoding while creating xdoc 2008-04-09 misha * buildall-with-xml: - move to libxml 2.6.32 and libxslt 1.1.23 * src/main/pa_common.C: - comment added * src/classes/date.C: - little refactoring 2008-04-07 misha * src/classes/table.C: - use NO_STRINGSTREAM for switch to old style of ^table.save[]: prepare one big string and sabe it at once. it's safe on freebsd 4.x but use much more memory. * buildall-with-xml, buildall-without-xml: - option --disable-stringstream added (under comment. use it on freebsd 4.x) 2008-02-22 misha * src/main/pa_http.C: - exception if $.body[] and $.forms[] specified together in file::load[;http] - get back transcoding $.body[] in file::load[;http] 2008-02-21 misha * src/classes/date.C: - ^date.gmt-string[] was added * src/types/pa_value.C: - method for output date in RFC 822 format moved to pa_common.h * src/include/pa_common.h: - method for output date in RFC 822 format moved here from pa_value.C * src/types/pa_vmail.C: - fixed core in sending mail with attachment in simple mode ($.file[file here]) introduced in 3.2.2 2008-02-20 misha * src/main/pa_http.C: - transcode $.headers before escaping into specified charset while ^file::load[...;http://...] (L_URI instead of L_HTTP_HEADER) - $.cookies param available in ^file::load[;http://...] now (but we don't parse set-cookies from response yet) (cookies not transcoded as common $cookies) 2008-02-19 misha * src/main/pa_request.C: - rollback: we mustn't force taint $response:field values because in this case $response:locateion[http://...] don't works. 2008-02-15 misha * src/classes/op.C: - little refactoring * src/main/pa_http.C: - taint names of $.headers for load[;http * src/main/pa_request.C: - force taint values of $response:field 2008-02-14 misha * src/main/pa_request.C: - $response:field transcoded to $response:charset before escaping now * src/main/pa_http.C: - some outdated comments removed * src/classes/date.C: - lastdat -> last-day * src/classes/date.C: - ^date:lastday(year;month) and ^date.lastday[] were added - little code refactoring - comments changes * tests/: 159.html, results/159.processed: - test for number of days in February * src/types/pa_value.C: - fixes in code formatting * src/classes/: file.C, op.C, table.C: - fixes in code formatting and comments 2008-02-13 misha * src/main/pa_common.C: - bugfix for february at leap year 2008-01-28 misha * tests/: 160.html, results/160.processed: - more test for cache added * src/classes/op.C: - bugfix: cache body executed twice if contains unhandled exception 2008-01-25 misha * src/lib/sdbm/sdbm.c: - use arp_malloc instead of malloc (fixed bug when hashfile became inavailable after memory:compact) * src/lib/sdbm/apr_strings.C: - +arp_malloc 2008-01-22 misha * src/classes/table.C: - little refactiring and exception texts changes in method ^table.hash[] * src/types/pa_vcookie.C: - link to cookie specification changed 2008-01-21 misha * tests/: 171.html, cat.sh, results/171.processed: - more tests for file::exec/cgi * src/classes/file.C: - bugfix: core while processing headers if executed cgi script don't return content 2008-01-18 misha * buildall-with-xml: - move to libxml2 version 2.6.31 * src/include/pa_version.h, configure.in: - version number updated to '3.2.3b' 2007-12-28 misha * src/: classes/hash.C, include/pa_hash.h: - hash.contain => hash.contains 2007-12-27 misha * gnu.vcproj, parser3.sln, src/classes/classes.vcproj, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/sdbm/sdbm.vcproj, src/lib/smtp/smtp.vcproj, src/main/main.vcproj, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj: - back to VS2003 because of Apache 1.3 module can't work if it was built in VS 2005. with cgi all file so VS2003 project files can be easy converted to the new format. 2007-12-04 misha * src/types/pa_vcode_frame.h: - changes in comment 2007-11-29 misha * src/: types/pa_vcode_frame.h, main/execute.C: - code frame don't intercept strings any longer * tests/: 173.html, results/173.processed: - tests for $d[^date::now[]] $j{$d} $r[$j] -- must create date object in $r but not in main code frame * tests/: 172.html, results/172.processed: - more tests for pass objects from code frames 2007-11-27 misha * tests/: 152.html, results/152.processed: - tests for converting strings 'true'/'false' to bool were added * tests/152.html: - added checks for converting strings 'true'/'false' to bool * src/classes/string.C: - ^srting.bool[] now can convert to bool not only strings with numbers but with values 'true'/'false' as well * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: - buffer size for parser3.log increased * src/main/pa_common.C: - remove_crlf optimize whitespaces now * src/include/pa_common.h: - remove_crlf return cstring size now * src/include/pa_types.h: - constant with buffer size for parser3.log added 2007-11-16 misha * tests/cat.sh: - script for tests for file::exec/cgi * tests/171.html: - tests for file::exec/cgi * tests/results/171.processed: - tests results for file::exec/cgi 2007-11-15 misha * src/main/pa_exec.C: - fixed incorrect exec code for unix * src/classes/file.C: - .body must be set before analyzing cgi headers * src/classes/file.C: - bugfix: we must transcode output fix EOLs only if exec/cgi return anything. 2007-11-14 misha * operators.txt: - info about new text|binary option for file::exec/cgi was added * src/: include/pa_exec.h, main/pa_exec.C, classes/file.C: - ^file:exec[[text|binary];script;...] * src/: include/pa_exception.h, classes/file.C, classes/image.C, classes/string.C, classes/table.C: - more text strings moved to the one place 2007-11-09 misha * src/types/pa_vrequest.C: - $request:argv must be taint * ChangeLog: - $request:argv [patch from Sumo] * operators.txt: - $request:argv * src/: include/pa_request_info.h, types/pa_vrequest.C, types/pa_vrequest.h, targets/cgi/parser3.C: - $request:argv 2007-10-25 misha * buildall-with-xml, buildall-without-xml: - options preparations for ./configure rewrited * src/main/: compile.tab.C, compile.y: - bug if parser.compile error occure in unhandled_exception finally fixed 2007-10-23 misha * tests/: 170.html, results/170.processed: - test for @method[][result] * operators.txt: - added info about node.prefix and node.namespaceURI * src/classes/xnode.C: - xmlHasProp used instead of xmlGetProp * src/types/pa_vxnode.C: - DOM2 fields namespaceURI and prefix were added for node and attribute 2007-10-22 misha * src/types/pa_vmail.C: - content-transfer-encoding: 8bit added * src/main/pa_request.C: - added const content-transfer-encoding * src/include/pa_request.h: - added const content-transfer-encoding - ups. constants must be in lowercase (for search) * src/types/pa_vmail.C: - more constants used - content-transfer-encoding: 8bit added * src/main/pa_uue.C: - content-transfer-encoding moved out of here * src/include/pa_request.h: - more constants * src/types/pa_vmail.C: - constant renamed - $.content-id don't ommit anymore if $.content-disposition was specified - little refactoring * src/: include/pa_request.h, main/pa_request.C: - constant renamed 2007-10-17 misha * operators.txt: - info about table::create[nameless]{data}[>options<] was added * src/main/: compile.tab.C, compile.y: - if error occure while compile method don't put this method in methods table anymore. in other case the parser coredumped if @unhandled_exception method can't be compiled because of parser.compile error. * src/main/execute.C: - little code reformating * src/main/pa_request.C: - little code reformating - comment changed 2007-10-16 misha * tests/: 035.html, results/035.processed: - tests table::create[]{}[options] added * src/classes/table.C: - table::create[]{} now accept 3rd param: options (only $.seperator[] yet) 2007-10-10 misha * src/classes/table.C: - some contstants moved to pa_common.h - some code changes 2007-10-02 misha * src/main/pa_uue.C: - memory usage during uuencode reduced more then three time as much. but base64 encoding method still use less memory anyway. 2007-09-17 misha * operators.txt: - added info about $cookie:fields * src/types/pa_vcookie.C: - $cookie:fields available now * src/classes/hash.C: - some stuff for use with .for_each moved to common * src/include/pa_common.h: - some stuff for use with .for_each moved here * src/types/: pa_venv.C, pa_venv.h: - some strings moved to #define 2007-09-14 misha * buildall-with-xml: - new xml libs again =) 2007-08-28 misha * operators.txt: - texts about ^table.columns[[column name]] and ^string.split[...][v][column name] were added * tests/: 168.html, 169.html, results/168.processed, results/169.processed: - tests for ^table.columns[[column name]] and ^string.split[...][v][column name] were added * src/classes/table.C: - new option ^table.columns[[column name]] was added * src/classes/string.C: - new option ^string.split[...;v;[column name]] * src/include/pa_exception.h: - error text message for ^hash._keys[], ^table.columns[] and ^string.split[] 2007-08-27 misha * src/main/untaint.C: - try to fix coredump on unix if print to body ^taint[sql][something] outside of connect * tests/: 167.html, results/167.processed: - test for ^taint[sql] outside of connect * buildall-with-xml, buildall-without-xml: - strip parser3 was added (commented by default) 2007-08-20 misha * operators.txt: - comment about new method ^node.hasAttributes[] was added * src/classes/: file.C, math.C, op.C, string.C, xdoc.C: - more duplicated exception text strings were removed * src/include/pa_exception.h: - more exception text strings moved here * src/classes/table.C: - some duplicate exceptions' text strings removed * src/classes/: file.C, hashfile.C, image.C, op.C, string.C, xdoc.C, xnode.C: - some duplicate exceptions' text strings removed * src/include/pa_exception.h: - some exception text strings movet to pa_exception * tests/: 149.html, results/149.processed: - test for ^xnode.hasAttributes[] was added - some code changes * src/classes/xnode.C: - DOM2 method ^xnode.hasAttributes[] was added 2007-08-17 misha * tests/: results/006.processed, results/059.processed, 006.html, 059.html: - more tests for match * tests/: 129.html, results/129.processed: - tests for ^table.hash[...][$.type[string|hash|table]] added * src/targets/cgi/parser3.C: - little syntax changes * src/: classes/math.C, targets/isapi/parser3isapi.C: - little syntax changes * src/targets/cgi/parser3.C, operators.txt: - annoying 'SIGPIPE' messages in parser3.log switched off by default. If someone really still need it: use $SIGPIPE(1) 2007-08-08 misha * buildall-with-xml, buildall-without-xml: - remove libs source files by default since now 2007-08-07 misha * buildall-without-xml: - some option syntax changes * buildall-with-xml: - compile libxml2 without http support - some option syntax changes * src/main/pa_xml_io.C: - will use parser file loader for xml needs 2007-08-06 misha * buildall-with-xml: - moved to libxml2-2.6.29 and libxslt-1.1.21 * tests/: 160.html, results/160.processed: - cache test was rewrited 2007-07-06 misha * tests/: 153.html, results/153.processed: - added test for ^math:sha1[string] * src/types/pa_vform.C: - bugfix: uploaded file name wasn't transcoded * src/classes/math.C: - ^math:long2ip(long) and ^math:sha1[string] were added 2007-06-28 misha * etc/parser3.charsets/windows-1251.cfg: - removed duplicated and some incorrect chars 2007-06-19 misha * src/include/pa_hash.h: - methods generic_hash_code & hash_code were moved on top because of gcc 4 had a problems during building. 2007-06-18 misha * tests/results/019.processed: - new image commited 2007-06-09 misha * src/classes/: op.C, table.C: - in while and table.select method as_expression used now * src/types/pa_vmethod_frame.h: - method as_expression was added 2007-06-08 misha * tests/: 166.html, results/166.processed: - test for ^match[...][n] * tests/: 165.html, results/165.processed: - tests for loops * src/lib/cord/include/private/cord_pos.h: - back to origin value because of no speed/memory optimisation but some proglems with long cycles occure 2007-06-06 misha * src/classes/: op.C, table.C: - ^while(true){}, ^while(1){}, ^table.select(true) and ^table.select(1) didn't works because of awaiting junction-param only. fixed. 2007-05-24 misha * src/: include/pa_os.h, main/pa_os.C: - 20 attempt to get lock with 0.5 secs interval * src/classes/op.C: - cache was rewrited. I hope it works with locking system now on unix * src/main/pa_os.C: - locks engines were rewrited: now we don't use system locks which wait till other threads release it but try get lock, if fail wait 1 sec and make 10 attempts. * src/include/pa_os.h: - consts for blocking locks + some comments were added * src/lib/sdbm/apr_file_io.C: - wait till lock released while opening files * src/classes/table.C: - changes in includes. if unclude after our classes on unix it can't be build * src/types/pa_vhashfile.C: - not needed code removed 2007-05-23 misha * src/: classes/file.C, classes/op.C, main/pa_common.C, include/pa_common.h: - cosmetic changes 2007-05-18 misha * src/lib/cord/include/private/cord_pos.h: - rebalance tree not so often. it's give some speed increasing * tests/results/160.processed: - returned time corrected * tests/160.html: - time increased because on unix 1 mean nothing :( * operators.txt: - added info about ^hash.contain[key] * src/classes/hash.C: - added ^hash.contain[key] * src/include/pa_hash.h: - added method for checking key exists in hash 2007-05-07 misha * src/include/pa_string.h: - was compilation error during build on freebsd4 2007-05-03 misha * src/classes/table.C: - option $.type[hash|string|table] was added for ^table.hash[] * src/classes/file.C: - comment removed 2007-04-26 misha * src/types/: pa_vhashfile.C, pa_vhashfile.h: - while ::open the real files doesn't opened in place anymore 2007-04-24 misha * src/classes/math.C: - I thought one more time and remove lg(N) :) * src/include/pa_exception.h: "static" removed 2007-04-23 misha * src/classes/math.C: ^math:lg(N) => ^math:log10(N) * src/classes/math.C: added: - ^math:ln(N) (the same as ^math:log(N)) - ^math:lg(N) * tests/: 097.html, results/097.processed: - charsets converstion during ^file::load[text;http://...] added * tests/: 164.html, results/164.processed: - check for set expires as a date * tests/: 164.html, results/164.processed: - test for hashfile * src/classes/hashfile.C: - little comment changes * src/types/pa_vhashfile.C: - don't open hashfile files until 1st access * src/: classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_request.h, main/execute.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_http.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_table.C, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vconsole.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vtable.C, types/pa_vxdoc.h, types/pa_wcontext.C: - "parser.runtime" strings were removed * src/classes/hashfile.C: - with .clear[] called files_delete() now. * src/types/: pa_vhashfile.C, pa_vhashfile.h: - .clear() removed. * src/include/pa_exception.h: - string constant with "parser.runtime" text was added 2007-04-20 misha * operators.txt: - some comments changing * operators.txt: - added info about .^hashfile.release[], ^hashfile.clenaup[] and new ^string.match[][>N-option<] * configure: =cheching for unsetenv * src/classes/hashfile.C: - ^hashfile.cleanup[], ^hashfile.release[] were added * src/: main/pa_string.C, include/pa_string.h, classes/string.C: - ^string.match[][] understand new option now: return number of matches but not table wit results * src/types/: pa_vhashfile.C, pa_vhashfile.h: - hashfile can auto reopen now * src/classes/op.C: - bug. must be false * configure.in: - checking for unsetenv was added * src/types/pa_vform.C: - some comments 2007-04-18 misha * buildall-with-xml: moving to libxml2-2.6.28 * buildall-with-xml, buildall-without-xml: added commented lines with --disable-safe-mode option * operators.txt: - info about $form:files 2007-04-17 misha * src/types/: pa_vform.C, pa_vform.h: - some code was modified - $form:files was added * tests/: 163.html, results/163.processed: removing auto format * src/types/pa_vdate.h: - start adding unsetenv("TZ"); 2007-04-16 misha * tests/: 163.html, results/163.processed: - test for .int[], floor, round, ceiling and .format[] * src/classes/file.C: - little optimization for getting args in exec/cgi 2007-04-13 misha * src/classes/file.C: - arguments for file::exec/cgi can be specified now as s table with one column 2007-03-27 misha * tests/: 162.html, results/162.processed: - test for ^table.select(^condition[$t]) * tests/results/auto.p: - load windows-1251 charset for some tests * tests/run_parser.sh: PARSER_CONFIG -> CGI_PARSER_CONFIG * tests/: results/161.processed, 161.html, 161_utf8.txt, 161_windows1251.txt: - added test for ^file::load[text;/local/file.txt;$.charset[...]] * tests/: results/013.processed, 013.html: - added test for checking $._default value while hash modifications * tests/: 160.html, results/160.processed: - add test for ^cache[key](secs){code}, ^cache[] and ^cache(0) 2007-03-22 misha * src/include/pa_common.h: - "charset" string defined for ^file::load[text;/local.txt] and ^table::load[/table.txt] * src/main/: pa_common.C, pa_http.C: - $.charset option for ^file::load[text;/local.txt] and ^table::load[/table.txt] was added - not needed transcodes were removed from ^file::load[...;http://...] * src/types/pa_vdate.h: - date.week was fixed - date.weekyear was added * src/classes/date.C: - date.week was fixed * operators.txt: - added info about date.weekyear * tests/: 159.html, results/159.processed: - tests for date.week and date.weekyear added 2007-03-15 misha * src/classes/table.C: - enclose column numbers for nameless tables as well 2007-03-14 misha * src/targets/cgi/parser3.C: - bugxif. failed when request cgi * src/classes/table.C: - table.save optimization: now required much less memory 2007-03-13 misha * tests/results/: 158.processed, 158.processes: - tests for table.save/table.load * tests/: 158.html, results/158.processes: - tests for table.save/table.load * buildall-with-xml: libxml2: --without-ftp --without-docbook * buildall-with-xml: - pattern needed now for building * tests/results/097.processed: - added test results for xdoc::load & xdoc::load[http://...] * tests/097.html: - added test for xdoc::load 2007-03-12 misha * tests/: 107.html, results/107.processed: - added test for xpath '//man' 2007-03-01 misha * tests/: 097.html, results/097.processed: - added test for creating xdoc from file * tests/: results/157.processed, 157.html: - added test for file:move 2007-02-28 misha * src/classes/xdoc.C: - another attempt * src/classes/xdoc.C: - roll back last changes for a while * src/classes/xdoc.C, operators.txt: - ^xdoc::create[$file] added. * src/classes/file.C: - under lock we create non-exist dir anyway * tests/results/099.processed: - ever send content-disposition to client with file * tests/157.html: + test for file:copy 2007-02-26 misha * src/classes/file.C: - some similar strings moved to #define instead of to be copy/pasted many times * src/types/pa_vfile.h: - class name string ("file") moved to #define 2007-02-20 misha * bin/auto.p.dist.in: - added lines for sqlite * configure.in: - added some strings for sqlite detection 2007-02-19 misha * operators.txt: - some comments changes * buildall-with-xml, buildall-without-xml: - some modifications 2007-02-17 misha * buildall-with-xml, buildall-without-xml: - moving to gc6.8 * src/main/pa_request.C: - damn, i forgot to commit it while I change console behaviour 2007-02-12 misha * src/targets/cgi/parser3.C: - don't print headers if $console:line[data] was used during cgi execution. * src/types/pa_vconsole.h: - console class have bool flag now which marked as 'true' if class was used. * tests/: 152.html, results/152.processed: - more types was added to test 152 * src/types/: pa_vimage.C, pa_vimage.h: - fixed bug added while adding 'bool' (^if($image){} caused exception) 2007-02-09 misha * tests/: 152.html, results/152.processed: - test alightly updated * tests/: 152.html, results/152.processed: - test rewrited * src/types/: pa_vxdoc.C, pa_vxdoc.h, pa_vxnode.C, pa_vxnode.h: - bugfix. I broke xdoc & xnode in expression 2007-02-08 misha * tests/: 152.html, results/152.processed: - add test for checking 'def' for void, string, bool, int & double 2007-02-07 misha * operators.txt: - ^file:base64[filespec] was added * tests/results/153.processed: - result test for ^file:base64[filespec] was updated * tests/153.html: - test for ^file:base64[filespec] was added * src/types/pa_vconsole.h: - little optimization * src/classes/file.C: - ^file:base64[filespec] * src/main/pa_common.C: - definitions for ^file:base64[filespec] * src/include/pa_common.h: - declarations for ^file:base64[filespec] * src/types/pa_vcookie.C: - little optimization 2007-02-06 misha * src/main/: utf8-to-lower.inc, utf8-to-upper.inc: - some chars were temporary commented * src/types/pa_vbool.h: - bugfix * tests/156.html: - added test for bool cookie * src/types/pa_vcookie.h: - not needed string "cookie" removed * tests/: 155.html, results/155.processed: - added test for check $.encloser[] option for table save/load * tests/: 153.html, 154.html, todo.txt: - two more tests added 2007-02-05 misha * tests/results/152.processed: - newline at the end was missed * tests/results/141.processed: - math:md5 must be lowercased * src/targets/cgi/parser3.C: - 2007 in help ;) 2007-02-03 misha * tests/results/: 150.processed, 151.processed, 152.processed: - test for bool added and some content length fixes * tests/152.html: - test for bool added * buildall-with-xml: - moved to libxml2-2.6.27 and libxslt-1.1.20 * operators.txt: - info bool class was added * src/: classes/Makefile.am, classes/bool.C, classes/classes.vcproj, classes/double.C, classes/int.C, classes/string.C, classes/void.C, classes/xnode.C, include/pa_string.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vproperty.C, types/pa_vproperty.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.h, types/types.vcproj: - bool class was added * src/main/pa_request.C: - fix 2007-01-18 misha * src/: main/pa_string.C, classes/string.C: - return table during ^string.match[][] even if no matched found. 2006-12-20 misha * src/types/: pa_method.h, pa_vfile.h: - some syntax changes [ http://www.parser.ru/forum/?id=55598 ] 2006-12-19 misha * src/types/pa_vxdoc.C: - $xDoc is "xnode" == true now. more details: http://www.parser.ru/forum/?id=52359 * src/main/pa_request.C: - always set content-disposition for $response:body[hash here]. more details: http://www.parser.ru/forum/?id=52130 2006-12-07 misha * operators.txt: - added info about bool params in cookie set * src/types/pa_vcookie.C: - bool param in cookies available now $cookie:name[ $.value[123] $.secure(true) $.httponly(true) ] * src/types/: pa_value.C, pa_value.h, pa_vbool.h: - is_bool method was added 2006-12-02 misha * src/classes/file.C: - file_block_read used instead of native read * src/main/pa_common.C: - added file_block_read with read error detection - file_block_read used instead of native read * src/include/pa_common.h: - added file_block_read declaration 2006-12-01 misha * operators.txt: - info about $var.CLASS_NAME was added * src/types/: pa_vstateless_class.C, pa_vstateless_class.h: - $var.CLASS_NAME added * operators.txt: - added info about ^file:copy[] * src/classes/file.C: - ^file:copy[from;fo] was added 2006-11-20 misha * src/classes/date.C: - bug fix :) 2006-11-17 misha * src/include/pa_common.h: - array in crc32 calculation was changed to static * src/main/pa_common.C: - little optimization in getMonthDays - small changes in crc32 calculation * src/classes/date.C: - not needed code was removed 2006-11-16 misha * src/types/pa_vmail.C: - fix missed brakes * src/types/pa_vmail.C: - mail:send now set content-type: multipart/related instead of multipart/mixed if file have $.content-id[] 2006-11-15 misha * src/types/pa_vdouble.h: abs -> fabs 2006-11-14 misha * operators.txt: - added info about ^file.md5[] and ^file:md5[file-name] * src/classes/file.C: - ^file.md5[] and ^file:md5[file-name] were added * src/main/pa_common.C: - CRC32_MAX_BUFFER_SIZE was renamed to FILE_BUFFER_SIZE * src/classes/math.C: - hex_string was moved to pa_common.h * src/include/pa_common.h: - hex_string was moved from math.C - CRC32_MAX_BUFFER_SIZE was renamed to FILE_BUFFER_SIZE * src/types/pa_vdouble.h: - incorrect frac detection with negative values was fixed 2006-11-13 misha * operators.txt: - added info about ^math:crc32[string], ^file:crc32[file-name] & ^file.crc32[] * src/classes/math.C: - added ^math:crc32[string] * src/classes/file.C: - some comments were changed - added ^file:crc32[file-name] and ^file.crc32[] * src/: include/pa_common.h, main/pa_common.C: - some functions for crc32 calculation added 2006-11-03 misha * src/include/pa_array.h: - not needed variable removed * tests/: 150.html, 151.html, results/150.processed, results/151.processed: - 2 tests were added * src/include/: pa_array.h, pa_table.h: - table.locate & table.join with $.reverse(1) were fixed * src/main/pa_http.C: - bug fix. now tainted data from $.form and query converted to $.charset during ^file::load[http://...] 2006-11-02 misha * src/include/pa_table.h: ups. forget '=' char * src/include/pa_table.h: - one more fix in .locate[...][$.reverse(1)] 2006-11-01 misha * src/classes/math.C: - bug fix, details: http://www.parser.ru/forum/?id=53360 * src/include/pa_table.h: - bug fix during ^table.locate( condition false for all records )[$.reverse(1)] * src/main/pa_http.C: - second param for this mid method is length but not end_index so this method has error and can't detect charsets in next content-types: Content-type: text/html; charset="windows-1251" Content-type: text/html; charset="windows-1251"; Content-type: text/html; charset=windows-1251; only Content-type: text/html; charset=windows-1251 was fine 2006-10-31 misha * src/classes/file.C: - empty args in file::exec removed now 2006-09-11 misha * bin/auto.p.dist.in: - 2 errors were fixed - table::set was replaced to table::create - some changes in text/code formatting 2006-09-03 paf * src/classes/file.C: proper tainting of ^file::exec/cgi[script;env;COMMAND;LINE;PARAMS] 2006-06-09 paf * src/lib/pcre/pcre-2_08.tar.gz: one can easily find those * src/classes/table.C: formatting * src/classes/table.C: incorporated patch from misha: Sent: Thursday, June 08, 2006 12:38 PM Subject: parser3: patch for ignoring string options for ^table.save[] * src/classes/hash.C: incorporated patch from misha Sent: Wednesday, June 07, 2006 9:52 PM Subject: parser3: patch for $hash._default disappear while * operators.txt: ^mail:send[ $.file1[ $.value[file] $.format[!uue|!base64] << new base64 option. default uue ] ] * src/types/pa_vmail.C: misha: Sent: Wednesday, June 07, 2006 8:51 PM Subject: patch for base64 in ^mail:send[] %-) 2006-04-09 paf * src/main/compile.tab.C: ` change compiled * gnu.vcproj, operators.txt, parser3.sln, src/classes/classes.vcproj, src/classes/file.C, src/classes/hash.C, src/classes/hashfile.C, src/classes/image.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_array.h, src/include/pa_config_fixed.h, src/include/pa_dir.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_stack.h, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/sdbm/sdbm.vcproj, src/lib/smtp/smtp.h, src/lib/smtp/smtp.vcproj, src/main/compile.y, src/main/execute.C, src/main/main.vcproj, src/main/pa_cache_managers.C, src/main/pa_charset.C, src/main/pa_exec.C, src/main/pa_http.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_connection.C, src/main/pa_stylesheet_manager.C, src/targets/cgi/getopt.c, src/targets/cgi/parser3.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/pa_threads.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.vcproj, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vcookie.C, src/types/pa_vhashfile.C, src/types/pa_vhashfile.h, src/types/pa_vmail.C, src/types/pa_vresponse.C, src/types/pa_vstatus.C, src/types/types.vcproj, tests/descript.ion, www/htdocs/_bug.html, www/htdocs/_bug.xsl: + ^break[] ^continue[], in ^for, ^while, ^menu, ^hash/hashfile.foreach * gnu.vcproj, parser3.sln, src/classes/classes.vcproj, src/classes/file.C, src/classes/hash.C, src/classes/image.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_array.h, src/include/pa_config_fixed.h, src/include/pa_dir.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_stack.h, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/sdbm/sdbm.vcproj, src/lib/smtp/smtp.h, src/lib/smtp/smtp.vcproj, src/main/compile.y, src/main/execute.C, src/main/main.vcproj, src/main/pa_cache_managers.C, src/main/pa_charset.C, src/main/pa_exec.C, src/main/pa_http.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_connection.C, src/main/pa_stylesheet_manager.C, src/targets/cgi/getopt.c, src/targets/cgi/parser3.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/pa_threads.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.vcproj, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vcookie.C, src/types/pa_vmail.C, src/types/pa_vresponse.C, src/types/pa_vstatus.C, src/types/types.vcproj, tests/descript.ion, www/htdocs/_bug.html, www/htdocs/_bug.xsl: ! switched to VS2005 (projects and object.for_each(, info)) + $response:field[] setting void means removing + grammar $name` name stops now, for mysql `$field` + started ^break[] ^continue[], in ^for. TODO: to other iterators (while, menu, foreach) + all log messages += [uri=, method=, cl=] * buildall-with-xml: merged . ftp paths update * buildall-with-xml: . ftp paths update 2006-03-04 paf * src/main/: pa_string.C: merged from HEAD ! cache file curruption checks++ [thanks to Igor Zinkovsky for detailed report] * src/main/pa_string.C: ! cache file curruption checks++ [thanks to Igor Zinkovsky for detailed report] 2006-03-01 paf * src/main/untaint.C: merged from HEAD ! mail:send << changed \r or \n to ' ' in 2006-02-18 paf * src/main/untaint.C: merged from HEAD ! mail:send << changed \r or \n to ' ' in * src/main/untaint.C: ! mail:send << changed \r or \n to ' ' in 2006-02-03 paf * src/main/pa_common.C: merged from HEAD ! bugfix: decoding from base64 * src/main/pa_common.C: ! bugfix: decoding from base64 2006-01-20 paf * src/types/pa_vhashfile.C: . merged hashfile.foreach memory economy fix * src/classes/: table.C: merged from HEAD ! bugfix ^table.save[$.encloser-s now handled properly * src/classes/table.C: ! bugfix ^table.save[$.encloser-s now handled properly 2006-01-19 paf * buildall-with-xml, buildall-without-xml: merged from HEAD ! libgc:USE_MUNMAP activates merging of free memory blocks which helps a lot in our case: after transform we want CORD(main.result)->cstr[big malloc]->transcode[big malloc] * src/types/pa_vhashfile.C: . merged hashfile.foreach memory economy fix * buildall-with-xml, buildall-without-xml: ! libgc:USE_MUNMAP activates merging of free memory blocks which helps a lot in our case: after transform we want CORD(main.result)->cstr[big malloc]->transcode[big malloc] 2006-01-17 paf * src/types/pa_vhashfile.C: ! hashfile.foreach: counted pairs before reading them. got rid of reallocs = became quicker and less fragmentated 2005-12-29 paf * INSTALL, Makefile.am, buildall-with-xml, buildall-without-xml, configure, configure.in, src/include/pa_version.h, src/lib/ltdl/Makefile.am, src/lib/ltdl/acconfig.h, src/lib/ltdl/acinclude.m4, src/lib/ltdl/config.guess, src/lib/ltdl/config.sub, src/lib/ltdl/configure.in, src/lib/ltdl/install-sh, src/lib/ltdl/ltmain.sh, src/lib/ltdl/missing, www/htdocs/_bug.html: . merged from 3.2.1 * Makefile.am, src/lib/ltdl/Makefile.am: . now site.m4 also packaged when 'make dist', so do configure companion files in src/lib/ltdl * src/lib/ltdl/: Makefile.am, acconfig.h, acinclude.m4, config.guess, config.sub, configure.in, install-sh, ltmain.sh, missing: . now config_auto.h is created with configure [were constant] * INSTALL: . references to documentation and some clarification * buildall-with-xml, buildall-without-xml: . farawell doc indication * Makefile.am: . dist+=buildall* 2005-12-28 paf * configure: . 3.2.1 * INSTALL, buildall-with-xml, buildall-without-xml: + started to simplify build process, see INSTALL 2005-12-26 paf * configure: ver * configure.in, src/include/pa_version.h, src/main/compile.tab.C: version 2005-12-21 paf * src/main/compile.tab.C, src/main/main.vcproj, www/htdocs/_bug.html: . win32: grammar is now compiled with bison 1.875b, it reports unexpected token names 2005-12-19 paf * src/main/compile.tab.C, src/types/pa_vxnode.h, www/htdocs/_bug.html, www/htdocs/_bug.xsl: ! bugfix xnode now holds a link to xmlNode to prevent premature gc(xmlNode) * src/classes/classes.vcproj, src/include/pa_config_fixed.h, src/lib/gd/gd.vcproj, src/lib/smtp/smtp.vcproj, src/main/main.vcproj, src/main/pa_globals.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj, configure, configure.in, src/include/pa_version.h: . killing gdome [what a relief] * tests/: 097.html, 106.html, 108.html, 110.html, 112.html, 113.html, 114.html, 115.html, 116.html, 117.html, Makefile, run_parser.sh, results/001.processed, results/002.processed, results/003.processed, results/004.processed, results/005.processed, results/006.processed, results/008.processed, results/009.processed, results/010.processed, results/011.processed, results/012.processed, results/013.processed, results/014.processed, results/015.processed, results/016.processed, results/017.processed, results/018.processed, results/020.processed, results/021.processed, results/022.processed, results/023.processed, results/024.processed, results/025.processed, results/026.processed, results/027.processed, results/028.processed, results/029.processed, results/030.processed, results/031.processed, results/032.processed, results/033.processed, results/034.processed, results/035.processed, results/036.processed, results/037.processed, results/038.processed, results/039.processed, results/040.processed, results/041.processed, results/042.processed, results/043.processed, results/044.processed, results/045.processed, results/046.processed, results/047.processed, results/048.processed, results/049.processed, results/050.processed, results/051.processed, results/052.processed, results/053.processed, results/054.processed, results/055.processed, results/056.processed, results/057.processed, results/058.processed, results/059.processed, results/060.processed, results/061.processed, results/062.processed, results/063.processed, results/064.processed, results/065.processed, results/066.processed, results/067.processed, results/068.processed, results/069.processed, results/070.processed, results/071.processed, results/072.processed, results/073.processed, results/074.processed, results/075.processed, results/076.processed, results/077.processed, results/078.processed, results/079.processed, results/080.processed, results/081.processed, results/082.processed, results/083.processed, results/084.processed, results/085.processed, results/086.processed, results/087.processed, results/088.processed, results/089.processed, results/090.processed, results/091.processed, results/092.processed, results/093.processed, results/094.processed, results/095.processed, results/096.processed, results/097.processed, results/099.processed, results/100.processed, results/101.processed, results/102.processed, results/104.processed, results/105.processed, results/106.processed, results/107.processed, results/108.processed, results/109.processed, results/110.processed, results/111.processed, results/112.processed, results/113.processed, results/114.processed, results/115.processed, results/117.processed, results/119.processed, results/120.processed, results/121.processed, results/122.processed, results/123.processed, results/124.processed, results/125.processed, results/126.processed, results/127.processed, results/128.processed, results/129.processed, results/130.processed, results/131.processed, results/132.processed, results/133.processed, results/134.processed, results/135.processed, results/136.processed, results/138.processed, results/139.processed, results/140.processed, results/141.processed, results/142.processed, results/143.processed, results/144.processed, results/145.processed, results/146.processed, results/147.processed, results/148.processed, results/149.processed, results/auto.p: . now works if we turn off default auto.p * configure: . makes * src/types/pa_vxnode.C: . less warnings * src/types/pa_vxnode.C, tests/142.html, tests/144.html, tests/145.html, tests/149.html, tests/descript.ion, tests/outputs/d.cmd, tests/results/142.processed, tests/results/143.processed, tests/results/144.processed, tests/results/145.processed, tests/results/146.processed, tests/results/147.processed, tests/results/148.processed, tests/results/149.processed, www/htdocs/_bug.html: . removed .nodeValue from all node types other than 5 (grabbed piece from gdome) * tests/: 137.html, results/137.processed: . not handled this case yet. code does not hang from inserting parent into child, considering thing minor issue -- nodes are removed from source anyway, don't know why shold that be an error after all * src/targets/cgi/parser3.C: . style * src/classes/xnode.C: . "xml.dom" . xnode.select* now works on xdoc too [were barking "not element"] 2005-12-16 paf * tests/146.html, tests/147.html, tests/148.html, www/htdocs/_bug.html: . more tests * src/classes/xnode.C: . also bark on possible errors * src/types/: pa_vxdoc.C, pa_vxnode.C, pa_vxnode.h: + xdoc DOM props * www/htdocs/_bug.html: ! fixed overoptimized ^call(false) case. (confused it with ^call[] case) * src/: types/pa_value.h, types/pa_vvoid.h, main/compile.tab.C, main/compile.y: merged from HEAD ! fixed overoptimized ^call(false) case. (confused it with ^call[] case) * src/main/: compile.tab.C, compile.y: ! fixed overoptimized ^call(false) case. (confused it with ^call[] case) * tests/: 142.html, 143.html, 144.html, 145.html: . dom [part] * tests/: 006.html, 034.html, 057.html, Makefile, make_tests.cmd, results/001.processed, results/002.processed, results/003.processed, results/004.processed, results/005.processed, results/006.processed, results/008.processed, results/009.processed, results/010.processed, results/011.processed, results/012.processed, results/013.processed, results/014.processed, results/015.processed, results/016.processed, results/017.processed, results/018.processed, results/019.processed, results/020.processed, results/021.processed, results/022.processed, results/023.processed, results/024.processed, results/025.processed, results/026.processed, results/027.processed, results/028.processed, results/029.processed, results/030.processed, results/031.processed, results/032.processed, results/033.processed, results/034.processed, results/035.processed, results/036.processed, results/037.processed, results/038.processed, results/039.processed, results/040.processed, results/041.processed, results/042.processed, results/043.processed, results/044.processed, results/045.processed, results/046.processed, results/047.processed, results/048.processed, results/049.processed, results/050.processed, results/051.processed, results/052.processed, results/053.processed, results/054.processed, results/055.processed, results/056.processed, results/057.processed, results/058.processed, results/059.processed, results/060.processed, results/061.processed, results/062.processed, results/063.processed, results/064.processed, results/065.processed, results/066.processed, results/067.processed, results/068.processed, results/069.processed, results/070.processed, results/071.processed, results/072.processed, results/073.processed, results/074.processed, results/075.processed, results/076.processed, results/077.processed, results/078.processed, results/079.processed, results/080.processed, results/081.processed, results/082.processed, results/083.processed, results/084.processed, results/085.processed, results/086.processed, results/087.processed, results/088.processed, results/089.processed, results/090.processed, results/091.processed, results/092.processed, results/093.processed, results/094.processed, results/095.processed, results/096.processed, results/097.processed, results/099.processed, results/101.processed, results/102.processed, results/104.processed, results/105.processed, results/106.processed, results/107.processed, results/108.processed, results/109.processed, results/110.processed, results/111.processed, results/112.processed, results/113.processed, results/114.processed, results/115.processed, results/116.processed, results/117.processed, results/118.processed, results/119.processed, results/120.processed, results/121.processed, results/122.processed, results/123.processed, results/124.processed, results/125.processed, results/126.processed, results/127.processed, results/128.processed, results/129.processed, results/130.processed, results/131.processed, results/132.processed, results/133.processed, results/134.processed, results/135.processed, results/136.processed, results/137.processed, results/138.processed, results/139.processed, results/140.processed, results/141.processed: . refreshed old tests, made them work without auto.p (in utf8) . things noted: . gif got encoded differently . exif 0000:00:00 decoded now into 0000:00:00 (were some strange year) * INSTALL: . revived linux libgc fix * INSTALL, configure.in, src/lib/Makefile.am: . sweetest part [no glib/gdome in INSTALL and patches] * src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/include/pa_charset.h, src/include/pa_config_includes.h, src/include/pa_globals.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_xml_exception.h, src/lib/cord/Makefile.am, src/lib/cord/cord.vcproj, src/lib/cord/cordbscs.c, src/lib/cord/cordprnt.c, src/lib/cord/cordxtra.c, src/main/compile.tab.C, src/main/pa_charset.C, src/main/pa_globals.C, src/main/pa_memory.C, src/main/pa_request.C, src/main/pa_stylesheet_connection.C, src/main/pa_xml_exception.C, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, www/htdocs/.htaccess, www/htdocs/_bug.html: . started killing gdome 2005-12-13 paf * src/main/: pa_request.C: merged from HEAD ! when code in @unhandled_exception thrown another exception, print correct origin (earlier code in catch of exception inside of @unhandled_exception grabbed parent_frame(original_exception) origin and printed it, instead of true origin) * src/main/pa_request.C: ! when code in @unhandled_exception thrown another exception, print correct origin (earlier code in catch of exception inside of @unhandled_exception grabbed parent_frame(original_exception) origin and printed it, instead of true origin) 2005-12-09 paf * INSTALL: . updated INSTALL doc to work around linux stack base detection problem, due to change in gc6.4 code * src/main/: pa_string.C: merged from 3.1.5 ! regex tainting were ignored in ^string.matched :( * src/main/pa_string.C: ! regex tainting were ignored in ^string.matched :( * ChangeLog, INSTALL, configure, configure.in, src/classes/date.C, src/include/pa_config_fixed.h, src/include/pa_version.h, src/main/compile.y, src/main/compile_tools.h, src/main/pa_charset.C, src/main/pa_common.C, src/main/pa_globals.C, src/main/pa_string.C, src/targets/cgi/getopt.c, src/targets/isapi/parser3isapi.C, src/types/pa_vmail.C, www/htdocs/.htaccess, www/htdocs/_bug.txt, www/htdocs/auto.p: . merged latest fixes from 3.2.0 2005-12-08 paf * src/types/pa_vmail.C: merged from 3.2.0 ! bcc line longer then 500 chars now handled OK [were wrapped on 500th char according to rfc, but sendmail failed to unwrap it properly] * src/types/pa_vmail.C: ! bcc line longer then 500 chars now handled OK [were wrapped on 500th char according to rfc, but sendmail failed to unwrap it properly] * src/targets/isapi/parser3isapi.C: . less warnings * src/targets/isapi/parser3isapi.C: . undone some strange change since 3.1.5 * src/targets/isapi/parser3isapi.C: . merged from 3.1.5 release link fixes * src/classes/date.C, src/include/pa_config_fixed.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.h, src/main/pa_charset.C, src/main/pa_common.C, src/main/pa_globals.C, src/main/pa_string.C, src/targets/cgi/getopt.c, www/htdocs/_bug.html, www/htdocs/_bug.txt, www/htdocs/auto.p: . less warnings * src/include/pa_config_fixed.h: . removed outdated string origins [in current storage scheme there's no place for them. someday we can add third CORD to store origins and special version of parser which stores origins there [separate binary]] 2005-12-07 paf * src/targets/isapi/parser3isapi.C: . now links in release mode * src/include/pa_version.h: makefiles * src/include/pa_version.h: . not beta * configure, configure.in, src/include/pa_version.h: not beta 2005-12-06 paf * src/types/: pa_wcontext.C, pa_wcontext.h: ! after long discussion [some details here http://i2/tasks/edit/?id=4869912143891354460] decided to undo the change ^call[$void] passes void. now it will pass empty string again. * src/main/: compile.tab.C, compile.y: . version readded * src/classes/op.C: . in this version there is no ^switch[$nothing] = ^switch[void] problem 2005-12-01 paf * src/classes/op.C: mreged from HEAD . bugfix ^switch[$void_value] caused ^case[string] to be coerced to double since searching value were not string (it was vvoid) * src/classes/op.C: . bugfix ^switch[$void_value] caused ^case[string] to be coerced to double since searching value were not string (it was vvoid) * INSTALL: . compiled with libxml2 = 2.6.22 libxslt = 1.1.15 glib = 1.2.10 gdome2 = 0.8.1 2005-11-30 paf * src/types/pa_vdate.h: merged from HEAD: ! bugfix: to drop TZ on win32 must putenv("TZ="), on unix works only putenv("TZ") * src/types/pa_vdate.h: ! bugfix: to drop TZ on win32 must putenv("TZ="), on unix works only putenv("TZ") * INSTALL: . xml libs versions updated * src/main/pa_globals.C: //20051130 trying to remove this, author claims that fixed a lot there // 20040920 for now both workarounds needed. wait for new libxml/xsl versions 2005-11-28 paf * src/classes/table.C: merged from HEAD: ! nameless table has columns==0 * src/classes/table.C: ! nameless table has columns==0 * src/main/pa_http.C: merged from HEAD: ! status line check made earlier [was totally wrong] * src/main/pa_http.C: ! status line check made earlier [was totally wrong] 2005-11-25 paf * src/include/pa_array.h: -this reduces speed(table::load) strange. undoing for now... * src/include/pa_version.h: -this reduces speed(table::load), strange. undoing * src/classes/op.C: merged from HEAD + ^while(){}[SEPARATOR] * src/classes/op.C, www/htdocs/_bug.html, www/htdocs/auto.p: + ^while(){}[SEPARATOR] * src/include/pa_array.h: + optimistics added: all arrays (table rows) now grow size*=2, like in .NET ArrayList.EnsureCapacity, this speeds things up and saves memory a LOT! (not noticed negative effect on syntetic tests, future will tell...) * src/include/pa_memory.h: . removed GC_DEBUG for debug version, it changed gc_malloc implementation, which obscured profiling * src/classes/table.C: merged from HEAD: + optimized table::load/sql, now row ArrayString-s allocated with columns.count() elements and don't always grow from count=3[realloc,realloc] * src/classes/table.C: + optimized table::load/sql, now row ArrayString-s allocated with columns.count() elements and don't always grow from count=3[realloc,realloc] * src/classes/table.C: merged from HEAD: . ^table.save unused buffer after save * src/classes/table.C: . ^table.save unused buffer after save 2005-11-24 paf * configure.in: . merged glib2-config patch * configure.in: + trying to find glib2-config * src/classes/file.C, src/include/pa_common.h, src/main/execute.C, src/main/pa_common.C, src/main/pa_request.C, www/htdocs/_bug.html: merged from HEAD: ! changed file/dir_readable to simple file/dir_exist, this would help in situations "class not found because .p file has bad rights" << in that case error would be explicit "access denied to 'this' file" * aclocal.m4, configure, src/include/pa_config_auto.h.in: makefiles * src/: classes/file.C, include/pa_common.h, main/execute.C, main/pa_common.C, main/pa_request.C: ! changed file/dir_readable to simple file/dir_exist, this would help in situations "class not found because .p file has bad rights" << in that case error would be explicit "access denied to 'this' file" * src/: classes/file.C, include/Makefile.am, include/pa_common.h, include/pa_http.h, main/Makefile.am, main/main.vcproj, main/pa_common.C, main/pa_http.C: merged from HEAD: +! ^file::exec/cgi[script;$.charset[changed] $.QUERY_STRING[^untaint[URI]{aaa=$form:text} << now %HH would be encoded in $.charset charset * src/classes/file.C, www/htdocs/_bug.html, www/htdocs/_bug.pl, www/htdocs/_bug.txt: +! ^file::exec/cgi[script;$.charset[changed] $.QUERY_STRING[^untaint[URI]{aaa=$form:text} << now %HH would be encoded in $.charset charset * src/: include/Makefile.am, include/pa_common.h, include/pa_http.h, main/Makefile.am, main/main.vcproj, main/pa_common.C, main/pa_http.C: . extracted http:// into separate file [preparation for ^file::cgi[script;$.form[$.field1[] 2005-11-22 paf * src/: include/pa_version.h, main/compile.tab.C: makefiles * acinclude.m4, configure.in: . merged underquting fixes * src/include/pa_config_auto.h.in: configure+makes * src/classes/op.C: . overmerged a little * src/main/compile.tab.C: Makefile * src/main/: pa_common.C: . less gcc warnings * src/classes/op.C: merged from HEAD: + $exception.handled[cache] now reports original exception if we have no old cache * src/classes/op.C, www/htdocs/_bug.html: + $exception.handled[cache] now reports original exception if we have no old cache * src/classes/op.C, src/include/pa_string.h, src/main/untaint.C, www/htdocs/_bug.html: merged from HEAD: + ^taint/untaint[regex] << escapes these: \^$.[]|()?*+{} * src/classes/op.C, src/include/pa_string.h, src/main/untaint.C, www/htdocs/_bug.html: + ^taint/untaint[regex] << escapes these: \^$.[]|()?*+{} * src/types/pa_vdate.h: ! date TZ save/restore stored pointer to getenv-ed variable, which does not work both on win32&unix. copied old TZ value now * src/types/pa_vdate.h: merged from 3.1.5: ! date TZ save/restore stored pointer to getenv-ed variable, which does not work both on win32&unix. copied old TZ value now * src/types/pa_vdate.h: ! date TZ save/restore stored pointer to getenv-ed variable, which does not work both on win32&unix. copied old TZ value now * src/types/pa_vresponse.C: merged from HEAD: + $response:headers access to internal hash * src/types/pa_vresponse.C, www/htdocs/_bug.html: + $response:headers access to internal hash * src/targets/isapi/parser3isapi.C: merged from HEAD: + GC_large_alloc_warn_suppressed=0 between requests [apache mod_, isapi] this reduces number of "GC Warning: Repeated allocation of very large block" messages to only important onces * src/targets/isapi/parser3isapi.C, www/htdocs/_bug.html: + GC_large_alloc_warn_suppressed=0 between requests [apache mod_, isapi] this reduces number of "GC Warning: Repeated allocation of very large block" messages to only important onces * src/classes/string.C: merged from HEAD: + removed limitation on ^string/int/double:sql{}[$.default[({param style})] ] * src/classes/string.C: + removed limitation on ^string/int/double:sql{}[$.default[({param style})] ] * src/main/pa_common.C: merged from HEAD: + removed "use either uri with ?params or $.form option" limitation * src/main/pa_common.C: + removed "use either uri with ?params or $.form option" limitation * src/classes/file.C, src/classes/string.C, src/include/pa_common.h, src/main/pa_common.C, www/htdocs/_bug.html: merged from HEAD: + ^file.base64[] encode + ^file::base64[encoded] decode * src/classes/file.C, src/classes/string.C, src/include/pa_common.h, src/main/pa_common.C, www/htdocs/_bug.html: + ^file.base64[] encode + ^file::base64[encoded] decode * src/classes/file.C, src/classes/string.C, www/htdocs/_bug.html: + ^string.base64[] encode + ^string:base64[encoded] decode * src/classes/string.C, src/include/pa_common.h, src/main/pa_common.C, www/htdocs/_bug.html: + ^string:base64[in] encode + ^string.base64[] decode 2005-11-21 paf * src/classes/file.C, www/htdocs/_bug.html: + merged from HEAD: ^file::create[text;file.xml;^untaint[xml]{data}] * src/classes/file.C, www/htdocs/_bug.html: + ^file::create[text;file.xml;^untaint[xml]{data}] * src/main/pa_request.C: ! merged: $response:body[file] now differes from :download, it does not return content-disposition at all now [previusely it returned valueless content-disposition] * src/main/pa_request.C: ! $response:body[file] now differes from :download, it does not return content-disposition at all now [previusely it returned valueless content-disposition] * src/main/: compile.tab.C, compile.y: ! overoptimized void literals, reverted to just vvod, recreating empty array with each void_value token. that's absolutely needed, since that array grows * src/: main/compile.tab.C, main/compile.y, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vmethod_frame.h: + merged: expression literals: true/false. ^format[$.indent(true)] * src/main/compile.tab.C, src/main/compile.y, src/types/pa_value.h, src/types/pa_vbool.h, src/types/pa_vdouble.h, src/types/pa_vint.h, src/types/pa_vmethod_frame.h, www/htdocs/_bug.html: + expression literals: true/false. ^format[$.indent(true)] * src/types/Makefile.am, src/types/pa_venv.C, src/types/pa_venv.h, src/types/types.vcproj, www/htdocs/_bug.html, www/htdocs/_bug.txt: + merged: $env:PARSER_VERSION reports "3.1.5beta (compiled on i386-pc-win32)" * src/types/Makefile.am, src/types/pa_venv.C, src/types/pa_venv.h, src/types/types.vcproj, www/htdocs/_bug.html: + $env:PARSER_VERSION reports "3.1.5beta (compiled on i386-pc-win32)" 2005-11-18 paf * src/classes/: double.C, int.C: ! ^int/double:sql{select null}[$.default(123)] will now return default value * www/htdocs/_bug.html: + ^cache[] << returns current cache expiration time * src/classes/op.C: + merged ^cache[] << returns current cache expiration time * src/classes/op.C: + ^cache[] << returns current cache expiration time * src/classes/table.C: ! merged ^table::create[not'nameless'; failed << Exception.problem_source pointed to local var! * src/classes/table.C: ! ^table::create[not'nameless'; failed << Exception.problem_source pointed to local var! * src/main/pa_common.C: ! merged: file::load[binary;fileOfZeroSize] now loads VFile.ptr!=0, so such files can be saved now * src/main/pa_common.C: ! file::load[binary;fileOfZeroSize] now loads VFile.ptr!=0, so such files can be saved now * src/include/pa_dir.h, www/htdocs/_bug.html, www/htdocs/_bug.txt: ! merged: file:list now sees .xxx files, only . and .. now removed from list [were removed all .*] * src/include/pa_dir.h: ! file:list now sees .xxx files, only . and .. now removed from list [were removed all .*] * src/lib/sdbm/apr_file_io.C: ! merged from 3.1.5: hashfile file open error now checked, were not :( [stole that piece from apache 1.3 sources] * src/lib/sdbm/apr_file_io.C: ! hashfile file open error now checked, were not :( [stole that piece from apache 1.3 sources] * src/main/pa_request.C: ! merged from 3.1.5: ensured proper untainting of @main result if returned by $result or $response:body * src/main/pa_request.C: ! ensured proper untainting of @main result if returned by $result or $response:body * src/main/pa_common.C: ! merged from 3.1.5: fixed file load memory issue: now tries to guess content-length and allocates one big piece if possible [regretfully gc_realloc works as malloc+free, leaving lots of holes behind] * src/: classes/memory.C, main/compile.tab.C, main/pa_common.C: ! fixed file load memory issue: now tries to guess content-length and allocates one big piece if possible [regretfully gc_realloc works as malloc+free, leaving lots of holes behind] 2005-11-16 paf * src/include/pa_common.h, src/classes/file.C, src/classes/table.C, src/main/compile.tab.C, src/main/pa_common.C, www/htdocs/_bug.html: merged to HEAD: ! table::save with enclosers now doubles them: "->"" ! table::save/load do not remove elements from options hash * src/main/compile.y: ! merged to HEAD: ^if(-f "...") now works [were overoptimized ^if(double_literal), compiler confused OP_VALUE+origin+double with OP_STRINGPOOL+code+OP_writeXX * src/main/: compile.tab.C, compile.y: ! ^if(-f "...") now works [were overoptimized ^if(double_literal), compiler confused OP_VALUE+origin+double with OP_STRINGPOOL+code+OP_writeXX * src/classes/file.C, src/classes/table.C, src/include/pa_common.h, src/main/pa_common.C, www/htdocs/_bug.html: ! table::save with enclosers now doubles them: "->"" ! table::save/load do not remove elements from options hash 2005-11-03 paf * src/main/: Makefile.am, compile.tab.C: removed $< from .y compilation, not all makefiles liked that 2005-08-30 paf * src/classes/op.C: merge . speedup check of [DEFAULT] * src/classes/op.C: . speedup check of [DEFAULT] 2005-08-26 paf * src/classes/date.C, src/types/pa_vdate.h, www/htdocs/_bug.html: merged + date.week * src/classes/date.C, src/types/pa_vdate.h, www/htdocs/_bug.html: + date.week * src/classes/table.C: merged ! ^table::create[bad]{xxx} now complains about bad!=nameless * src/classes/table.C: ! ^table::create[bad]{xxx} now complains about bad!=nameless * src/classes/: hash.C, string.C, table.C, void.C: merged ! optional options were allowed to be empty. were checked if(is_string), changed to !defined||is_string to allow void * src/targets/isapi/parser3isapi.C, www/htdocs/_bug.html, src/classes/hash.C, src/classes/string.C, src/classes/table.C, src/classes/void.C: ! optional options were allowed to be empty. were checked if(is_string), changed to !defined||is_string to allow void * src/types/pa_vmethod_frame.h: merged ! many classes/* used as_junction where they needed as_int/double, so failed with recent "(const) now no junction" optimization * src/classes/: double.C, int.C, math.C, op.C, string.C, table.C: merged ! many classes/* used as_junction where they needed as_int/double, so failed with recent "(const) now no junction" optimization * src/classes/double.C, src/classes/int.C, src/classes/math.C, src/classes/op.C, src/classes/string.C, src/classes/table.C, src/main/compile.tab.C, src/types/pa_vmethod_frame.h, www/htdocs/_bug.html: ! many classes/* used as_junction where they needed as_int/double, so failed with recent "(const) now no junction" optimization 2005-08-24 paf * src/targets/isapi/: parser3isapi.C, parser3isapi.vcproj: ! on windows 2003 DllMain receivese \\?\ prefix to fullspec of .dll, stripped it 2005-08-09 paf * src/types/pa_wcontext.h: ! bugfix in_expression bit field were not cleared * www/htdocs/: _bug.html, _bug.pl, _bug.txt: . file::exec $charset transcodes env fine * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_memory.C, main/pa_os.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vproperty.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: 2005 * src/types/: pa_value.h, pa_vdouble.h, pa_vint.h, pa_vmethod_frame.h: merged from HEAD ! simplified (double) speedup consequent checks in vmethod_frame * src/types/pa_wcontext.h: ! bugfix in_expression bit field were not cleared * src/: classes/file.C, main/pa_exec.C: merged +file::cgi/exec now params: 50 max (were 10) * src/: classes/file.C, main/pa_exec.C: + file::cgi/exec now params: 50 max (were 10) * src/types/pa_value.h, src/types/pa_vdouble.h, src/types/pa_vint.h, src/types/pa_vmethod_frame.h, src/types/pa_vvoid.C, src/types/pa_vvoid.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, www/htdocs/.htaccess, www/htdocs/_bug.html: + ^call[$void] param inside now is void (were: empty string) ! simplified (double) speedup consequent checks in vmethod_frame * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: merged + optimized constants in expressions vstring->vdouble + optimized ^call(vdouble), no junction creation, no calls later 2005-08-08 paf * bin/auto.p.dist.in: merged . apache bad 404 handling workaround integrated * bin/auto.p.dist.in: . apache bad 404 handling workaround integrated * src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.xml: merged + optimized constants in expressions vstring->vdouble + optimized ^call(vdouble), no junction creation, no calls later * src/types/pa_vdouble.h: merged . double values without fractional part now default printed as %.0f instead of %g * src/types/pa_vdouble.h: . double values without fractional part now default printed as %.0f instead of %g * www/htdocs/: _bug.html, _bug.xml: . merged ! second hashfile::open would cause an exception * src/classes/hashfile.C: . merged ! second hashfile::open would cause an exception * src/classes/hashfile.C: ! second hashfile::open would cause an exception * src/classes/classes.h, src/main/execute.C, src/types/pa_junction.h, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vconsole.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vhash.h, src/types/pa_vhashfile.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vjunction.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_object.h, src/types/pa_vvoid.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/_bug.html, www/htdocs/_bug.p: . merged VJunction(new Junction) optimization from 3.1.4 * src/: main/execute.C, types/pa_junction.h, types/pa_vjunction.h, types/pa_vstateless_class.C: + optimized new VJunction(new Junction(params)) to new VJunction(params), thousands of mallocs removed 2005-08-05 paf * src/: include/pa_memory.h, main/compile.tab.C, main/compile.y, types/pa_vdouble.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: + optimized ^call(vdouble), no junction creation, no calls later * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_memory.C, main/pa_os.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: . 2005 ;) * src/: lib/cord/cord.vcproj, lib/gd/gd.vcproj, lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/pcre/pcre.vcproj, lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj, lib/sdbm/sdbm.vcproj, lib/smtp/smtp.vcproj, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj: + optimized constants in expressions vstring->vdouble 2005-07-29 paf * src/types/pa_vclass.C, www/htdocs/_bug.p: . shaped up error messages a bit * src/types/pa_vclass.C, www/htdocs/_bug_derived.p: + property getter can now be overridden * src/main/execute.C, src/types/pa_vclass.C, src/types/pa_vobject.C, www/htdocs/_bug.p, www/htdocs/_bug_derived.p: ! bug fix: static parent fields were not replaced in case $derived:field[put] + property setter can now be overridden * www/htdocs/: _bug.html, _bug.p, _bug_derived.p: + removed limit "ctor must be declared in class being created" 2005-07-28 paf * configure, configure.in, src/classes/classes.h, src/classes/date.C, src/classes/file.C, src/classes/hash.C, src/classes/hashfile.C, src/classes/image.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/include/pa_hash.h, src/include/pa_version.h, src/main/execute.C, src/types/Makefile.am, src/types/pa_method.h, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vconsole.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vhash.h, src/types/pa_vhashfile.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vproperty.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vvoid.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.p, www/htdocs/_bug.pl, www/htdocs/_bug.sh, www/htdocs/auto.p: + 3.2.0 beta: merged from dynamic_fields_join * src/classes/hash.C, src/classes/hashfile.C, src/classes/op.C, src/classes/xnode.C, src/include/pa_hash.h, src/main/execute.C, src/types/pa_method.h, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vconsole.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vhash.h, src/types/pa_vhashfile.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_object.h, src/types/pa_vvoid.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/.htaccess, www/htdocs/auto.p: ! restored put_element('replace' param), and restored its checks in vobject.put_element->static fields | dynamic properties 2005-07-27 paf * src/types/pa_vclass.C: ! changed to GET_ SET_ prefixes. for there is some old code containing @set_name $name * src/types/pa_vobject.h: . fixed warning * configure, configure.in, src/include/pa_version.h, src/types/Makefile.am: 3.2.0beta started * src/classes/xnode.C, src/include/pa_hash.h, src/types/pa_vstateless_class.C, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.p, www/htdocs/_bug.pl, www/htdocs/_bug.sh, www/htdocs/auto.p: ! new asserts were all false. regretfully reverted them all to checks * src/: classes/classes.h, classes/hash.C, classes/hashfile.C, classes/op.C, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: joined_dynamic_fields: removed unused param from put_method (returned to 3 params) * src/include/pa_hash.h, src/types/pa_vclass.C, src/types/pa_vclass.h, www/htdocs/_bug.html, www/htdocs/_bug.p: joined_dynamic_fields: dynamic get/set works with overriding props [alpha2] * src/types/pa_vclass.C, www/htdocs/_bug.html: joined_dynamic_fields: dynamic get/set works [alfa] * src/: classes/classes.h, classes/hash.C, classes/hashfile.C, classes/op.C, include/pa_hash.h, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: joined_dynamic_fields: just compiled * src/: classes/date.C, classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/table.C, classes/xdoc.C, classes/xnode.h, main/execute.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h: joined_dynamic_fields: started * src/types/pa_vobject.C: . object setters [only started, does not work yet] * src/include/pa_hash.h, src/types/pa_vclass.C, src/types/pa_vobject.C, www/htdocs/_bug.html, www/htdocs/_bug.p: . object setters [only started, does not work yet] 2005-07-26 paf * src/include/pa_request.h, src/main/execute.C, www/htdocs/_bug.html: . properties: set works [alpha2]. for classes. todo: for objects * src/classes/classes.h, src/include/pa_hash.h, src/main/execute.C, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vconsole.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vhash.h, src/types/pa_vhashfile.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_object.h, src/types/pa_vvoid.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/_bug.html: . properties: set works [alpha1] 2005-07-25 paf * src/main/compile.C, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, www/htdocs/_bug.html: . properties: started, get works [alpha1, other approach] * src/main/compile.C, src/types/pa_vclass.C, src/types/pa_vclass.h, www/htdocs/_bug.html, www/htdocs/_bug.p: . properties: started, get works [alpha2] * src/types/: pa_vclass.C, pa_vclass.h, pa_vstateless_class.C, pa_vstateless_class.h: . properties: started, get works [alpha] 2005-07-15 paf * src/: classes/classes.h, classes/op.C, main/execute.C, types/pa_junction.h, types/pa_property.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.vcproj: + started property [getters work but think of changing them too to precaching] 2005-07-08 paf * src/main/pa_request.C, www/htdocs/_bug.html: ! bugfix: $response:body[nonfile] caused gpf 2005-06-28 paf * src/: classes/file.C, main/untaint.C: ! string invariant violated in passing empty strings to file::exec/cgi environment 2005-06-06 paf * src/classes/hash.C, src/classes/string.C, src/classes/table.C, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.pl, www/htdocs/_bug.xsl: ! bugfix ^string:sql ^table:sql ^hash:sql now DO process $.bind option 2005-05-24 paf * src/classes/file.C: ! bugfix ^file::load[mode;name;$.offset $.limit] now work again [support was broken in 3.1.4] * src/: main/pa_string.C, classes/op.C: . steps toward removing ALL_INTERIOR_POINTERS 2005-05-12 paf * configure: 3.1.5beta * src/main/pa_common.C: ! bugfix -- recv()==0 is not an error * src/main/pa_common.C: ! bugfix ^file::load[mode;name;$.offset $.limit] now work again [support was broken in 3.1.4] * src/lib/gd/gif.C: ! fixed image.fill, not it does not depend on line-width [was refusing to fill if line-width >1, thanks to Seras for repro case 2005-04-25 paf * src/types/pa_vdate.h: ! getenv("TZ")==0? TZ environment restored correctly 2005-04-19 paf * src/types/pa_vdate.h: bugfix: initial $date.TZ is 0, that results in VString violating invariant!! * src/types/pa_vdate.h: bugfix: TZ now restored after roll if were getenv("TZ")==null 2005-04-08 paf * src/main/pa_charset.C: bugfix: UTF8->one-byte-per-char-encoding bugfix: when there is no char in charset one byte produces 6 (ÿ <hash now regards _default * src/types/pa_vmethod_frame.h, www/htdocs/_bug.html: bugfix: when method junction was created by accessing $name_of_method it acquired bad self=closest methodframe; instead of proper self (current class) * src/types/pa_vhashfile.C, www/htdocs/_bug.html: bugfix: reading empty string from hashfile produced bad cord 2004-12-10 paf * src/: lib/smtp/comms.C, main/pa_common.C: DONT_LINGER can cause subsequent failures though defined in .h * src/main/pa_common.C: comment on volatile * src/: include/pa_config_auto.h.in, main/pa_common.C: http: unix: alarm function were not used since the beginning due to stupid error [setsigjmp were not checked in configure.in] * src/main/pa_common.C: http: timeout setsockopt [if possible] on unix too * src/main/pa_common.C: http: exception status of send/recv errors change to most probable http.timeout * src/main/pa_common.C, www/htdocs/_bug.html: win32: http connection $.timeout option now works [setsockopt on send/receive] 2004-12-08 paf * src/classes/mail.C, src/types/pa_vmail.C, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.xsl: bugfix: mail body now cstr-ed knowing mail charset, and untainting uri lang now knows proper charset 2004-11-24 paf * src/classes/hash.C: hash: adding/cloning adds/clones _default now $hash[ $.a[1] $._default[def] ] #$hash2[^hash::create[$hash]] $hash2[^hash::create[]] ^hash2.add[$hash] $hash2.shit 2004-11-12 paf * src/types/pa_vmail.C: bugfix: mail:send[$.date[]] were ignored [since 3.0.4] 2004-11-09 paf * src/targets/cgi/parser3.C: debug: PA_DEBUG_CGI_ENTRY_EXIT if on, writes basics to c:\parser3.log 2004-10-21 paf * src/classes/xnode.C: bugfix: xnode.getAttribute[NS] now return tainted strings [were returning clean onces] 2004-10-15 paf * src/types/pa_vdouble.h: bugfix: ^for[i](1;1.5){} << did two cycles(i=1; i=2), which was wrong, now does ONE 2004-10-12 paf * etc/parser3.charsets/windows-1251.cfg: euro promille +/- 2004-10-07 paf * src/include/pa_config_fixed.h, src/include/pa_config_includes.h, src/main/pa_globals.C, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.pl: debugger help: PA_RELEASE_ASSERTS enables release asserts * src/: main/pa_string.C, include/pa_string.h: debugger help: String.dump() to stdout in detailed form [were String.v() in short form] * src/lib/cord/cordbscs.c: debugger help: CORD_dump now dumpts \t\r\n as @#| and truncates long char sequences less 2004-10-06 paf * src/: include/pa_socks.h, main/pa_common.C, main/pa_socks.C: win32 beauty: socket errors properly decoded 2004-10-05 paf * src/: include/pa_request.h, main/pa_request.C: bugfix: request::configure_user/admin done always, even if no file-to-process useful in @unhandled_exception [say, if they would want to mail by SMTP something] * src/main/pa_request.C: bugfix: cookie(and mail:recieved) fills now performed prior to file loading [and @auto executing] thus making $cookie:value available in @auto and in @unhandled_exception when IIS is configured to run interpreter even if no file exist 2004-09-20 paf * src/main/pa_globals.C: libxml has bugs: it calls xmlMallocAtomic somewhere where it should have called xmlMalloc and it calls xmlFree when it should have not called it. inserted two workarounds: xmlMallocAtomic implemented as xmlMalloc, and xmlFree just ignored. put away a testcase, maybe someday libxml author would fix all that. until that day: we have SLOW garbage collecting when many xml objects are alive hint: do ^memory:compact[] before xdoc::create 2004-09-17 paf * src/classes/file.C: bugfix: file::cgi headers were lost [typo error from 3.0.8 version] 2004-09-14 paf * src/types/pa_vhashfile.C: bugfix: hashfile.clear deleted only part bugfix: hashfile.foreach iterated only part if hashfile were modified inside 2004-09-13 paf * src/main/pa_string.C, www/htdocs/_bug.html: bugfix: $s[+008] ^eval($s) now parsed OK [were as octal] * src/types/pa_vhashfile.C, www/htdocs/_bug.html: beauty: not reproduced $hashfile.key[$novalue] bug [reported by motorin], inserted safety-check * src/types/pa_vhashfile.C: change: empty keys now error in parser [not something obscure from sdbm lib] * src/types/pa_vhashfile.C, www/htdocs/_bug.html: bugfix: error numbers now from errno.h = strerror now returnes something and we can properly report that to client * src/lib/sdbm/sdbm_private.h: change: limit on length(key+value) now 8008 bytes, were 1008. perl sdbm compatibility now ruined * www/htdocs/: _bug.html, _bug.xsl: change: ^xdoc.string now outputted as-is [tainted as-is] this helps //[space][newline] to remain as-is and not be unnecessary optimized away [ruining javascript] * src/classes/xdoc.C: change: ^xdoc.string now outputted as-is [tainted as-is] this helps //[space][newline] to remain as-is and not be unnecessary optimized away [ruining javascript] * src/classes/xdoc.C: change: ^xdoc.string now outputted as-is [tainted as-is] * src/classes/mail.C: bugfix: typo error 2004-09-09 paf * src/main/pa_common.C: bugfix: loads headers with both \r\n and \n separators bugfix: loads header with endings \r\n\r\n and \n\n (bloody yandex.server) 2004-09-06 paf * src/main/pa_charset.C: bugfix: two-bytes invalid chars in TranscodeFromUTF8 considered valid. only >2bytes-long now %HH encoded 2004-09-01 paf * src/types/pa_vmail.C: change: multipart/mixed changed to multipart/related outlook express have no problems showing unrelated attachments. todo: someday figure out a way of multipart/mixed multipart/related text/html image/xxx application/octet-stream << true attachments * src/types/pa_vmail.C, www/htdocs/_bug.html: new: ^mail:send[$.file[$.content-disposition can be overriden new: empty mail header fields removed from letter * src/classes/mail.C, src/include/pa_config_fixed.h, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vmail.C, www/htdocs/_bug.html: new: ^mail:send[ $.file[ $.any[header] 2004-08-30 paf * src/include/pa_config_fixed.h, src/main/pa_common.C, www/htdocs/.htaccess, www/htdocs/_bug.html: beauty: less warnings * src/main/pa_common.C: beauty: do not bother with charset detection when ^file::load[binary 2004-08-27 paf * src/main/pa_common.C: hack: for yandex.server http server 2004-08-18 paf * src/main/pa_request.C: bugfix: Accept-Ranges: bytes when sending possibly-chunked response 2004-08-17 paf * src/classes/file.C: bugfix: $f[^file::load[;http://]] $f.content-type now = that of http response * src/classes/file.C: bugfix: $f[^file::load[;http://]] $f.content-type now = that of http response 2004-08-03 paf * www/htdocs/: .htaccess, _bug.html: bugfix: empty input variables can be replaced by output [forgot to allocate proper buffer, oracle _server_ died with kgepop: no error frame to pop to for error 21500 message] 2004-07-30 paf * src/include/pa_request.h, src/main/pa_request.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, www/htdocs/.htaccess: bugfix: win32: system&parser exceptions in release mode reported properly parser exception in exception handler WERE mistakenly reported as system exception, without details [in apache & isapi] +some beauty in exception text * src/include/pa_exception.h, src/main/pa_request.C, src/targets/cgi/parser3.C, www/htdocs/.htaccess, www/htdocs/_bug.html: bugfix: win32: system&parser exceptions in release mode reported properly parser exception in exception handler WERE mistakenly reported as system exception, without details * src/main/execute.C: beauty: simplified system exception handling 2004-07-29 paf * src/classes/table.C, www/htdocs/_bug.html: bugfix: ^table.save[export.csv;$.separator[^;]] now works fine [separator were ignored, and \t used unconditionally] * src/types/Makefile.am: added vhash.c 2004-07-28 paf * src/: classes/date.C, classes/image.C, classes/math.C, lib/ltdl/ltdl.c, lib/pcre/pcre_parser_ctype.c, lib/smtp/comms.C, main/pa_common.C, targets/cgi/parser3.C, types/pa_vform.C, types/pa_vmail.C: bugfix: isspace((unsigned char)c) everywhere. failed on russian letters * src/main/pa_string.C, src/types/pa_vmail.C, www/htdocs/_bug.html, src/main/pa_common.C: bugfix: isspace((unsigned char)c) everywhere. failed on russian letters * www/htdocs/_bug.html: bugfix: win32: chdir not needed, dir passwed as 'currentDirectory' parameter to CreateProcess * src/main/pa_exec.C: bugfix: win32: chdir not needed, dir passwed as 'currentDirectory' parameter to CreateProcess 2004-07-27 paf * src/targets/cgi/parser3.vcproj: beauty: win32: globaloptimizations ON, release:mapfile ON todo: copy .mapfile from release somewhere [to help searching for unhandled system exceptions] * src/types/pa_vdate.h: check: for invalid datetime after temporary TZ shift * src/types/pa_vdate.h: bugfix: time checked not only at set_time but also in ctor 2004-07-26 paf * operators.txt, src/include/pa_common.h, src/main/pa_common.C, src/main/pa_request.C, src/types/pa_vfile.h, src/types/pa_vhash.C, src/types/pa_vhash.h, src/types/types.vcproj, www/htdocs/_bug.html: new: $response:body/download[ $.file[name on disk] $.name[of file for user] $.mdate[date of last-modified. default from directory] ] * src/classes/file.C: moving file:send somewhere else.. * src/: classes/file.C, include/pa_sapi.h, main/pa_common.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: patched: ^file:send by Victor Fedoseev todo: turn it to $response:download[ $.filename[filename] $.option[] ,, ] * src/classes/file.C: beauty: invalid mode thoroughly reported 2004-07-21 paf * src/types/pa_vmail.C, www/htdocs/_bug.html: bugfix: too long header values now splitted to several lines were: header: vaaaaaaaaaaaalue now: header: vaaaaaa aaalue note: ms outlook[!express] shows only first 255 characters of subject 2004-07-15 paf * src/main/pa_os.C: bugfix: locks now compiled in [were mistakenly off] 2004-07-14 paf * src/classes/table.C: bugfix: $.bind values now got untainted according to lang [were: as-is] 2004-07-07 paf * src/classes/op.C: bugfix: cache with 2 params caused assertion, checked that * src/main/pa_exec.C: bufix: on unix AND win32 environment string now untainted according to their languages. were: as-is. EVERYWHERE * src/classes/file.C, src/main/pa_exec.C, www/htdocs/_bug.html, www/htdocs/_bug.pl: bufix: on unix AND win32 environment string now untainted according to their languages. were: as-is. EVERYWHERE * src/main/pa_exec.C: bufix: on unix environment string now untainted according to their languages. were: as-is. on win32: ok * parser3.vssscc: ...would not go unnoticed * src/main/pa_charset.C, www/htdocs/.htaccess, www/htdocs/_bug.html: convinience: transcodeFromUTF8 now never fails. in case on input appears nonutf, those bytes will be printed in %HH form. that can be easily decoded/recovered. this form is quite noticable, and hopefully would not go noticed 2004-07-06 paf * src/main/pa_exec.C: bufix: on unix environment string now untainted according to their languages. were: as-is. on win32: ok 2004-07-01 paf * src/classes/classes.vcproj, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/smtp/smtp.vcproj, src/main/main.vcproj, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj, www/htdocs/.htaccess: win32: option: global optimization ON * src/main/untaint.C, www/htdocs/_bug.html: workaround kinda bug in libxml: life requires to do xdoc::create{invalid chars} standard disables chars less then \x20, except tab, cr, lf. changed tainting so that those become '!' 2004-06-25 paf * src/types/pa_vhashfile.C: bugfix: hashfile deserialize accessed int on odd address [prev bugfix failed due to superwize optimizer, which turned memcpy into same 'ld' asm command] * src/types/pa_vhashfile.C: bugfix: hashfile deserialize accessed int on odd address 2004-06-23 paf * www/htdocs/_bug.html: checked: oracle: various ways of returning error from stored proc. bad: no way of knowing which exactly user-defined exception were thrown. good: raise_application_error can return error message number and string FINE good: PRAGMA EXCEPTION_INIT works good too 2004-06-22 paf * src/sql/pa_sql_driver.h: note: about possible optimization * www/htdocs/_bug.html: checked: in out variables OK * operators.txt, src/classes/hash.C, src/classes/memory.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/include/pa_config_includes.h, www/htdocs/_bug.html: new: ^void:sql{call paf(:a)}[ $.bind[ $.a[2] ] ] output variables work. todo: check in out variables 2004-06-18 paf * src/classes/file.C, src/classes/hash.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/include/pa_globals.h, src/include/pa_sql_connection.h, src/main/compile.tab.C, src/sql/pa_sql_driver.h, www/htdocs/.htaccess, www/htdocs/_bug.html: started: ^void:sql{call paf(:a)}[ $.bind[ $.a[2] ] ] input variables work. todo:output * src/targets/cgi/parser3.C: bugfix: iis specific http://parser3/_bug.html?404;http://hpsv/test/ now $request:uri /_bug.html?404;http://hpsv/test/ -------------------------------------------------------------------------------- $request:query IIS-STATUS=404&IIS-DOCUMENT=http://hpsv/test/ -------------------------------------------------------------------------------- IIS-STATUS="404" IIS-DOCUMENT="http://hpsv/test/" 2004-06-16 paf * src/targets/cgi/parser3.C: new: iis specific http://parser3/_bug.html?404;http://server/_bug.html?f=v now $request:query IIS-STATUS=404&IIS-DOCUMENT=http://server/_bug.html&f=v $form:fields IIS-STATUS="404" IIS-DOCUMENT="http://server/_bug.html" f="v" todo: isapi too 2004-05-26 paf * src/include/pa_version.h: 3.1.3 * operators.txt: beauty: removed outdated level 'table' * etc/parser3.charsets/x-mac-cyrillic.cfg: added: thanks to konst * src/main/pa_string.C: beauty: removed 3 warnings * src/include/pa_string.h, src/classes/table.C, src/main/untaint.C, www/htdocs/_bug.html, src/classes/op.C: beauty: removed outdated level 'table' 2004-05-25 paf * src/lib/sdbm/apr_file_io.C: bugfix: bad seek wrapper implementation. mistery: how anything worked * src/sql/pa_sql_driver.h: beauty: param renamed and comment changed, it is now safe to use url if pointers to it are stored to gc mem * src/: main/pa_exec.C, types/pa_vhashfile.C: bugfix: hashfile unknown errors reported and not cause SIGSEGV now 2004-05-24 paf * src/include/pa_string.h, src/lib/cord/cordbscs.c, src/lib/cord/include/cord.h, www/htdocs/_bug.html, src/lib/cord/cordxtra.c: cancel: more speed, less memory: CORD_chars_block originally intended to ... it was good that CORD_chars_block were not used: it consumes more memory [and, might be slow too] undoing that. [and removed that func so that it would not confuse parser developer in future] * src/: include/pa_string.h, lib/cord/include/cord.h: more speed, less memory: CORD_chars_block originally intended to speedup/reduce mem usage were forgotten, and were used stupid CORD_chars * src/include/pa_config_auto.h.in: bugfix: bigendian check added * src/include/: pa_config_fixed.h, pa_string.h: bugfix: on BIGENDIAN processors space-conserving mech failed, causing SIGSEGV/SIGBUS and SAPI::abort("unknown untaint lang#%d", (1|2|3)); 2004-05-14 paf * src/types/Makefile.am, src/types/pa_vvoid.C, src/types/pa_vvoid.h, src/types/types.vcproj, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/auto.p: bugfix: void now has vfile value, and $response:body[] works OK 2004-05-12 paf * src/types/pa_vbool.h, src/types/pa_vhash.h, src/types/pa_vhashfile.h, src/types/pa_vtable.h, www/htdocs/.htaccess, www/htdocs/_bug.html: beauty: ^if(def $bool) now equals ^if($bool) and shaped up other sources to use is_defined() {return as_bool();} along VBool 2004-05-11 paf * src/include/pa_exec.h: bugfix: gpf on file::exec/cgi because of referencing to local objects * src/classes/mail.C, src/include/pa_exec.h, src/main/compile.tab.C, src/types/pa_vmail.C, src/types/pa_vmail.h, www/htdocs/.htaccess, www/htdocs/_bug.gif, www/htdocs/_bug.html: bugfix: bcc with sendmail now left intact 2004-04-15 paf * src/classes/date.C: merged: beauty: unused var removed * src/classes/date.C: beauty: unused var removed * src/include/: pa_exec.h: bugfix: interface without pointer provoked bug 2004-04-09 paf * src/types/pa_vform.C: merge: bugfix: form:imap were incorrect * src/types/pa_vform.C: bugfix: form:imap were incorrect 2004-04-08 paf * src/classes/date.C: new: ^date::create[y-m-d h-M-s>>.milliseconds<<] now allowed, ignored so far * src/main/pa_xml_io.C: merged: bugfix /etc/xml/catalog * src/main/pa_xml_io.C: bugfix: in safe mode -- disabled attempts to consult default catalog [usually, that file belongs to other user/group] 2004-04-06 paf * src/main/pa_common.C: beauty: gcc warning removed * src/main/: compile.tab.C, compile.y: bugfix: gcc refused to accept that trick, trying other * src/main/compile.tab.C, src/main/compile.y, www/htdocs/_bug.html: bugfix: step3 to fix explicit result problem * src/main/compile.tab.C, src/main/compile.y, www/htdocs/_bug.html: bugfix: step2 to fix explicit result problem * src/main/compile.tab.C, src/main/compile.y, www/htdocs/_bug.html: bugfix: step1 to fix explicit result problem * operators.txt, src/classes/string.C: new: ^string.append[string] * src/include/pa_opcode.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, www/htdocs/_bug.html: attempt_check_call_in_explicit_result_mode: failed * src/main/pa_common.C: bugfix: of 1.175 bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] now checked properly, were: needless reverse/forward dns lookup * src/main/pa_common.C: bugfix: of 1.175 bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] now checked properly, were: needless reverse/forward dns lookup * src/main/compile.C, src/main/compile.tab.C, src/main/compile.y, www/htdocs/_bug.html: reimplemented: @method[][result] means "no string output here" moved to lexical level [on grammar level it were too difficult] * operators.txt, src/include/pa_string.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, www/htdocs/.htaccess, www/htdocs/_bug.html: new: @method[][result] means "no string output here", implemented part of that idea: compiler throws away string literal generation code. and barks nonwhitespace chars * operators.txt: truth: removed comment about $ORIGIN 2004-04-05 paf * configure.in, src/doc/html2chm.cmd, src/doc/sources2html.cmd, src/include/pa_version.h, src/main/pa_common.C, src/targets/isapi/parser3isapi.C, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.txt: merged with 3.1.3 * etc/parser3.charsets/x-mac-cyrillic.cfg: added: donated by Konstantin Tomashevitch [mailto:konst@design.ru] * src/doc/html2chm.cmd: beauty: no need in bg here * src/doc/sources2html.cmd: beauty: same window, in bg it interfered with FAR console * configure, configure.in: 3.1.3 * src/targets/isapi/parser3isapi.C: beauty: removed some warnings * src/main/pa_common.C: removed warning * src/include/pa_version.h: 3.1.3 2004-04-02 paf * src/main/pa_string.C: bugfix: $s[009] ^s.int[] now 9, were error * src/targets/cgi/parser3.C: new: CGI_PARSER_LOG env variable allows to specify where to put parser log file 2004-04-01 paf * src/classes/table.C: bugfix: bugfix: table::load last line without tab and enter were ignored * src/: include/pa_cache_managers.h, include/pa_globals.h, include/pa_socks.h, main/pa_cache_managers.C, main/pa_globals.C, main/pa_socks.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.def: bugfix: sql connections now are disconnected 2004-03-30 paf * src/classes/table.C: bugfix: table::load last line without tab and enter were ignored * src/classes/table.C: bufix: if last table lines were commented, gpfed * src/doc/ClassExample1.dox, src/doc/ClassExample2.dox, src/doc/ClassExample3.dox, src/doc/chmhelper.pl, src/doc/class.dox, src/doc/compiler.dox, src/doc/doxygen.cfg, src/doc/exception.dox, src/doc/executor.dox, src/doc/footer.htm, src/doc/index.dox, src/doc/memory.dox, src/doc/methoded.dox, src/doc/object.dox, src/doc/string.dox, src/doc/targets.dox, src/doc/value.dox, src/include/pa_version.h, src/main/pa_cache_managers.C, src/main/pa_stylesheet_connection.C, src/targets/isapi/parser3isapi.vcproj, src/types/pa_vform.C, www/htdocs/_bug.html, www/htdocs/_bug.txt: merged bugfixes from 3.1.2, changed version to 3.1.3beta 2004-03-29 paf * src/types/pa_vhashfile.C: bugfix: empty key on hashfile.get causes gpf * src/doc/: ClassExample1.dox, ClassExample2.dox, ClassExample3.dox, chmhelper.pl, class.dox, compiler.dox, doxygen.cfg, exception.dox, executor.dox, footer.htm, index.dox, memory.dox, methoded.dox, object.dox, string.dox, targets.dox, value.dox: translated to english 2004-03-25 paf * src/targets/isapi/parser3isapi.vcproj: beauty: one more parser3project dependency removed * src/main/: pa_cache_managers.C, pa_stylesheet_connection.C: bugfix: refused to compile without xml * src/types/pa_vform.C: beauty: removed warning * src/classes/classes.vcproj: merged bugfix: now all compiles in any folder [removed last ;) folder dependency] * src/classes/classes.vcproj: bugfix: now all compiles in any folder [removed last ;) folder dependency] * src/include/pa_version.h: release * src/lib/gd/gif.C: new: ^image.pixel(outof;bounds) now returns -1 * src/classes/table.C: beauty: comment& more meaningful error message * src/classes/hash.C, www/htdocs/_bug.html: bugfix: ^hash::sql{one column} now produces $.hash[$.column_value1(true) ... ] [were producing some strang thing] 2004-03-23 paf * src/classes/image.C, src/main/pa_common.C, www/htdocs/_bug.html: bugfix: ^image.polyline and http status line parsing checked number of columns in table [user reported an assert] * operators.txt: example: on hashfile * src/classes/op.C, src/types/pa_value.C, src/types/pa_wcontext.C, www/htdocs/_bug.html: bugfix: junction reattach now actually reattaches a junction to new wcontext [were only assigning it to junction, which caused junction tracking to loose junction, and it's context were not killed, and it tried to process in invalid context, gpf] * src/targets/cgi/parser3.C: debug helper added 2004-03-19 paf * src/types/pa_wcontext.C, www/htdocs/_bug.html: beauty: error messages removed duplicate "type(type)" in braces 2004-03-10 paf * operators.txt, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, www/htdocs/_bug.html: new: refined solution to search-in-namespaces problem: $xdoc.search-namespaces.x[http://pif.design.ru/] $nodes[^xdoc.select[//x:second]] * operators.txt, src/classes/xnode.C, www/htdocs/_bug.html, www/htdocs/_bug.xml: new: xnode.select*[xpath expression][[NAMESPACES HASH]] allows to search for info in namespaces $nodes[^xdoc.select[//x:second][ $.x[http://pif.design.ru/] ]] 2004-03-09 paf * operators.txt, src/main/pa_common.C, www/htdocs/.htaccess, www/htdocs/_bug.html, www/htdocs/_bug.txt, www/htdocs/_bug.xsl: new: ^file::load[...][options] $.form[ !$.field1[string] !$.field2[^table::create{one_column_only^#0Avalue1^#0Avalue2}] ] !$.body[string] GET ?here notGET(POST, HEAD, others) in content-type: application/x-www-form-urlencoded todo: upload files ability * src/lib/cord/cordxtra.c: bugfix: CORD_pos were not fixed properly, done 2004-03-05 paf * operators.txt, src/main/pa_common.C: new: file::load[;http:// GET/POST $.form[$.fields started, not tested yet todo:$.field[table] for multiple values * operators.txt: new: http:// options $.user $.password basic authorization * src/main/pa_common.C: beauty: link to rtf added * operators.txt, src/include/pa_common.h, src/main/pa_common.C, www/htdocs/_bug.html: new: http:// options $.user $.password basic authorization * src/main/pa_common.C: beauty: removed needless vars * operators.txt: new: pgsql option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works * src/sql/pa_sql_driver.h: beauty: important warning added * etc/parser3.charsets/koi8-r.cfg: there's special code for grad char! * etc/parser3.charsets/windows-1251.cfg: typo * www/htdocs/_bug.html, operators.txt: new: odbc option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works 2004-03-04 paf * www/htdocs/: _bug.html, _bug.txt: new: mysql option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works * src/main/pa_sql_driver_manager.C: speedup: charset lookups cached, sql transcoding now goes faster * operators.txt: new: mysql option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works * etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: keyboard typo error * etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: typograph chars commented 2004-03-03 paf * INSTALL: note: added on libgc on FreeBSD, thanks to Andrey N. Pazychev <135@ugtel.ru> and Goor 2004-03-02 paf * operators.txt: new[update typo]: !^void.left(n) nothing !^void.right(n) nothing !^void.mid(p[;n]) nothing * operators.txt, src/classes/void.C, www/htdocs/_bug.html: new: !^void.left(n) nothing !^void.right(n) nothing !^void.pos(p[;n]) nothing * operators.txt, src/classes/file.C, src/include/pa_string.h, www/htdocs/_bug.html: new: ^file::sql[[name_to_become_$.name]]{} query result must be one row with columns: first: data second: file name third: content-type * operators.txt, src/classes/file.C, www/htdocs/_bug.gif, www/htdocs/_bug.html: ^file.sql-string[] inside ^connect gets properly escaped string, which can be passed to request now this for mysql only. it's up to parser sql driver to fix zeros properly * INSTALL: note: added on building apache with this option: --enable-shared=max thanks to Victor Fedoseev * www/htdocs/_bug.html: feature: oracle?..&LowerCaseColumnNames=0&ClientCharset=something column names got transcoded to $request:charset too [were only column data] 2004-03-01 paf * src/targets/isapi/parser3isapi.C: new: apache module & isapi extension memory:compact befor processingrequest * operators.txt, src/classes/hash.C, www/htdocs/_bug.html: new: ^hash._keys[>>name<<] to call sole column of result * operators.txt, src/classes/image.C, src/lib/gd/gif.C, src/lib/gd/gif.h, www/htdocs/_bug.html: new: ^image.pixel(x;y)[(color)] get/set pixel color * src/classes/image.C, src/types/pa_vimage.C, src/types/pa_vimage.h, www/htdocs/_bug.html: beauty: image -- less checks [were ugly impl] * src/classes/string.C, www/htdocs/_bug.html: bugfix: ^string.left/right/mid with negative values now considered bad * src/main/pa_common.C: bugfix: INADDR_NONE not everywhere defined * src/classes/xdoc.C, src/types/pa_vxdoc.h, www/htdocs/_bug.html, www/htdocs/_bug.xsl: bugfix: boolean output options now have unified defaults [after transform indent/omit-xml-declaration/standalone 'default' erroreously meant 'true'] * www/htdocs/_bug.html: bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] * src/main/pa_common.C: bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] * src/include/pa_config_auto.h.in: no select check, no define * src/classes/string.C: feature: ^string.trim both parameters may be empty-strings, meaning kind=both chars=whitespaces * src/lib/smtp/comms.C: bugfix: use SO_LINGER if no SO_DONTLINGER exist * src/classes/string.C: check: trim 'chars' must not be empty, exception if it is * src/classes/string.C: changed: ^string.trim [] << both, whitespaces [start|both|end] << kind, whitespaces [start|both|end;chars] full 2004-02-27 paf * operators.txt, src/classes/string.C, src/main/pa_string.C, www/htdocs/_bug.html: new method: ^string.trim[start|both|end[;chars]] default 'chars' -- whitespace chars finished * operators.txt, src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C, www/htdocs/_bug.html: new method: ^string.trim[start|both|end[;chars]] default 'chars' -- whitespace chars started, only start works * www/htdocs/: _bug.html, _bug.xml, _bug.xsl: bug discovered: todo! xdoc::create+save != xdoc.transform&no+save * src/main/compile.C: bugfix: line numbers after ^process{}[$.line(-10]] can be negative, allowed to print they as signed * src/main/untaint.C: speed: there's no \n chars in output [normally], so no need to optimize them they could be retrived from databases, though. but 1. should be replaced 2. if not optimized, no harm done * www/htdocs/: _bug.html, _bug.txt: just test: file::load[text;http:// $.text utf-8 signature, line ends OK http://i2/tasks/edit/?id=4629476859594276758 * src/main/pa_exec.C: bugfix: waitpid could be interrupted -- ^file::exec/cgi could return invalid status & zombie child can remain for short period until process exists [very bad in mod_parser3] http://i2/tasks/edit/?id=4629451867179521923 * src/lib/smtp/smtp.h: bugfix: SMTP buffer overflow could allow malicious SMTP server to attack as by returning too long status responses http://i2/tasks/edit/?id=4629448401140924947 2004-02-26 paf * operators.txt: feature: ^process...{CODE}[now has options] which are $.main[to what to rename @main] $.file[file, from which (user says) goes that CODE] $.lineno(line number in that file, where CODE starts. may be negative) * operators.txt, src/classes/op.C, src/include/pa_request.h, src/main/compile.C, src/main/compile_tools.h, src/main/pa_request.C, www/htdocs/_bug.html, www/htdocs/_bug.p, www/htdocs/_bug.xsl: feature: ^process...{CODE}[now has options] which are $.main[to what to rename @main] $.file[file, from which (user says) goes that CODE] $.lineno(line number in that file, where CODE starts. may be negative) 2004-02-25 paf * etc/parser3.charsets/Makefile.am: bugfix: @sysconfdir@ used [were old @charsetsdir@ recently erased from configure.in] * src/classes/hash.C: feature: ^hash::sql{one colum result} now produces hash of column=>1 * www/htdocs/: _bug.html, _bug.xsl: xhtml: as resutl of [tab] is OK * src/lib/smtp/smtp.h: beauty: couple of #ifdef-s to compile even with incomplete errno constants set 2004-02-24 paf * src/lib/smtp/smtp.C: smtp on unix: authors of lib/smtp never read "man select" * src/main/pa_os.C: beauty: <0 better then ==-1 * src/lib/smtp/comms.C: smtp on unix: steps to work on unix * src/lib/smtp/: smtp.C: smtp on unix: steps to work on unix * src/classes/Makefile.am: smtp on unix: steps to work on unix * src/: classes/mail.C, types/pa_vmail.C, types/pa_vmail.h: smtp on unix: steps to work on unix [extracted 'to'] * src/classes/mail.C: smtp on unix: steps to work on unix * src/lib/smtp/smtp.C: smtp on unix: compiled on win32 * src/: lib/smtp/Makefile.am, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, targets/cgi/Makefile.am: started porting smtp to unix [testing on solaris] 2004-02-20 paf * src/classes/xdoc.C, www/htdocs/_bug.xsl: beauty: ugly code removed, thanks to egr for pointing that out * www/htdocs/: _bug.html, _bug.xsl: bugfix: * src/classes/xdoc.C: beauty: no submits. parser thought there were nameless empty file and $form:field got value of type 'file' * INSTALL: --without-threads * src/include/pa_sapi.h: 2004 2004-02-11 paf * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_memory.C, main/pa_os.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: 2004 * src/main/pa_globals.C: beauty: typo caused gc.log warnings with debug version of gc.dll * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/pcre/pcre.vcproj, lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj, lib/sdbm/sdbm.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: migrated to latest libxml[2.6.5] and libgdome[1.1.2] simplified lib build processes * src/: classes/classes.vcproj, lib/gd/gd.vcproj, main/main.vcproj, main/pa_globals.C, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: continued changes to reflect libxml xsl new folders * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/cgi/parser3.vcproj, types/types.vcproj: continued changes to reflect libxml xsl new folders * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: started changes to reflect libxml xsl new folders * ChangeLog, parser3.sln, src/classes/classes.vcproj, src/lib/gd/gd.vcproj, src/lib/smtp/smtp.vcproj, src/main/compile.tab.C, src/main/main.vcproj, src/main/pa_globals.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj, www/htdocs/.htaccess: started changes to reflect libxml xsl new folders 2004-02-10 paf * INSTALL: critical: libxslt1.1.2 wanted at least libxml2.6.3 to compile. recommened latest libxml up to date * INSTALL: critical: prior to 1.0.30 had bug: "a segfault on pattern compilation errors", on which spent 4 hours worktime. use versions higher than that. recommended now latest up to date 2004-02-06 paf * src/main/: pa_sql_driver_manager.C, pa_stylesheet_manager.C: beauty: unified destructing style * src/main/untaint.C: beauty: removed old def/ifdef * src/main/untaint.C: beauty: coredump @unknown untaint language now 2004-02-03 paf * src/: classes/image.C, main/pa_exec.C, main/pa_memory.C, targets/isapi/parser3isapi.C, types/pa_value.C, types/pa_vcookie.C: beauty: %u is more simple=proper for size_t then %ld/%lu * src/main/pa_common.C: typo: %l -> %u * src/classes/xdoc.C: bugfix: libxml: FOR UTF-8 TOO russian letters in attributes or documents-results of transform now not xx; * src/classes/xnode.C: memleaks found: not fixed yet. todo * src/main/pa_charset.C: bugfix: forgot to undo some * src/main/pa_charset.C: beauty: uncomment PA_PATCHED_LIBXML_BACKWARD to link with old patched libxml libraries 2004-02-02 paf * src/types/pa_vcookie.C: bugfix: erasing cookie: params now output $cookie:example[ $.value[value] $.path[/there/] ] $cookie:example[ $.value[] $.expires[session] $.path[/there/] $.domain[test.com] ] * src/types/pa_vform.C: bugfix: empty values with enctype=multipart/form-data now produce entries in $form:tables
$k[^form:fields._keys[]] ^eval($k)
$request:body

2004-01-30  paf

	* src/classes/xdoc.C: bugfix: libxml: russian letters in attributes
	  or documents-results of transform now not xx;

	* src/classes/date.C: bugfix: ^date::create[invalid fields now
	  produce exception.

	* src/: classes/date.C, include/pa_string.h, main/pa_string.C:
	  bugfix: ^date::create[invalid fields now produce exception.

	* ChangeLog, src/classes/date.C, www/htdocs/.htaccess: bugfix:
	  ^date::create[invalid year] now produces exception. todo: check
	  other fields

2004-01-29  paf

	* src/include/pa_memory.h: typo error

	* src/include/pa_memory.h: bugfix: [potential] strdup copied one
	  more byte then specified, then zeroed it << useless and
	  potentially harmful(could gpf)

2004-01-22  paf

	* src/classes/xdoc.C: bugfix: when stylesheet contains error, gpf

	* src/main/untaint.C: merged: bugfix from 3.1.1 on whitespace
	  optimization

	* src/main/untaint.C: bugfix: whitespace now optimized properly
	  [were bug: ^taint[1 & 2]="1 &2"

	* src/main/pa_globals.C: beauty: bigger buffer for xml-related
	  errors

	* src/main/pa_common.C: merged: bugfix from 3.1.1 on memory
	  overflow

	* src/main/pa_common.C: bugfix: buffer overflow * in libxml&xsl
	  error-reporting code * in parser-error reporting code [when no
	  @unhandled_exception defined]

	  fixed in one place: my *snprintf override

2004-01-13  paf

	* operators.txt: typo erro

2003-12-25  paf

	* src/main/pa_common.C: bugfix: ^file::load[binary;http:// now not
	  garbled  [pieces after zero bytes were removed]

2003-12-22  paf

	* src/include/Makefile.am: bugfix: removed from dist:
	  src/include/pa_config_auto.h which were configured for
	  make-dist-platform and badly updated proper config file in target
	  [when .tar used for updating existing source tree]

	* ChangeLog, operators.txt, src/classes/op.C,
	  src/include/pa_sql_connection.h,
	  src/include/pa_sql_driver_manager.h,
	  src/main/pa_sql_driver_manager.C, src/sql/pa_sql_driver.h,
	  www/htdocs/.htaccess: feature: sql introducing ability to
	  transcode charsets

2003-12-19  paf

	* src/main/pa_sql_driver_manager.C: beauty: more straighforward
	  error message

	* src/main/pa_charset.C: bugfix: memory for charsethandler
	  structure for libxml now allocated properly

2003-12-17  paf

	* src/types/pa_vfile.C: beauty: removed outdated cast

	* src/main/pa_common.C: bugfix: empty http response caused gpf

	* src/include/pa_string.h: bugfix: removed too strong a assert

	* src/main/pa_globals.C: bugfix: removed false warning [warning:
	  unreported xmlGenericErrors]

2003-12-15  paf

	* src/classes/xdoc.C: bugfix: taint uri under ^xdoc::create{now
	  works}

2003-12-11  paf

	* operators.txt, src/types/pa_vstatus.C:     !$status:pid process
	  id
	      !$status:tid thread id

	* src/: include/pa_cache_managers.h, main/pa_cache_managers.C,
	  main/pa_globals.C, main/pa_request.C, types/pa_vstatus.C:
	  bugfix(solaris): removed dependency on object initialization
	  order [one more place]

	* src/: classes/file.C, classes/mail.C, classes/op.C,
	  classes/xdoc.C, main/pa_request.C, types/pa_vimage.C,
	  types/pa_vmath.C, types/pa_vstatus.C: beauty cancel: gcc does not
	  understand that

	* src/: classes/file.C, classes/mail.C, classes/op.C,
	  classes/xdoc.C, include/pa_cache_managers.h,
	  include/pa_sql_connection.h, include/pa_sql_driver_manager.h,
	  include/pa_stylesheet_manager.h, main/pa_request.C,
	  main/pa_stylesheet_manager.C, types/pa_vimage.C,
	  types/pa_vmath.C, types/pa_vstatus.C: beauty: removed redundant
	  ctor call [relying on implicit String::Body(cstr) call]

	* src/main/: pa_cache_managers.C, pa_sql_driver_manager.C,
	  pa_stylesheet_manager.C: bugfix(solaris): removed dependency on
	  object initialization order [two places]

2003-12-10  paf

	* src/include/pa_sql_connection.h, www/htdocs/.htaccess: bugfix:
	  $status:sql.cache back  << time now ok

	* operators.txt, src/main/pa_sql_driver_manager.C,
	  src/main/pa_stylesheet_manager.C: $status:stylesheet.cache back
	  operational

	* ChangeLog, operators.txt, src/classes/xdoc.C,
	  src/include/pa_charset.h, src/include/pa_sql_connection.h,
	  src/main/pa_charset.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/types/pa_vxdoc.h, www/htdocs/.htaccess:
	  $status:sql.cache back operational

2003-12-02  paf

	* src/types/pa_vmail.C: bugfix:
	  ^mail:send[$.file[$.value[>>xxxx<<]] now untaints properly [were:
	  as-is forced]

	* src/main/pa_xml_io.C: bugfix: on some platforms one can't throw
	  exceptions out of libxml callbacks: reimplemented error handling
	  of http://localhost, parser://method and safemode check callbacks

	* src/main/pa_string.C: bugfix: SPARC gpf on %4!=0 address int ref
	  [merged from HEAD]

	* src/classes/image.C: nothing: comment removed

	* src/main/pa_string.C: bugfix: sparc gpf on reading %4!=0
	  addresses to int

2003-12-01  paf

	* src/main/pa_xml_io.C: bugfix: typo

	* src/main/pa_globals.C: bugfix: win32: compile prob

	* src/classes/xdoc.C: bugfix: typo

	* src/main/pa_xml_io.C: todo: safe mode check not to throw
	  exception

	* src/main/pa_xml_io.C: bugfix: http://localhost typo error

2003-11-28  paf

	* src/main/pa_xml_io.C: installed safe-mode checker as filter of
	  all xml documents read

	* src/main/pa_xml_io.C: http://localhost/ now checked for safe mode

	* src/: classes/xdoc.C, include/pa_stylesheet_connection.h,
	  include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C:
	  replaced original open mech of xdoc::create & co to use libxml
	  open, so that this would work for root document todo: safe mode
	  checks to libxml: ideally to some 1 point

	* src/main/pa_xml_io.C: comment

	* operators.txt, src/main/pa_xml_io.C: leading / in
	  http://parser[abscent params]

	* operators.txt, src/include/pa_request.h, src/main/pa_xml_io.C:
	  works.  todo: maybe replace original open mech of xdoc::create &
	  co to use libxml open, so that this would work for root document

	  $xdoc[^xdoc::create{     &test^;  }]

	  ^taint[^xdoc.string[]]

	  @method[param] 

2003-11-27  paf

	* src/main/pa_xml_io.C: libxml: started parser://methodcall/params

	* src/classes/date.C: bugfix: typo error

2003-11-26  paf

	* operators.txt, src/include/Makefile.am, src/include/pa_globals.h,
	  src/main/Makefile.am, src/main/main.vcproj,
	  src/main/pa_globals.C, src/main/pa_request.C,
	  src/include/pa_xml_io.h, src/main/pa_xml_io.C: simplification:
	  xml errors to hash reorganization: xml io moved
	  to pa_xml_io.C/h

	* src/types/pa_value.h: warnings: --

2003-11-25  paf

	* src/classes/table.C: bugfix: wrong sequence. [sadly no waring
	  whatever)

	* src/classes/table.C: bugfix: a, c?x:y, z in gcc considered(?) as
	  a, (c?x:y, z)

	* src/main/untaint.C: bugfix: consequences of not reading this
	  comment: CORD_pos_chars_left /* Number of characters in cache.
	  <= 0 ==> none    */

	* src/include/pa_array.h: removed needless checks

2003-11-24  paf

	* src/: main/pa_request.C, types/pa_vform.C, types/pa_vform.h:
	  removed limit: now $form:xxx can be accessed anytime, even in
	  @auto/conf [and request/response:charset still can be changed
	  anytime]

	* src/main/pa_common.C: bugfix: ^file::load[binary;http://...]
	  now not transcodes response body

	* operators.txt, src/types/pa_vxnode.C, src/types/pa_vxnode.h:
	  $xdoc[^xdoc::create[test]] $tn[^xdoc.createTextNode[text node
	  value]] $dummy[^xdoc.firstChild.appendChild[$tn]]
	  $xdoc.firstChild.firstChild.nodeValue[different]
	  ^taint[^xdoc.string[]]

	* src/: include/pa_hash.h, types/types.vcproj: linker HPUX nongnu
	  workaround: static Hash::allocates -> static Hash_allocates

2003-11-21  paf

	* Makefile.am, configure, configure.in, src/classes/Makefile.am,
	  src/include/pa_config_auto.h.in, src/targets/cgi/Makefile.am,
	  src/types/Makefile.am: rearrange: gd&smtp moved to src/lib

	* src/classes/classes.vcproj: rearrange: gd&smtp moved to src/lib

	* src/classes/mail.C: bugfix: typo

	* parser3.sln, src/classes/Makefile.am, src/lib/Makefile.am,
	  src/lib/gd/Makefile.am, src/lib/gd/gd.vcproj, src/lib/gd/gif.C,
	  src/lib/gd/gif.h, src/lib/gd/gifio.C, src/lib/gd/mtables.h,
	  src/lib/smtp/Makefile.am, src/lib/smtp/comms.C,
	  src/lib/smtp/smtp.C, src/lib/smtp/smtp.h,
	  src/lib/smtp/smtp.vcproj: rearrange: gd&smtp moved to src/lib

	* src/main/pa_exec.C: bug in safe mode

	* src/include/Makefile.am: pa_xml_exception.h

	* src/targets/isapi/parser3isapi.C: more warnings --

2003-11-20  paf

	* src/: classes/math.C, classes/op.C, classes/string.C,
	  main/pa_charset.C, main/pa_dictionary.C, main/pa_string.C,
	  types/pa_value.C, main/pa_dir.C, main/pa_table.C: more warnings
	  --

	* src/: main/pa_charset.C, main/pa_string.C, types/pa_vxnode.C:
	  more warnings --

	* src/classes/xdoc.C: more warnings --

	* src/classes/: date.C, image.C, xdoc.C: more warnings --

	* src/: main/pa_sql_driver_manager.C, main/untaint.C,
	  types/pa_vcookie.C, types/pa_vmail.C: more warnings --

	* src/: classes/date.C, classes/file.C, classes/hash.C,
	  classes/image.C, classes/mail.C, classes/op.C, classes/string.C,
	  classes/table.C, include/pa_cache_managers.h,
	  include/pa_stylesheet_connection.h, main/pa_request.C,
	  types/pa_vdate.h, types/pa_vhashfile.C, types/pa_vimage.h,
	  types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: more warnings
	  --

	* src/main/: execute.C, pa_request.C: old forgotten todo: when
	  can't report problem (undefined @unhandled_exception) problem
	  source string were not reported

	* src/: classes/classes.C, classes/classes.h, classes/date.C,
	  classes/double.C, classes/file.C, classes/form.C, classes/hash.C,
	  classes/hashfile.C, classes/image.C, classes/int.C,
	  classes/mail.C, classes/math.C, classes/memory.C, classes/op.C,
	  classes/response.C, classes/string.C, classes/table.C,
	  classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h,
	  include/pa_array.h, include/pa_cache_managers.h,
	  include/pa_charset.h, include/pa_charsets.h, include/pa_common.h,
	  include/pa_config_fixed.h, include/pa_dictionary.h,
	  include/pa_dir.h, include/pa_exception.h, include/pa_exec.h,
	  include/pa_globals.h, include/pa_hash.h, include/pa_memory.h,
	  include/pa_opcode.h, include/pa_operation.h, include/pa_os.h,
	  include/pa_request.h, include/pa_request_charsets.h,
	  include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h,
	  include/pa_sql_connection.h, include/pa_sql_driver_manager.h,
	  include/pa_stack.h, include/pa_string.h,
	  include/pa_stylesheet_connection.h,
	  include/pa_stylesheet_manager.h, include/pa_table.h,
	  include/pa_threads.h, include/pa_types.h, include/pa_uue.h,
	  include/pa_xml_exception.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c,
	  lib/sdbm/apr_file_io.C, lib/sdbm/apr_strings.C, main/compile.C,
	  main/compile_tools.C, main/compile_tools.h, main/execute.C,
	  main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C,
	  main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C,
	  main/pa_exception.C, main/pa_exec.C, main/pa_globals.C,
	  main/pa_memory.C, main/pa_os.C, main/pa_pool.C,
	  main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C,
	  main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C,
	  main/pa_uue.C, main/pa_xml_exception.C, main/untaint.C,
	  sql/pa_sql_driver.h, targets/cgi/pa_threads.C,
	  targets/cgi/parser3.C, targets/isapi/pa_threads.C,
	  targets/isapi/parser3isapi.C, types/pa_junction.h,
	  types/pa_method.h, types/pa_value.C, types/pa_value.h,
	  types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h,
	  types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C,
	  types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h,
	  types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h,
	  types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h,
	  types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C,
	  types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h,
	  types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C,
	  types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C,
	  types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h,
	  types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C,
	  types/pa_vresponse.h, types/pa_vstateless_class.C,
	  types/pa_vstateless_class.h, types/pa_vstateless_object.h,
	  types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C,
	  types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h,
	  types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h,
	  types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C,
	  types/pa_wcontext.h, types/pa_wwrapper.h: static const char *
	  const IDENT

	* src/: include/pa_array.h, include/pa_pool.h,
	  include/pa_request.h, include/pa_string.h, include/pa_table.h,
	  main/compile_tools.h, main/pa_common.C, types/pa_vhash.h,
	  types/pa_wcontext.h: more warnings --

	* src/: classes/classes.vcproj, classes/date.C, classes/double.C,
	  classes/file.C, classes/hash.C, classes/hashfile.C,
	  classes/image.C, classes/int.C, classes/mail.C, classes/math.C,
	  classes/memory.C, classes/op.C, classes/string.C,
	  classes/table.C, classes/xdoc.C, classes/xnode.C,
	  include/pa_config_includes.h, include/pa_operation.h,
	  include/pa_sql_connection.h, include/pa_table.h,
	  include/pa_types.h, lib/ltdl/config_fixed.h,
	  lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/pcre/maketables.c,
	  lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj,
	  lib/sdbm/apr_file_io.C, main/compile.tab.C, main/execute.C,
	  main/main.vcproj, main/pa_cache_managers.C, main/pa_charset.C,
	  main/pa_common.C, main/pa_dir.C, main/pa_exec.C,
	  main/pa_globals.C, main/pa_os.C, main/pa_request.C,
	  main/pa_string.C, main/pa_table.C, targets/cgi/parser3.vcproj,
	  targets/isapi/parser3isapi.vcproj, types/pa_value.h,
	  types/pa_vconsole.h, types/pa_vdate.h, types/pa_vfile.h,
	  types/pa_vhashfile.C, types/pa_vimage.C, types/pa_vimage.h,
	  types/pa_vmail.C, types/pa_vobject.C,
	  types/pa_vstateless_class.h, types/pa_vtable.C,
	  types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h,
	  types/pa_vxnode.h, types/types.vcproj: turned on warnings level4
	  on all projects (except libltdl=off & libsdbm=level3) found
	  several unitialized vars

2003-11-19  paf

	* src/classes/op.C: more ansi C++ comp

	* operators.txt, src/classes/op.C, src/include/pa_request.h,
	  src/main/pa_request.C: ^cache[...]{body}{catch block with
	  $exception.handled[cache] meaning "get expired cache, if any.
	  else error"}

	* src/: classes/op.C, include/pa_os.h, include/pa_request.h,
	  main/pa_common.C: cache: ^cache[] fallback todo: kinda ^try:
	  ^cache[...]{body}{catch code with $exception.cache field}

2003-11-12  paf

	* src/classes/xnode.C: replaceChild: 2nd param now named oldChild
	  [copy/paste bug]

2003-11-11  paf

	* src/types/: pa_value.h, pa_vfile.h: more C++ compatible [HP C++
	  failed]

	* bin/auto.p.dist.in: colno

2003-11-10  paf

	* src/types/pa_vconsole.h: flush

	* operators.txt, src/main/pa_request.C, src/types/Makefile.am,
	  src/types/types.vcproj, src/types/pa_vconsole.h: $console:line
	  read/write  [for nntp]

	* operators.txt: mysql: transaction support: ?autocommit=0

	* operators.txt: comment: updated

	* src/types/: pa_vhashfile.C, pa_vhashfile.h: add: hashfile old
	  serialize version and exipire now removes entries

	* operators.txt: ^hashfile.delete[] removes files altogether [and
	  dir, if could]

	* src/: classes/hashfile.C, include/pa_common.h, main/pa_common.C,
	  types/pa_vhashfile.C, types/pa_vhashfile.h: ^hashfile.delete[]
	  removes files altogether [and dir, if could]

	* src/lib/sdbm/sdbm.c: bugfix: sdbm: .h said it's OK to remove
	  nonexistent pair. .c coded that that was error. fixed

	* src/types/pa_vhashfile.C: sdbm: exception type change to
	  file.access [regretfull can't split it to different exceptions
	  without modifying sdbm source wich would prefer not to]

2003-11-07  paf

	* src/: classes/date.C, classes/file.C, classes/hash.C,
	  classes/hashfile.C, classes/image.C, classes/table.C,
	  classes/xdoc.C, include/Makefile.am, include/pa_array.h,
	  include/pa_pool.h, include/pa_request.h, main/Makefile.am,
	  main/execute.C, main/main.vcproj, main/pa_pool.C,
	  main/pa_request.C, targets/cgi/parser3.C, types/pa_vclass.C,
	  types/pa_vclass.h, types/pa_vhashfile.h, types/pa_vobject.h,
	  types/pa_vstateless_class.h: resurrected: pool idea. now only for
	  destructing objects at request processing end

2003-11-06  paf

	* src/: classes/Makefile.am, types/Makefile.am: .am sdbm INCLUDES
	  updates

	* parser3.sln, src/targets/cgi/Makefile.am: .vcproj & .am updated
	  to include sdbm

	* src/include/: pa_config_includes.h, pa_version.h: our
	  replacements of max& co only for cpp

	* src/lib/sdbm/: Makefile.am, apr_file_io.C, apr_strings.C: move to
	  upper dir, .am updated

	* tests/todo.txt: hashfile: done

	* operators.txt, src/types/pa_vhashfile.C: hashfile: clear &
	  expiration [time in value. todo: move time to key]

	* src/types/pa_vhashfile.C: hashfile: foreach body can bodify $self

	* src/types/pa_vhashfile.C: hashfile: clear now works [were trying
	  to do that in foreach, no errors, but surely wrong]

	* operators.txt, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h: hashfile: clear and proper locking

	* operators.txt, src/classes/hash.C, src/classes/hashfile.C,
	  src/types/pa_vhashfile.C, src/types/pa_vhashfile.h: hashfile:
	  foreach

	* src/classes/hashfile.C, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h, operators.txt: hashfile: hash

	* operators.txt, src/classes/hashfile.C, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h, tests/todo.txt: hashfile: delete

	* src/include/pa_memory.h, src/targets/cgi/parser3.C,
	  src/types/pa_value.C, src/types/pa_value.h,
	  src/types/pa_vcookie.C, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h, www/htdocs/.htaccess: hashfile
	  implemented get/put [raw]

	* src/: classes/op.C, main/pa_os.C: just linked

	* src/: classes/xdoc.C, classes/xnode.C, types/pa_vxnode.h:
	  XmlException changes

	* src/: include/pa_charset.h, include/pa_globals.h,
	  include/pa_stylesheet_connection.h, main/pa_exception.C:
	  XmlException changes

	* src/lib/sdbm/: sdbm.c, sdbm.vcproj: just compiled

	* src/: include/pa_common.h, include/pa_exception.h,
	  main/main.vcproj, main/pa_common.C, include/pa_os.h,
	  include/pa_xml_exception.h, main/pa_os.C, lib/sdbm/sdbm.vcproj,
	  main/pa_xml_exception.C: locking move to pa_os [along with
	  pa_sleep] apr-impl locking done

	* configure, configure.in, operators.txt, parser3.sln,
	  src/classes/classes.vcproj, src/classes/hashfile.C,
	  src/classes/xdoc.C, src/include/pa_config_fixed.h,
	  src/include/pa_exception.h, src/include/pa_globals.h,
	  src/include/pa_memory.h, src/include/pa_version.h,
	  src/lib/ltdl/libltdl.vcproj, src/lib/ltdl/libltdl.vcproj.vspscc,
	  src/lib/ltdl/ltdl.vcproj, src/lib/ltdl/ltdl.vcproj.vspscc,
	  src/main/compile.tab.C, src/main/main.vcproj,
	  src/main/pa_charset.C, src/targets/cgi/parser3.vcproj,
	  src/types/Makefile.am, src/types/pa_vhash.C,
	  src/types/pa_vhashfile.C, src/types/pa_vhashfile.h,
	  src/types/pa_vxnode.h, src/types/types.vcproj,
	  www/htdocs/.htaccess: hashfile: started again with sdbm from
	  apache

2003-11-05  paf

	* src/: classes/classes.vcproj, include/pa_config_fixed.h,
	  main/main.vcproj, targets/cgi/parser3.vcproj: not has to be in
	  \parser3project dir anymore

	* src/main/pa_charset.C: bugfix: had broken binary search [copied
	  thoughtlessly from xalan]

	* src/lib/sdbm/: Makefile.am, sdbm.c, sdbm_hash.c, sdbm_lock.c,
	  sdbm_pair.c, sdbm_pair.h, sdbm_private.h, sdbm_tune.h: original
	  from httpd-2.0.43\srclib\apr-util\dbm\sdbm

	* src/main/helpers/CaseFolding.txt:
	  http://www.unicode.org/Public/UNIDATA/CaseFolding.txt

2003-11-04  paf

	* operators.txt: comment: ^mail:send[$.options[

	* src/classes/table.C: compiled on unix

	* src/classes/Makefile.am: classes.C to rebuild last

	* src/classes/mail.C: compiled on unix

	* operators.txt, src/classes/mail.C, src/types/pa_vmail.C,
	  src/types/pa_vmail.h:     !^mail:send[
		  $.options[unix: string to append to sendmail command
	  line]

	* operators.txt, src/classes/table.C, src/main/pa_string.C,
	  tests/todo.txt: ^table.save[...	   $.separator[^#09]
	  $.encloser["]  by default

	* operators.txt, src/classes/table.C, tests/todo.txt: ^table::load
		 !$.separator[^#09]	    !$.encloser["]  by
	  default

2003-11-03  paf

	* operators.txt, src/classes/table.C, src/main/pa_common.C:
	  ^table::load[; options:	  !$.column-separator[^#09]
	  !$.column-encloser["]

	* operators.txt, src/include/pa_config_fixed.h,
	  src/types/pa_vrequest.C: $request:document-root

	* src/targets/cgi/parser3.C: beauty: SIGUSRX removed qs= printing
	  [already included into uri=xxx]

	* operators.txt, src/classes/image.C, tests/todo.txt,
	  www/htdocs/auto.p: ^image.gif[filename] for $response:download

	* src/classes/date.C: minor precaution

	* operators.txt, src/classes/date.C:	 !^date::unix-timestamp()
	      !^date.unix-timestamp[]

2003-10-30  paf

	* operators.txt, src/classes/date.C, src/types/pa_vdate.h: merged
	  from 3.0.8: ^date.roll[TZ;GMT] $date.hour

	* src/classes/: date.C, image.C: improvement diagnostics:
	  $now[^date::create[$undefined]] now is error

	* src/main/pa_common.C: read errors would now be reported 'actually
	  read -1 bytes'

2003-10-24  paf

	* Makefile.am, src/classes/Makefile.am, src/lib/cord/Makefile.am,
	  src/lib/md5/Makefile.am, src/lib/pcre/Makefile.am,
	  src/main/Makefile.am, src/targets/cgi/Makefile.am,
	  src/targets/isapi/Makefile.am: .dsp/w -> .vcproj/sln

2003-10-22  paf

	* src/include/pa_request.h: fixed: $h[^hash::create[]] $$h[1]

2003-10-21  paf

	* operators.txt, src/include/pa_string.h, src/main/pa_string.C:
	  fixed: string.match[g] without <'> option produced columns with
	  NULL's, which gpf'ed at table.save time

	* src/: classes/op.C, include/pa_request.h: fixed: false 'endless
	  recoursion' message with intensive throw-catches fixed: incorrect
	  name and line (one name upper then needed) in error message about
	  problems inside try block

2003-10-10  paf

	* src/include/pa_string.h, src/main/compile.tab.C,
	  www/htdocs/.htaccess: CORD_chr does not check offset argument for
	  validity did that in String::Body::pos myself
	  http://i2/tasks/edit/?id=4577425257580789777

2003-10-07  paf

	* src/main/: compile.tab.C, compile.y: ^if ( better error:
	  .html(1:4): parse error, expecting `'['' or `'{'' or `'(''  now

2003-10-03  paf

	* parser3.sln, src/include/pa_dictionary.h,
	  src/main/pa_dictionary.C, src/main/pa_string.C,
	  src/targets/cgi/parser3.vcproj, www/htdocs/.htaccess: dictionary
	  optimized by precalculating cstr&length

2003-10-02  paf

	* src/classes/op.C, src/include/pa_request.h,
	  src/include/pa_stack.h, src/main/execute.C,
	  src/main/pa_request.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_stylesheet_manager.C, www/htdocs/.htaccess: bugfix:
	  ^throw context were saved/restored incompletely
	  http://www.parser.ru/forum/?id=21484

2003-09-30  paf

	* src/main/pa_string.C: string::replace bug fix [were ignoring
	  occurrances after lang-mismatched

2003-09-29  paf

	* src/main/: utf8-to-lower.inc, utf8-to-upper.inc: generated by
	  helper

	* src/main/pa_string.C: string::serialize bug fix with
	  zero-terminator

	* src/classes/table.C: ^nameless_table.save column row now has no
	  \t at the end

	* src/: include/pa_request.h, main/execute.C, main/pa_request.C:
	  @postprocess	now takes $response:body/download

	* src/classes/form.C: better error message: MAX_POST_SIZE_NAME to
	  error message

	* src/classes/string.C: bugfix: s.right(>s.length) returned nothing

	* src/classes/table.C: bugfix: flip: must produce nameless
	  http://i2/tasks/edit/?id=4573405524674081244

	* www/htdocs/: base.p, derived.p, font.gif, global.xsl, index.html,
	  mailreceive.eml, mailreceive.html, operators.p,
	  parser-status.html, people.dtd, some.p: removing old tests

	* src/include/pa_charset.h, src/main/pa_charset.C,
	  src/main/pa_string.C, src/main/helpers/simple_folding.pl,
	  www/htdocs/auto.p: utf-8 upper/lower

	* src/main/pa_common.C: bugfix: utf signature were not ignored due
	  to typo error http://i2/tasks/edit/?id=4573354650786434584

2003-09-26  paf

	* src/main/untaint.C: removed needless field

	* src/main/untaint.C: removed needless const

	* src/include/pa_string.h, src/main/pa_common.C,
	  src/main/pa_string.C, www/htdocs/.htaccess: String.for_each bug
	  fixed [omited one-char cases]

	* src/include/pa_stack.h: bugfix: before collecting garbage,
	  runtime-executor stack were cleared... BADLY

	* src/main/pa_string.C, www/htdocs/.htaccess, www/htdocs/auto.p:
	  ^stirng.replace code used old param-convention on langs.append,
	  fixed that search fo the like, found none

	* src/classes/op.C, src/include/pa_string.h, src/main/pa_string.C,
	  www/htdocs/.htaccess: string::serialize/deserialize implemented
	  Language enum assigned meaningful letters [more convinient for
	  debugging. read warning before adding/changing anything]

2003-09-25  paf

	* src/: include/pa_string.h, include/pa_version.h,
	  main/pa_string.C, main/untaint.C: templates and anonymous unions
	  differences on unix

	* parser3.sln, src/classes/file.C, src/classes/image.C,
	  src/classes/mail.C, src/classes/op.C, src/classes/table.C,
	  src/classes/xdoc.C, src/classes/xnode.C,
	  src/include/pa_cache_managers.h, src/include/pa_charset.h,
	  src/include/pa_charsets.h, src/include/pa_common.h,
	  src/include/pa_request.h, src/include/pa_sql_driver_manager.h,
	  src/include/pa_string.h, src/include/pa_stylesheet_manager.h,
	  src/include/pa_table.h, src/lib/cord/cordbscs.c,
	  src/lib/cord/cordprnt.c, src/lib/cord/cordxtra.c,
	  src/lib/cord/include/cord.h, src/main/compile.tab.C,
	  src/main/compile_tools.h, src/main/pa_charset.C,
	  src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_exec.C,
	  src/main/pa_request.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/main/pa_stylesheet_manager.C,
	  src/main/untaint.C, src/types/pa_value.h, src/types/pa_vimage.C,
	  src/types/pa_vmail.C, src/types/pa_vmath.C,
	  src/types/pa_vstateless_class.h, src/types/pa_vstatus.C,
	  src/types/pa_vxnode.C, www/htdocs/.htaccess:
	  string_fragments_to_cord merged to HEAD

	* src/main/: compile.tab.C, pa_string.C: string: debug: .v()
	  functions aligned to that of eeparser3 look

	* src/lib/cord/cordprnt.c: removed warnings

2003-09-24  paf

	* src/: classes/file.C, classes/image.C, classes/mail.C,
	  classes/op.C, classes/xdoc.C, classes/xnode.C,
	  include/pa_cache_managers.h, include/pa_charset.h,
	  include/pa_charsets.h, include/pa_common.h, include/pa_request.h,
	  include/pa_sql_driver_manager.h, include/pa_string.h,
	  include/pa_stylesheet_manager.h, include/pa_table.h,
	  main/compile_tools.h, main/pa_charset.C, main/pa_charsets.C,
	  main/pa_common.C, main/pa_exec.C, main/pa_request.C,
	  main/pa_sql_driver_manager.C, main/pa_string.C,
	  main/pa_stylesheet_manager.C, main/untaint.C, types/pa_value.h,
	  types/pa_vimage.C, types/pa_vmail.C, types/pa_vmath.C,
	  types/pa_vstateless_class.h, types/pa_vstatus.C,
	  types/pa_vxnode.C: v() functions of String::Body,
	  String::Languages and String itself StringBody->String::Body

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/include/cord.h: CORD_append_block showed no efficiency =
	  never optimized anything.  todo: somehow speed up harder cases:
	  concatenationA+concatenationB when last block of A and first of B
	  contain same letters

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/include/cord.h: langs: speed up by joining adjucent
	  blocks of same char [CORD_append_block]

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/include/cord.h, main/pa_string.C: aval/ works! todo:
	  save space by extending blocks when appending block with c ==
	  lastblock.c

	* src/: include/pa_string.h, main/pa_string.C: aval is not actually
	  working yet :( but more working &understood :)

	* src/: classes/table.C, include/pa_string.h,
	  lib/cord/include/cord.h, main/pa_string.C: aval/ works!

2003-09-23  paf

	* src/main/untaint.C: $a[ok!] $a works!

	* src/main/untaint.C: something even more works :)

	* src/: include/pa_string.h, main/pa_string.C, main/untaint.C:
	  something more works :)

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/cordxtra.c: something already works :)

	* src/: include/pa_string.h, main/untaint.C: just compiled todo:
	  serialize&deserialize

	* src/: classes/table.C, include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/cordxtra.c, lib/cord/include/cord.h, main/pa_string.C,
	  main/untaint.C: main idea implemented, details left

2003-09-22  paf

	* src/: classes/memory.C, include/pa_memory.h: #ifdef GC_DEBUG

	* src/classes/xnode.C: copy/paste comment bugfix

	* src/: include/pa_memory.h, main/pa_globals.C: when xml memory
	  allocator returns 0, just die.
	  http://i2/tasks/edit/?id=4570798492410259445

	* src/classes/xdoc.C: copy/paste comment bugfix

	* src/classes/: xdoc.C, xnode.C: new DOM2 methods from Alexandr
	  Egorov  (all?) xdoc: createAttributeNS createElementNS
	  xnode: getAttributeNS setAttributeNS removeAttributeNS
	  getAttributeNodeNS setAttributeNodeNS hasAttribute hasAttributeNS

	* src/lib/cord/cordxtra.c: CORD_pos bugfix [failed to find 8bit
	  chars due to bitwise operation signed-char error]

2003-09-19  paf

	* src/types/pa_wcontext.C: output message: more practical
	  suggestion

	* src/main/pa_common.C, operators.txt: merged
	  $f[^file::load[binary;http://...]] $f.tables

2003-09-02  paf

	* src/main/pa_common.C: printf is buffered, write(1 is not. can't
	  flush stdout without referencing 'stdout' symbol. to hell with
	  non-ansi libraries without 'stdout' symbol

	* src/main/pa_common.C: got rid of 'stdout' symbol reference on
	  unix (users reported problems with some old libc)

	* src/types/pa_vdate.h: forgot initializer

2003-09-01  paf

	* src/: classes/date.C, include/pa_common.h, main/compile.tab.C,
	  main/pa_common.C, types/pa_vdate.h: $date.TZ ^date.roll[TZ;new
	  zone]

	* src/classes/image.C: memory handling bugs [unpatched 'new' calls]

2003-08-19  paf

	* src/types/: pa_value.C, pa_value.h, pa_vdate.h, pa_vrequest.C,
	  pa_vstring.h, pa_vxdoc.C, pa_vxnode.C: bark intefrace obsoleted,
	  simplified a little

	* src/types/: pa_vhash.C, pa_vhash.h: _default+foreach bug refix
	  [lost fix from 3.0.8]

	* src/types/pa_vcookie.C: in VC7 if(type var=xxx){ }else{   now
	  visible here }

	  bug fix

	* src/: include/pa_memory.h, types/pa_value.h: -= few warnings

	* src/main/compile.tab.C: initialized couple of variables about
	  which user reported runtime problems when parser were compiled
	  with VC7, warning level4.  study shows that later in bison
	  they've fixed that. would migrate to latest bison someday

	* src/types/pa_vmail.C: turned	off recoding in gmime (were still
	  recoding headers)

	* src/types/pa_vmail.C: works as before, same charset problems:
	  gmime recodes to UTF-8 only headers, not body. so not recoding
	  anything for now

	* src/types/: pa_vmail.C, pa_vmail.h: parses headers, still
	  problems with body

	* src/types/pa_vmail.C: mail_receive just compiled

2003-08-18  paf

	* src/: classes/classes.vcproj, include/pa_config_fixed.h,
	  main/main.vcproj, types/types.vcproj: win32: continued process
	  detaching from \parser3project directory

	* gnu.dsp, parser3.dsw, src/classes/classes.dsp,
	  src/lib/cord/cord.dsp, src/lib/ltdl/libltdl.dsp,
	  src/lib/md5/md5.dsp, src/lib/pcre/pcre.dsp,
	  src/lib/pcre/pcre_dftables.dsp,
	  src/lib/pcre/pcre_parser_ctype.dsp, src/main/main.dsp,
	  src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.dsp,
	  src/types/types.dsp: moved to MSVC 7

	* gnu.vcproj.vspscc, parser3.vssscc,
	  src/classes/classes.vcproj.vspscc,
	  src/lib/cord/cord.vcproj.vspscc,
	  src/lib/ltdl/libltdl.vcproj.vspscc,
	  src/lib/md5/md5.vcproj.vspscc,
	  src/lib/pcre/pcre_dftables.vcproj.vspscc,
	  src/lib/pcre/pcre_parser_ctype.vcproj.vspscc,
	  src/lib/pcre/pcre.vcproj.vspscc, src/main/main.vcproj.vspscc,
	  src/targets/isapi/parser3isapi.vcproj.vspscc,
	  src/types/types.vcproj.vspscc, src/targets/cgi/parser3.vcproj:
	  moved to MSVC 7

	* parser3.sln, gnu.vcproj, src/classes/classes.vcproj,
	  src/lib/cord/cord.vcproj, src/lib/ltdl/libltdl.vcproj,
	  src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj,
	  src/lib/pcre/pcre_dftables.vcproj,
	  src/lib/pcre/pcre_parser_ctype.vcproj, src/main/main.vcproj,
	  src/targets/cgi/parser3.vcproj,
	  src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj:
	  new VS project files

	* ~sak5c961f3101c36563.tmp: Temporary file created by Visual Studio
	  .NET to detect Jalindi Igloo capabilities.

	* ChangeLog, configure, configure.in, src/classes/Makefile.am,
	  src/classes/classes.awk, src/doc/footer.htm,
	  src/include/pa_config_fixed.h, src/include/pa_version.h,
	  src/lib/Makefile.am, src/main/compile.tab.C,
	  src/main/pa_charset.C, src/main/pa_string.C, src/main/untaint.C,
	  src/types/pa_vmail.C, www/htdocs/.htaccess, www/htdocs/auto.p:
	  merged 3.1.0 latest changes

2003-08-15  paf

	* src/main/untaint.C: email addresses in forms:   "non-ascii" 
	  non-ascii  now encoded correctly [kinda merge from 3.0.8]

	* src/main/untaint.C: email addresses in forms:   "non-ascii" 
	  non-ascii  now encoded correctly

2003-07-29  paf

	* src/classes/: Makefile.am, classes.awk: classes.awk added to make
	  dist

	* src/types/pa_vmail.C: just started --with-mail-receive

2003-07-28  paf

	* src/: classes/Makefile.am, lib/Makefile.am: removed circular
	  dependence in src/classes, src/lib/gc now in dist

	* src/main/pa_string.C: ^cache bug fix [were not working at all]

2003-07-25  paf

	* src/doc/footer.htm: year

2003-07-24  paf

	* src/: include/pa_config_fixed.h, main/pa_charset.C: bad #endif
	  fix

	* src/include/pa_version.h: release

	* src/lib/gc/include/: Makefile.am, gc.h: moved tempate_gc to HEAD

	* ChangeLog, src/classes/classes.dsp, src/main/main.dsp,
	  src/main/pa_globals.C, src/targets/cgi/parser3.dsp,
	  src/targets/isapi/parser3isapi.dsp, src/types/types.dsp: cvs:
	  getting rid of win32xml pseudo project

	* src/main/: compile.tab.C, pa_memory.C: moved tempate_gc to HEAD

	* ChangeLog, INSTALL, Makefile.am, acsite.m4, configure,
	  configure.in, operators.txt, parser3.dsw,
	  etc/parser3.charsets/koi8-r.cfg,
	  etc/parser3.charsets/windows-1251.cfg, src/classes/Makefile.am,
	  src/classes/classes.C, src/classes/classes.awk,
	  src/classes/classes.dsp, src/classes/classes.h,
	  src/classes/date.C, src/classes/double.C, src/classes/file.C,
	  src/classes/form.C, src/classes/hash.C, src/classes/image.C,
	  src/classes/int.C, src/classes/mail.C, src/classes/math.C,
	  src/classes/memory.C, src/classes/op.C, src/classes/response.C,
	  src/classes/string.C, src/classes/table.C, src/classes/void.C,
	  src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h,
	  src/doc/exception.dox, src/doc/index.dox, src/doc/memory.dox,
	  src/doc/string.dox, src/include/Makefile.am,
	  src/include/pa_array.h, src/include/pa_cache_managers.h,
	  src/include/pa_charset.h, src/include/pa_charsets.h,
	  src/include/pa_common.h, src/include/pa_config_auto.h.in,
	  src/include/pa_config_fixed.h, src/include/pa_config_includes.h,
	  src/include/pa_dictionary.h, src/include/pa_dir.h,
	  src/include/pa_exception.h, src/include/pa_exec.h,
	  src/include/pa_globals.h, src/include/pa_hash.h,
	  src/include/pa_memory.h, src/include/pa_opcode.h,
	  src/include/pa_operation.h, src/include/pa_pool.h,
	  src/include/pa_pragma_pack_begin.h,
	  src/include/pa_pragma_pack_end.h, src/include/pa_request.h,
	  src/include/pa_request_charsets.h, src/include/pa_request_info.h,
	  src/include/pa_sapi.h, src/include/pa_socks.h,
	  src/include/pa_sql_connection.h,
	  src/include/pa_sql_driver_manager.h, src/include/pa_stack.h,
	  src/include/pa_string.h, src/include/pa_stylesheet_connection.h,
	  src/include/pa_stylesheet_manager.h, src/include/pa_table.h,
	  src/include/pa_threads.h, src/include/pa_types.h,
	  src/include/pa_uue.h, src/lib/Makefile.am,
	  src/lib/cord/Makefile.am, src/lib/cord/cord.dsp,
	  src/lib/cord/cordbscs.c, src/lib/cord/cordprnt.c,
	  src/lib/cord/cordxtra.c, src/lib/cord/source.url,
	  src/lib/cord/include/Makefile.am, src/lib/cord/include/cord.h,
	  src/lib/cord/include/ec.h,
	  src/lib/cord/include/private/Makefile.am,
	  src/lib/cord/include/private/cord_pos.h, src/lib/gc/Makefile.am,
	  src/lib/ltdl/libltdl.dsp, src/lib/md5/pa_md5.h,
	  src/lib/md5/pa_md5c.c, src/lib/pcre/pcre.h,
	  src/lib/pcre/pcre_parser_ctype.c, src/main/Makefile.am,
	  src/main/compile.C, src/main/compile.tab.C, src/main/compile.y,
	  src/main/compile_tools.C, src/main/compile_tools.h,
	  src/main/execute.C, src/main/main.dsp, src/main/pa_array.C,
	  src/main/pa_cache_managers.C, src/main/pa_charset.C,
	  src/main/pa_charsets.C, src/main/pa_common.C,
	  src/main/pa_dictionary.C, src/main/pa_dir.C,
	  src/main/pa_exception.C, src/main/pa_exec.C,
	  src/main/pa_globals.C, src/main/pa_hash.C, src/main/pa_pool.C,
	  src/main/pa_request.C, src/main/pa_socks.C,
	  src/main/pa_sql_driver_manager.C, src/main/pa_string.C,
	  src/main/pa_stylesheet_manager.C, src/main/pa_table.C,
	  src/main/pa_uue.C, src/main/untaint.C, src/sql/pa_sql_driver.h,
	  src/targets/Makefile.am, src/targets/cgi/Makefile.am,
	  src/targets/cgi/getopt.c, src/targets/cgi/getopt.h,
	  src/targets/cgi/pa_pool.C, src/targets/cgi/pa_threads.C,
	  src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp,
	  src/targets/cgi/pool_storage.h, src/targets/cgi/pp3.cmd,
	  src/targets/isapi/Makefile.am, src/targets/isapi/pa_pool.C,
	  src/targets/isapi/pa_threads.C, src/targets/isapi/parser3isapi.C,
	  src/targets/isapi/parser3isapi.dsp,
	  src/targets/isapi/pool_storage.h, src/types/Makefile.am,
	  src/types/pa_junction.h, src/types/pa_method.h,
	  src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vbool.h,
	  src/types/pa_vclass.C, src/types/pa_vclass.h,
	  src/types/pa_vcode_frame.h, src/types/pa_vcookie.C,
	  src/types/pa_vcookie.h, src/types/pa_vdate.h,
	  src/types/pa_vdouble.h, src/types/pa_venv.h,
	  src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.C,
	  src/types/pa_vform.h, src/types/pa_vhash.C, src/types/pa_vhash.h,
	  src/types/pa_vimage.C, src/types/pa_vimage.h,
	  src/types/pa_vint.h, src/types/pa_vjunction.h,
	  src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C,
	  src/types/pa_vmath.h, src/types/pa_vmemory.h,
	  src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h,
	  src/types/pa_vobject.C, src/types/pa_vobject.h,
	  src/types/pa_vrequest.C, src/types/pa_vrequest.h,
	  src/types/pa_vresponse.C, src/types/pa_vresponse.h,
	  src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h,
	  src/types/pa_vstateless_object.h, src/types/pa_vstatus.C,
	  src/types/pa_vstatus.h, src/types/pa_vstring.C,
	  src/types/pa_vstring.h, src/types/pa_vtable.C,
	  src/types/pa_vtable.h, src/types/pa_vvoid.h,
	  src/types/pa_vxdoc.C, src/types/pa_vxdoc.h,
	  src/types/pa_vxnode.C, src/types/pa_vxnode.h,
	  src/types/pa_wcontext.C, src/types/pa_wcontext.h,
	  src/types/pa_wwrapper.h, src/types/types.dsp,
	  www/htdocs/.htaccess, www/htdocs/auto.p, www/htdocs/index.html:
	  moved tempate_gc to HEAD

	* tests/: 001.html, 002.html, 003.html, 004.html, 005.html,
	  006.html, 007.html, 008.html, 009.html, 010.html, 011.html,
	  012.html, 013.html, 014.html, 015.html, 016.html, 017.html,
	  018.html, 019.html, 019paf2001.gif, 020.html, 021.html, 022.html,
	  023.html, 024.html, 025.html, 026.html, 027.html, 028.html,
	  029.html, 030.html, 031.html, 032.html, 033.html, 034.html,
	  035.html, 036.html, 037.html, 038.html, 039.html, 040.html,
	  041.html, 042.html, 043.html, 044.html, 045.html, 046.html,
	  047.html, 048.html, 049.html, 050.html, 051.html, 051b.p, 051t.p,
	  052.html, 053.html, 054.html, 055.html, 056.html, 057.html,
	  058.html, 058_paf2000.png, 059.html, 060.html, 061.dat, 061.html,
	  062.html, 063.html, 064.html, 065.html, 066.html, 067.html,
	  068.html, 069.html, 070.html, 071.html, 072.html, 073.html,
	  074.html, 075.html, 076.html, 077.html, 078.html, 079.html,
	  080.html, 081.html, 082.html, 083.html, 084.html, 085.html,
	  086.html, 087.html, 088.html, 089.html, 090.html, 091.html,
	  092.html, 093.html, 094.html, 095.html, 096.html, 097.html,
	  098.html, 098font.gif, 099.html, 100.html, 101.html, 102.html,
	  103.html, 103mark.gif, 103paf2001.gif, 104.html, 105.html,
	  106.html, 107.html, 108.html, 108.xsl, 109.html, 110.html,
	  111.html, 112.html, 113.html, 114.html, 115.html, 116.html,
	  117.html, 118.html, 119.html, 120.html, 121.html, 122.html,
	  123.html, 124.html, 125.html, 126.html, 127.html, 128.html,
	  129.html, 130.html, 131.html, 132.html, 133.html, 134.html,
	  135.html, 136.html, 137.html, 138.html, 139.html, 140.html,
	  141.html, Makefile, descript.ion, run_parser.sh, 022_dir/a.html,
	  022_dir/b.txt, 022_dir/c.htm, 096_dir/163.jpg, 096_dir/188.jpg,
	  outputs/create-dir, results/001.processed, results/002.processed,
	  results/003.processed, results/004.processed,
	  results/005.processed, results/006.processed,
	  results/007.processed, results/008.processed,
	  results/009.processed, results/010.processed,
	  results/011.processed, results/012.processed,
	  results/013.processed, results/014.processed,
	  results/015.processed, results/016.processed,
	  results/017.processed, results/018.processed,
	  results/019.processed, results/020.processed,
	  results/021.processed, results/022.processed,
	  results/023.processed, results/024.processed,
	  results/025.processed, results/026.processed,
	  results/027.processed, results/028.processed,
	  results/029.processed, results/030.processed,
	  results/031.processed, results/032.processed,
	  results/033.processed, results/034.processed,
	  results/035.processed, results/036.processed,
	  results/037.processed, results/038.processed,
	  results/039.processed, results/040.processed,
	  results/041.processed, results/042.processed,
	  results/043.processed, results/044.processed,
	  results/045.processed, results/046.processed,
	  results/047.processed, results/048.processed,
	  results/049.processed, results/050.processed,
	  results/051.processed, results/052.processed,
	  results/053.processed, results/054.processed,
	  results/055.processed, results/056.processed,
	  results/057.processed, results/058.processed,
	  results/059.processed, results/060.processed,
	  results/061.processed, results/062.processed,
	  results/063.processed, results/064.processed,
	  results/065.processed, results/066.processed,
	  results/067.processed, results/068.processed,
	  results/069.processed, results/070.processed,
	  results/071.processed, results/072.processed,
	  results/073.processed, results/074.processed,
	  results/075.processed, results/076.processed,
	  results/077.processed, results/078.processed,
	  results/079.processed, results/080.processed,
	  results/081.processed, results/082.processed,
	  results/083.processed, results/084.processed,
	  results/085.processed, results/086.processed,
	  results/087.processed, results/088.processed,
	  results/089.processed, results/090.processed,
	  results/091.processed, results/092.processed,
	  results/093.processed, results/094.processed,
	  results/095.processed, results/096.processed,
	  results/097.processed, results/098.processed,
	  results/099.processed, results/100.processed,
	  results/101.processed, results/102.processed,
	  results/103.processed, results/104.processed,
	  results/105.processed, results/106.processed,
	  results/107.processed, results/108.processed,
	  results/109.processed, results/110.processed,
	  results/111.processed, results/112.processed,
	  results/113.processed, results/114.processed,
	  results/115.processed, results/116.processed,
	  results/117.processed, results/118.processed,
	  results/119.processed, results/120.processed,
	  results/121.processed, results/122.processed,
	  results/123.processed, results/124.processed,
	  results/125.processed, results/126.processed,
	  results/127.processed, results/128.processed,
	  results/129.processed, results/130.processed,
	  results/131.processed, results/132.processed,
	  results/133.processed, results/134.processed,
	  results/135.processed, results/136.processed,
	  results/137.processed, results/138.processed,
	  results/139.processed, results/140.processed,
	  results/141.processed: merged(copied) to HEAD from template_gc

	* src/targets/: cgi/parser3.dsp, isapi/parser3isapi.dsp: more step
	  towards \parser3project not having to be in root

	* src/: classes/math.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c: apache
	  module compiled [were minor unnecessary changes in lib/md5
	  interface]

	* src/include/pa_version.h: release

	* parser3.dsw, src/main/pa_globals.C, www/htdocs/.htaccess:
	  relative paths to xml&gc libs

	* src/classes/math.C: merged uuid bugfix

	* tests/: 141.html, results/141.processed: fixed bug with
	  too-small-a-buffer

	* src/classes/math.C: uuid bugfix

	* tests/: 141.html, Makefile, results/005.processed,
	  results/030.processed, results/075.processed,
	  results/078.processed: to reflect date format change (were -
	  become ' ')

	* src/classes/math.C: uuid bugfix

	* parser3.dsw, src/main/pa_globals.C, www/htdocs/.htaccess: few
	  paths for libxml debug/release changes

	* src/lib/md5/pa_md5c.c: PA_ -> pa_

2003-07-23  paf

	* src/: classes/math.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c:
	  renamed a little [to move to comman naming conv]

	* src/targets/Makefile.am: apache13 splitted to simplify apache
	  build

	* src/: include/pa_request.h, include/pa_stack.h, main/execute.C,
	  main/pa_request.C, main/pa_sql_driver_manager.C,
	  main/pa_stylesheet_manager.C, targets/isapi/parser3isapi.dsp:
	  stack top_index() fixed

	* src/main/pa_globals.C: minor style changes

	* src/: classes/op.C, include/pa_sql_connection.h: connection
	  closing/caching fixed [connections were not closed/put to cache]

2003-07-22  paf

	* INSTALL: gc part updated stightly

	* src/targets/isapi/: parser3isapi.C, parser3isapi.dsp: updated to
	  new sapi interface

	* src/classes/file.C: comment on OS

	* src/main/pa_string.C: removed reduntant invariant check [there is
	  one deeper in cord lib]

	* src/main/pa_exec.C: on win32 bugfix in handling shbang

	* src/main/pa_memory.C: out of memory is no longer coredump

	* INSTALL: disable-threads adviced

2003-07-21  paf

	* src/classes/Makefile.am: removed circular dependency on classes.C

	* src/classes/file.C: file::exec/cgi environment variables now must
	  be UPPERCASE and A-Z 0-9 _-

	* src/classes/file.C: env passing fixed

	* src/main/pa_common.C: http:// CRLF now [merged from HEAD]

	* src/main/pa_common.C: http:// CRLF now

2003-07-02  paf

	* operators.txt, src/types/pa_vstatus.C: renamed $memory:status
	  fields to reflect their real meaning

2003-06-27  paf

	* src/: classes/file.C, include/pa_charset.h, include/pa_exec.h,
	  include/pa_hash.h, main/pa_charset.C: merged from HEAD
	  file::exec/cgi .charset

2003-06-26  paf

	* ChangeLog, src/classes/file.C, src/classes/hash.C,
	  src/classes/image.C, src/classes/op.C, src/classes/string.C,
	  src/classes/table.C, www/htdocs/.htaccess: fixed several
	  uninitialized local structures.  notably ^hash.foreach now
	  inserts delimiters properly [were inserting it before first body]

2003-06-24  paf

	* src/include/pa_hash.h: simplified HASH_ALLOCATES_COUNT

2003-06-20  paf

	* operators.txt, src/include/pa_globals.h, src/main/pa_common.C,
	  src/main/pa_globals.C: introducing
	  $f[^file::load[binary;http://...]] $f.tables

2003-06-06  paf

	* src/types/: pa_vhash.h: $hash.field lookup first now: along with
	  table. [were method lookup: inconsistent]

2003-06-02  paf

	* src/include/pa_memory.h: empty string clone fixed to return
	  writable memory

	* src/main/pa_common.C: fix_line_breaks bug fix [terminating zero
	  were not appended] which violated string invariant

2003-05-30  paf

	* src/types/pa_value.C: date format now Sun, 06 Nov 1994 08:49:37
	  GMT  ; RFC 822, updated by RFC 1123 [as in HEAD]

	* src/main/pa_common.C: date format now Sun, 06 Nov 1994 08:49:37
	  GMT  ; RFC 822, updated by RFC 1123

	* src/: classes/file.C, classes/form.C, targets/cgi/parser3.C,
	  targets/isapi/parser3isapi.C: initialized request_info properly

	* src/classes/xnode.C: found minor bug, commended for future

2003-05-28  paf

	* src/classes/form.C: request_info.content_length can't be <0,
	  size_t for some time

2003-05-26  paf

	* src/: classes/file.C, classes/string.C, main/pa_string.C: few
	  forgotten <0 changed to !=STRING_NOT_FOUND

	* src/classes/math.C: merged ffffu from HEAD

2003-05-11  paf

	* src/main/pa_globals.C: xml memory debugging functions (ifdefed)

	* src/types/: pa_vxdoc.h, pa_vxnode.h: think that found cause of
	  premature doc free.  transformed document had xmlDoc reference
	  stored to non-gc-memory (libgdome) added holding-reference

2003-04-29  paf

	* src/main/pa_globals.C: started digging on double free.  on win32
	  found that that's perfectly normal.

2003-04-25  paf

	* src/classes/table.C: table.join bug fix  [bad limit check]

	* src/classes/math.C: merged from HEAD: simpiler hash_string

	* src/classes/math.C: snprintf(buf, 3) become (buf,2) and failed to
	  print anything.  changed to quicker and simplier code

	* src/classes/hash.C: allowed ^hash::create[^rem{xxx}]	 [were to
	  strict a check]

	* src/: classes/table.C, lib/md5/pa_md5c.c: minor compile errors

2003-04-24  paf

	* src/include/pa_table.h: too strict assert loosened

	* src/lib/: md5/pa_md5c.c, pcre/pcre.h: thanks to Ilia Soldis
	   for reporing this ansi c fiolation syntax
	  report

2003-04-21  paf

	* src/targets/cgi/Makefile.am: pp3 added to .am

	* src/main/pa_globals.C: pcre memory management changed to use GC
	  memory

	* src/main/pa_globals.C: 2.5.6 version of libxml allows to install
	  xmlMallocAtomic [author agreed to my suggestion], used that

	* src/types/pa_vmail.C: ^mail:send[$.body backward compatibility

	* src/: targets/cgi/parser3.C, types/pa_value.C, types/pa_value.h,
	  types/pa_vmail.C: attributed_meaning_to_string added
	  L_UNSPECIFIED piece which was sortof OK, but violated string
	  invariant [assertion barked on that] changed to L_PASS_APPEND,
	  made that param obligatory

	* src/main/pa_string.C: String::ArrayFragment::append_positions bug
	  fixed [assert helped]

	* src/include/pa_string.h: assert added [looking for bug]

	* src/main/pa_request.C: merged from HEAD: "x:..." and "\\..." file
	  names on Win32 considered disk-global

	* src/main/pa_request.C: "x:..." and "\\..." file names on Win32
	  considered disk-global

2003-04-18  paf

	* src/main/untaint.C: merged from HEAD: enabled '~' letter in
	  filenames

	* src/main/untaint.C: enabled '~' letter in filenames

2003-04-16  paf

	* src/classes/file.C: small bug introduced in autoptr times fixed

	* etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: merged from
	  HEAD

	* src/classes/table.C: fix: gcc reported tiny error

2003-04-15  paf

	* operators.txt, src/classes/math.C, src/lib/md5/pa_md5.h,
	  src/lib/md5/pa_md5c.c, tests/141.html,
	  tests/results/141.processed, www/htdocs/.htaccess: merged from
	  head ^math:uuid[] ^math:uid64[] ^math:md5[string]

	  test added: 141.html

	* operators.txt, src/classes/math.C: ^math:uid64[]

	* src/classes/math.C: ^math:uuid[]

	* operators.txt, src/classes/math.C: ^math:uuid[]

	* operators.txt, src/classes/math.C, src/lib/md5/pa_md5.h,
	  src/lib/md5/pa_md5c.c: ^math:md5[string] 16-byte digest

	* operators.txt, src/classes/file.C, src/include/pa_common.h,
	  src/include/pa_config_fixed.h, src/main/pa_common.C:
	  ^file::load[mode;name;     $.offset	  $.limit

2003-04-14  paf

	* src/: classes/math.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c:
	  started ^math:md5

	* src/classes/table.C, src/include/pa_array.h,
	  src/include/pa_table.h, src/main/pa_table.C, tests/140.html,
	  tests/results/140.processed: table $.reverse option works in
	  create&co table $.distinct[tables] bug fix merged

	* src/: classes/table.C, include/pa_table.h: table
	  $.distinct[tables] bug fixed

	* src/classes/table.C: more warnings

	* src/include/pa_array.h, src/include/pa_table.h,
	  src/main/pa_table.C, www/htdocs/.htaccess: removed checks in
	  table::set_current, moved them back to table::locate implemented
	  table::create/join ñ $.reverse

	* src/: include/pa_table.h, main/pa_array.C, main/pa_table.C:
	  removed checks in table::set_current, moved them back to
	  table::locate

2003-04-11  paf

	* operators.txt, src/classes/date.C, src/classes/table.C,
	  src/include/pa_array.h, src/include/pa_common.h,
	  src/include/pa_config_includes.h, src/include/pa_string.h,
	  src/include/pa_table.h, src/main/pa_request.C,
	  src/main/pa_sql_driver_manager.C, src/main/pa_string.C,
	  src/main/pa_table.C, www/htdocs/.htaccess: merged from HEAD from
	  before_append_array_limit_sense_change to
	  after_append_array_limit_sense_change

	* src/classes/table.C: typo

	* www/htdocs/.htaccess, operators.txt, src/classes/date.C,
	  src/classes/table.C, src/include/pa_array.h,
	  src/include/pa_common.h, src/include/pa_config_includes.h,
	  src/include/pa_globals.h, src/include/pa_table.h,
	  src/main/pa_array.C, src/main/pa_globals.C,
	  src/main/pa_request.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/main/pa_table.C:
	  append_array_limit_sense_change locate accepts options same as
	  create new option: $.reverse(1)   [do not work in table::create]

	* src/: include/pa_common.h, main/pa_common.C: gcc didn't like
	  (stat xxx,

	* src/classes/: table.C: typo

	* tests/: 130.html, 131.html, 132.html, 133.html, 134.html,
	  135.html, 136.html, 137.html, 138.html, 139.html, descript.ion,
	  results/130.processed, results/131.processed,
	  results/132.processed, results/133.processed,
	  results/134.processed, results/135.processed,
	  results/136.processed, results/137.processed,
	  results/138.processed, results/139.processed: added few mustfail
	  tests 130.html mustfail: empty regexp 131.html mustfail: invalid
	  date/time 132.html mustfail: access to junction outside of
	  context 133.html mustfail: access to junction outside of context,
	  case version 134.html mustfail: hash: adding a key inside of
	  foreach 135.html mustfail: modifying system class 136.html
	  mustfail: $.name outside of $hash[here] 137.html mustfail:
	  appendChild without import 138.html mustfail: invalid encoding
	  inside of xml 139.html mustfail: bad XPath

	* operators.txt, src/classes/table.C, tests/084.html,
	  tests/125.html, tests/126.html, tests/127.html, tests/128.html,
	  tests/129.html, tests/results/125.processed,
	  tests/results/126.processed, tests/results/127.processed,
	  tests/results/128.processed, tests/results/129.processed: merged
	  from HEAD ^table.hash[key][$.distinct[tables]]

	  maked appropriate tests [changed one old nonconforming]

	* operators.txt, src/classes/table.C:
	  ^table.hash[key][$.distinct[tables]]

	* src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h:
	  merged fix for found very old xml (dom) bug: were passing
	  domString objects and later ERROREOUSLY freed them

	* INSTALL, src/include/pa_charset.h, src/lib/Makefile.am,
	  src/main/pa_charset.C: re-added libgdome patch. regretfully
	  libgdome bug can not be worked around

2003-04-10  paf

	* src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h:
	  found very old xml (dom) bug: were passing domString objects and
	  later ERROREOUSLY freed them

	* src/doc/string.dox, src/include/pa_memory.h,
	  src/include/pa_string.h, src/lib/cord/cordbscs.c,
	  src/main/pa_string.C, src/types/pa_vform.C, src/types/pa_vform.h,
	  tests/123.html, tests/124.html, tests/results/001.processed,
	  tests/results/002.processed, tests/results/003.processed,
	  tests/results/004.processed, tests/results/005.processed,
	  tests/results/006.processed, tests/results/008.processed,
	  tests/results/009.processed, tests/results/010.processed,
	  tests/results/011.processed, tests/results/012.processed,
	  tests/results/013.processed, tests/results/014.processed,
	  tests/results/015.processed, tests/results/016.processed,
	  tests/results/017.processed, tests/results/018.processed,
	  tests/results/020.processed, tests/results/021.processed,
	  tests/results/022.processed, tests/results/023.processed,
	  tests/results/024.processed, tests/results/025.processed,
	  tests/results/026.processed, tests/results/027.processed,
	  tests/results/028.processed, tests/results/029.processed,
	  tests/results/030.processed, tests/results/031.processed,
	  tests/results/032.processed, tests/results/033.processed,
	  tests/results/034.processed, tests/results/035.processed,
	  tests/results/036.processed, tests/results/037.processed,
	  tests/results/038.processed, tests/results/039.processed,
	  tests/results/040.processed, tests/results/041.processed,
	  tests/results/042.processed, tests/results/043.processed,
	  tests/results/044.processed, tests/results/045.processed,
	  tests/results/046.processed, tests/results/047.processed,
	  tests/results/048.processed, tests/results/049.processed,
	  tests/results/050.processed, tests/results/051.processed,
	  tests/results/052.processed, tests/results/053.processed,
	  tests/results/054.processed, tests/results/055.processed,
	  tests/results/056.processed, tests/results/057.processed,
	  tests/results/058.processed, tests/results/059.processed,
	  tests/results/060.processed, tests/results/061.processed,
	  tests/results/062.processed, tests/results/063.processed,
	  tests/results/064.processed, tests/results/065.processed,
	  tests/results/066.processed, tests/results/067.processed,
	  tests/results/068.processed, tests/results/069.processed,
	  tests/results/070.processed, tests/results/071.processed,
	  tests/results/072.processed, tests/results/073.processed,
	  tests/results/074.processed, tests/results/075.processed,
	  tests/results/076.processed, tests/results/077.processed,
	  tests/results/078.processed, tests/results/079.processed,
	  tests/results/080.processed, tests/results/081.processed,
	  tests/results/082.processed, tests/results/083.processed,
	  tests/results/084.processed, tests/results/085.processed,
	  tests/results/086.processed, tests/results/087.processed,
	  tests/results/088.processed, tests/results/089.processed,
	  tests/results/090.processed, tests/results/091.processed,
	  tests/results/092.processed, tests/results/093.processed,
	  tests/results/094.processed, tests/results/095.processed,
	  tests/results/096.processed, tests/results/097.processed,
	  tests/results/101.processed, tests/results/102.processed,
	  tests/results/104.processed, tests/results/105.processed,
	  tests/results/106.processed, tests/results/107.processed,
	  tests/results/108.processed, tests/results/109.processed,
	  tests/results/110.processed, tests/results/111.processed,
	  tests/results/112.processed, tests/results/113.processed,
	  tests/results/114.processed, tests/results/115.processed,
	  tests/results/116.processed, tests/results/117.processed,
	  tests/results/118.processed, tests/results/119.processed,
	  tests/results/120.processed, tests/results/121.processed,
	  tests/results/122.processed, tests/results/123.processed,
	  tests/results/124.processed: new convention: char* never 0.
	  assert in cord on that

	* src/main/pa_charset.C: couple more asserts

	* src/: main/pa_charset.C, include/pa_charset.h: little transcodes
	  speedup

	* src/main/pa_charset.C: couple assertions on fantastic situations
	  added [may be those is the case now?]

	* src/main/pa_charset.C: bugfix on memory buffer overrun [but
	  that's memory from gc_malloc, not from g_malloc :(, but would
	  hope]

	* src/main/pa_charset.C: bugfix on memory buffer overrun [but
	  that's memory from gc_malloc, not from g_malloc :(, but would
	  hope]

	* src/main/pa_charset.C: checked custom malloc for returning 0

2003-04-09  paf

	* src/classes/date.C: merged ^date.roll changes

	* src/classes/date.C: ^date.roll bug fix

	* src/classes/date.C: ^date.roll now throws less errors: month
	  shifts handles end of month situation by reducing day number
	  hour-hole shift reduces hour to recover

	* src/targets/cgi/pp3.cmd: custom profiling script: plist/ST <<
	  Sort by function time

	* operators.txt, src/main/pa_charset.C, src/main/pa_common.C:
	  http://   $.charset[] param done

	* tests/: 122.html, results/122.processed: 122 date test <= and ==
	  added [after volatile fix. passes on win&intel-solaris]

2003-04-08  paf

	* src/: classes/file.C, classes/op.C, classes/table.C,
	  classes/xdoc.C, include/pa_charset.h, include/pa_charsets.h,
	  include/pa_common.h, include/pa_request_charsets.h,
	  main/pa_charset.C, main/pa_charsets.C, main/pa_common.C,
	  main/pa_exec.C, main/pa_request.C, main/untaint.C,
	  types/pa_value.h, types/pa_vmail.C, types/pa_vrequest.C,
	  types/pa_vresponse.C: started http://   $.charset[] param and
	  http response charset detection just compiled.  todo:test

	* src/main/pa_common.C: merged PA_USE_ALARM bugfix from HEAD

	* src/: classes/string.C, include/pa_string.h, main/pa_string.C,
	  main/untaint.C, targets/isapi/parser3isapi.C, types/pa_vform.C,
	  types/pa_vmail.C: changed transcode param converntion  along with
	  string creating convention -- all strings are zero-terminated,
	  this allowed to fix one remaining String("123", 2) case

	* src/: classes/date.C, classes/file.C, classes/hash.C,
	  classes/op.C, classes/string.C, classes/table.C,
	  include/pa_charset.h, include/pa_memory.h, include/pa_string.h,
	  main/compile.tab.C, main/pa_charset.C, main/pa_exec.C,
	  main/pa_request.C, main/pa_string.C, main/pa_uue.C,
	  main/untaint.C, types/pa_vfile.C, types/pa_vfile.h,
	  types/pa_vform.C, types/pa_vform.h, types/pa_vmail.C: pa_vform
	  violated String::invariant. started fixing [not compiled now]

	* src/classes/string.C, src/include/pa_string.h,
	  src/lib/cord/cordbscs.c, src/main/compile.tab.C,
	  src/main/compile.y, src/main/pa_string.C, src/main/untaint.C,
	  src/targets/cgi/parser3.C, www/htdocs/.htaccess: number of string
	  style improvements & optimizations

	* src/classes/xnode.C: =0 bug fix [left from autoptr default ctor
	  :(]

	* src/main/untaint.C: removed redundant & in CORD_pos param passing
	  [for it's a pointer really]

	* src/main/untaint.C: CORD_pos_advance turned out to have limit on
	  'n' param. worked that around

	* src/lib/cord/: Makefile.am, cordbscs.c, source.url: From: "Boehm,
	  Hans"  To: "'Alexandr Petrosian (PAF)'"
	  ; "Boehm, Hans"  Sent: Tuesday,
	  April 08, 2003 2:16 AM Subject: RE: libgc 6.2.alpha4
	  cord/cordbscs.c/CORD_cat bug [were: CORD__extend_path bug?

	  Thanks for the bug report and patch.

	  I hadn't looked at this code in a while.  Reading it now, it
	  seems to me that the tests should also be ">= MAX_DEPTH" to
	  comply with the invariant, though that may not matter a lot.	I
	  changed that, too.

	  Hans

2003-04-07  paf

	* src/: include/pa_common.h, main/pa_common.C, main/pa_exec.C:
	  merged from head:safe mode error message now includes numbers

	* src/main/execute.C: n-th attempt to make a=a work with double.
	  problem: as_double returns it's result in fp-register compiler
	  optimizes access to that register after b->as_double, and just
	  compares ALREADY_STORED_VALUE with prev-calculated a->as_double
	  from memory.	_SAME_ double values do not match here.  when
	  forced to REload fp-register, values do match.

	  tried to make them volatile.

	* src/main/execute.C: n-th attempt to make a=a work with double.
	  problem: as_double returns it's result in fp-register compiler
	  optimizes access to that register after b->as_double, and just
	  compares ALREADY_STORED_VALUE with prev-calculated a->as_double
	  from memory.	_SAME_ double values do not match here.  when
	  forced to REload fp-register, values do match.

	  tried to make them volatile.

	* src/types/pa_vobject.h: small style change

	* src/: lib/cord/cordbscs.c, include/pa_string.h: CORD_cat bugfix

	* src/: include/pa_common.h, main/pa_common.C, main/pa_exec.C: safe
	  mode error message now includes numbers

	* src/main/untaint.C, src/targets/cgi/parser3.C,
	  www/htdocs/.htaccess: unknown untaint lang now causes death

2003-04-04  paf

	* src/: classes/file.C, include/pa_exec.h, main/pa_exec.C:
	  incorportated pa_exec patch by From: "Victor Fedoseev"
	   To: "Alexandr Petrosian (PAF)" 
	  Sent: Thursday, January 23, 2003 9:14 AM

	  huge speedup on ^file::cgi with big result

	* src/classes/table.C: sort table with 0 rows bug fixed

	* src/types/pa_vhash.h: $hash._default showed in foreach & co bug
	  fix http://i2/tasks/edit/?id=4493701604654042676

	  @main[] $with_default[  $.a[1]  $._default[default from
	  with_default] ] ^show[$with_default]

	  $to_add_to[	  $.b[2] ] ^to_add_to.add[$with_default]
	  =$to_add_to.xxx=
^show[$to_add_to] $cloned[^hash::create[$with_default]] =$cloned.xxx=
^show[$cloned] @show[hash] ^hash.foreach[k;v]{ $k = $v
}
* src/classes/hash.C: $hash._default showed in foreach & co bug fix http://i2/tasks/edit/?id=4493701604654042676 @main[] $with_default[ $.a[1] $._default[default from with_default] ] ^show[$with_default] $to_add_to[ $.b[2] ] ^to_add_to.add[$with_default] =$to_add_to.xxx=
^show[$to_add_to] $cloned[^hash::create[$with_default]] =$cloned.xxx=
^show[$cloned] @show[hash] ^hash.foreach[k;v]{ $k = $v
}
* src/types/pa_vmail.C: mail receive: .txt attachemnts bug fix http://i2/tasks/edit/?id=4507350336410850921 * src/classes/xdoc.C: memory allocation func bugfix http://i2/tasks/edit/?id=4499303470368629745 * src/classes/math.C: allowed random 1... * src/classes/math.C: allowed random 0.. * src/main/pa_globals.C: exif mem leak http://i2/tasks/edit/?id=4480590323629807263 * src/: classes/classes.dsp, main/main.dsp, targets/cgi/parser3.dsp, types/pa_vmail.C, types/types.dsp: buf fix http://i2/tasks/edit/?id=4493946731322521294 $.to[billgates@microsoft.com BCc: send-spam-to@someemails.ru ] * src/: classes/classes.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, types/types.dsp: links to xml libs made relative, no need to unpack parser3project to /parser3project. * src/main/: compile.tab.C, compile.y, compile_tools.h: error column more precise - tab handling bug fixed * src/main/: compile.tab.C, compile.y: more understandable error message in case @CLASS with more then one line inside * src/targets/cgi/parser3.C: more understandable error message in case of errors in @unhandled_exception 2003-04-03 paf * INSTALL, src/include/pa_operation.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/pa_request.C: debug info format simplified, now it's: OP_VALUE Operation::Origin << here value* higher limits: file number (max: 255) line number (max: 64535) column number (max: 255) * src/classes/math.C: top limit * src/main/: compile.C, compile.tab.C, compile.y, compile_tools.h: precise parse error position in case of ^bug ] * src/classes/op.C, src/main/pa_request.C, tests/042.html: test 042 changed to realities, and passed [bug fixed] * src/: classes/op.C, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_request.C: introducing ^process...[main-method-alias] * src/: classes/date.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, types/pa_vmethod_frame.h: MethodParams& now [methods without params receive zero reference, but they are expected not to look there] * operators.txt, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/memory.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/main/execute.C, src/types/pa_method.h: MethodParams& now [methods without params receive zero reference, but they are expected not to look there] * operators.txt, src/classes/op.C, src/include/pa_request.h, src/main/pa_request.C, src/types/pa_vmethod_frame.h: ^process...[filename] useful for better error reporting [file/line/col] * src/: main/execute.C, types/pa_value.C, types/pa_value.h, types/pa_vstring.h: slightly improved error messages text: 1. is '%s', it 2. method undefined in case of ^void[] * src/: classes/op.C, include/pa_request.h, include/pa_stack.h, include/pa_types.h, main/execute.C, main/pa_request.C: exception handling done. now we have error columns todo: test it * src/: classes/op.C, include/pa_request.h: removed from trace 'a' exception when ^try{ ^throw[a;1] }{ ^throw[b;2] } this makes life easier: were: bad stack order -- were in exception catch unwind order, which didn't match execution order @main[] ^try{ ^first[] }{ ^throw[c;3] } @first[] ^throw[a;1] showed throw a first throw b try which is no good * src/: classes/op.C, include/pa_request.h, include/pa_stack.h, main/compile.tab.C, main/execute.C, main/pa_request.C: strack trace reset after handled exception [old bug fixed] * src/main/: compile.tab.C, compile.y: parse position old bug fixed. position reporting made precise [both, in parse erros and runtime errors] 2003-04-02 paf * src/: include/pa_operation.h, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_exception.C, main/pa_request.C: debug info: started using. todo:complete * src/classes/op.C, src/include/pa_operation.h, src/include/pa_request.h, src/main/compile.C, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/pa_request.C, www/htdocs/.htaccess: prepared debug info todo:use it * src/include/pa_operation.h: strange mistake fixed: forgot to return Operation class->union after switching from autoptrs. * tests/: Makefile, results/108.processed, results/117.processed: meta considered OK [it's up to coder now to remove it not needed] * src/main/pa_dictionary.C, tests/Makefile: replace bug fix [broke Dictionary constructor when moved to gc] * src/main/pa_common.C: uncommented http:// file loading * src/include/pa_array.h, src/main/execute.C, src/targets/cgi/parser3.C, tests/run_parser.sh: gif encoder bug fix [gdGrowingBuf] * configure.in, src/lib/Makefile.am, www/htdocs/.htaccess: removed patches * configure, src/include/pa_config_auto.h.in, src/main/pa_charset.C: --enable-assertions autoconf-ed * src/main/pa_common.C, www/htdocs/.htaccess: uncommented http:// file loading * src/: classes/xdoc.C, types/pa_vxdoc.h: removed ref leak in xdoc::create/load * src/: classes/form.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, classes/void.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C: all calls to String::String(str,helper_length) are checked. found/fixed one place: $request:body now zero-terminated, * src/: classes/op.C, classes/table.C, include/pa_request.h, main/compile_tools.C, main/execute.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h: more locally scoped vars in execute (more easily optimizable) * src/: classes/table.C, include/pa_table.h, main/pa_table.C: few for(size_t i=0...) -> for(Array_iterator... i(..); i.has_next() * src/: include/pa_array.h, include/pa_stack.h, include/pa_string.h, main/compile_tools.C, main/main.dsp, main/pa_table.C, types/pa_vmethod_frame.C: array get/put check become assertion iterator in methodframe filler * src/: include/pa_array.h, include/pa_stack.h, main/main.dsp, targets/cgi/parser3.C: array::get/put inlined * src/: lib/cord/cordbscs.c, main/pa_globals.C: globals.c: gc_substitute_memory_management_functions +installed CORD_oom function * configure.in, src/classes/xnode.C, src/include/pa_config_fixed.h, src/include/pa_config_includes.h, src/include/pa_string.h, src/lib/cord/cordbscs.c, src/main/pa_memory.C, src/targets/cgi/parser3.C: converted debug hacks to ANSI assertions started configure.in --enable-assertions 2003-04-01 paf * src/classes/xdoc.C, src/classes/xnode.h, src/include/pa_memory.h, src/main/pa_memory.C, src/targets/cgi/parser3.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, www/htdocs/.htaccess: memory bug debugged down: gdome uses glib memory, and stores last pointer to xmlDoc there, gc misses that and collects valid memory fixed by remembering xmlDoc from dom object in xdoc. todo: do something with premature free of xdoc with xnodes/node values referring into it * src/classes/: mail.C: typo fix * src/main/pa_memory.C: bug() to set bpt in (memory.c) some .am changes * src/: include/pa_memory.h, main/pa_common.C, main/pa_globals.C, main/pa_memory.C: moved memory debugging to global level: to pa_gc_malloc * src/: main/pa_globals.C, targets/cgi/parser3.C: xml memory debugging showed no errors. todo: debug parser memory * src/targets/cgi/: parser3.C, parser3.dsp: more build configurations * src/: classes/classes.dsp, include/pa_config_fixed.h, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: prepared xml-static configuration 2003-03-31 paf * INSTALL, src/classes/xdoc.C, src/main/pa_globals.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, www/htdocs/.htaccess: started xml lib memory debugging, simple checks failed: it seems that library does realloc(bad ptr), and recording those ptrs in heap [for debugging] was bad: heap situation changes = everything works fine * src/: main/pa_charset.C, include/pa_charset.h: worked around xmlRegisterCharEncodingHandler limitation [currently imposed limit of 10 user-defined charsets] 2003-03-28 paf * src/main/execute.C: execution stack copied to local register variable, removed lots [~2e7) of memory accesses 2003-03-27 paf * src/: classes/xdoc.C, main/pa_globals.C: XML memory funcs to GC works in debug, but fails in release todo: fix that * src/: classes/xdoc.C, main/compile.tab.C, main/pa_globals.C, targets/cgi/parser3.C: forgot to merge XML memory funcs replacement from gc branch * src/main/pa_exec.C: introducing append_help_length [radical improvement here] * src/targets/cgi/parser3.C: GC_java_finalization turned off [was 'not recommened' in gc.h, on win32 noticed no difference] * src/include/pa_array.h: returned checked array get [were disabled for debugging] result:not slower [don't understand that, it were INLINED] todo: find out a way of inlining it! * src/: include/pa_string.h, lib/gc/include/gc.h, lib/gc/include/gc_fake.h, main/compile.tab.C, targets/cgi/parser3.C, main/pa_memory.C, targets/cgi/parser3.dsp: convention changed: all resulting strings are zero-terminated * src/: classes/date.C, classes/file.C, classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_string.h, lib/cord/cord.dsp, lib/cord/cordbscs.c, lib/cord/include/cord.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_common.C, main/pa_exec.C, main/pa_request.C, main/pa_string.C, main/pa_uue.C, sql/pa_sql_driver.h, types/pa_value.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vmail.C: introducing append_help_length [radical improvement here] * src/: classes/memory.C, include/pa_array.h, include/pa_hash.h, include/pa_memory.h, lib/cord/cord.dsp, lib/cord/cordxtra.c, lib/gc/include/gc.h, main/pa_memory.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vstatus.C: disabled gc, become even slower * src/: classes/string.C, classes/table.C, include/pa_array.h, include/pa_stack.h, include/pa_string.h, main/compile_tools.C, main/pa_string.C, main/untaint.C, types/pa_vmethod_frame.C: fixed clients of &get(): most to use non-ref version, some[in tight places] to get_unchecked_ref * src/doc/memory.dox: forgot to add * src/classes/classes.dsp, src/classes/memory.C, src/classes/xdoc.C, src/include/pa_array.h, src/include/pa_request.h, src/include/pa_stack.h, src/include/pa_string.h, src/lib/cord/cord.dsp, src/lib/ltdl/libltdl.dsp, src/lib/md5/md5.dsp, src/lib/pcre/pcre.dsp, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/main.dsp, src/main/pa_string.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, src/types/pa_vmail.C, src/types/pa_vmethod_frame.C, src/types/types.dsp, www/htdocs/.htaccess: Array::put(index, T>>&<< removed after Stack::pop wiping removed [moved to separate func] other Array & removed 2003-03-26 paf * src/: classes/classes.dsp, classes/file.C, classes/op.C, classes/table.C, include/pa_array.h, include/pa_charset.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, lib/cord/cord.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/compile.tab.C, main/compile.y, main/main.dsp, main/pa_charset.C, main/pa_common.C, main/pa_exec.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, main/pa_table.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/types.dsp: pre-evaluated .count() in some places * src/: classes/classes.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/main.dsp, targets/cgi/parser3.dsp, types/types.dsp: .dsp profiling updated * src/: classes/classes.dsp, lib/cord/cord.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, main/main.dsp, targets/cgi/parser3.dsp, types/types.dsp: started profiling * src/: classes/classes.dsp, lib/cord/cord.dsp, main/compile.tab.C, main/compile_tools.h, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: .dsp updated to use lib/gc,lib/cord * acsite.m4, src/classes/Makefile.am, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/include/pa_common.h, src/include/pa_config_auto.h.in, src/include/pa_config_fixed.h, src/include/pa_config_includes.h, src/include/pa_request.h, src/include/pa_sql_driver_manager.h, src/include/pa_string.h, src/include/pa_stylesheet_connection.h, src/include/pa_version.h, src/lib/Makefile.am, src/lib/cord/Makefile.am, src/lib/cord/include/Makefile.am, src/lib/cord/include/private/Makefile.am, src/main/Makefile.am, src/main/pa_exec.C, src/main/pa_string.C, src/main/untaint.C, src/targets/cgi/Makefile.am, src/types/Makefile.am, src/types/pa_vclass.h, src/types/pa_vcookie.h, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmail.h, src/types/pa_vresponse.h, src/types/pa_vstateless_class.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vtable.h, src/types/pa_vxdoc.h: configured math funcs ported pa_exec * src/lib/: cord/include/gc.h, gc/include/gc.h: introducing lib/gc * src/lib/cord/include/: cord.h, ec.h, gc.h, private/cord_pos.h: bundled gc includes * src/classes/op.C, src/include/pa_array.h, src/include/pa_sql_connection.h, src/include/pa_string.h, src/include/pa_version.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/pa_common.C, src/main/pa_exception.C, src/main/pa_request.C, src/main/pa_string.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, www/htdocs/.htaccess: a number of bugfixes [while testing first real site (aval)] 2003-03-25 paf * operators.txt, src/main/pa_sql_driver_manager.C, src/types/pa_vstatus.C: $status.memory used free since_compact process * src/: include/pa_sql_connection.h, main/pa_globals.C, main/untaint.C, sql/pa_sql_driver.h: untaint.C L_SQL * src/main/: pa_charset.C, untaint.C: untaint.C L_MAIL_HEADER * src/main/pa_request.C, src/main/untaint.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vfile.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vstring.C, src/types/pa_vstring.h, tests/121.html, tests/results/121.processed: untaint.C L_URI * operators.txt, src/classes/Makefile.am, src/classes/classes.dsp, src/classes/op.C, src/main/pa_request.C, src/types/Makefile.am, src/types/pa_venv.h, src/types/types.dsp, www/htdocs/.htaccess, src/classes/memory.C, src/types/pa_vmemory.h: ^memory:compact[] * tests/results/109.processed: it was a bug in parser. updated 109 test result * src/classes/xdoc.C, tests/Makefile: fixed transform params2 * src/main/pa_charset.C, src/targets/cgi/parser3.C, tests/Makefile, tests/results/107.processed: fixed dom language [values are now considered tainted. it was a bug in parser. updated 107 test result * src/classes/xdoc.C: fixed transform params * src/: include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C: fixed stylesheet caching * src/: include/pa_memory.h, main/pa_charset.C: memory: new 'new' overloads for structure handling * src/: classes/image.C, classes/xdoc.C, classes/xnode.C, include/pa_string.h, main/pa_string.C, types/pa_vxnode.C: removed StringBody(0) ambiguilty, introducting static StringBody::Format(int) * src/: main/pa_request.C, types/pa_vxnode.C: vxnode compiled xml linked * src/types/pa_vxdoc.C: vxdoc compiled * src/: classes/xnode.C, classes/xnode.h, include/pa_memory.h, types/pa_vxdoc.h, types/pa_vxnode.h: xnode.C compiled, doc/node finalizers isntalled * src/: classes/image.C, classes/xdoc.C, classes/xnode.h, doc/exception.dox, doc/index.dox, include/pa_charset.h, include/pa_memory.h, include/pa_request.h, include/pa_string.h, main/pa_charset.C, main/pa_memory.C, main/pa_string.C: xdoc.C compiled todo: xnode.C / finalizers * src/doc/string.dox: updated: new string internals 2003-03-24 paf * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_charset.h, include/pa_config_fixed.h, include/pa_request.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_charset.C, main/pa_exception.C, main/pa_globals.C, main/pa_request.C, main/pa_stylesheet_manager.C, types/pa_vxdoc.h, types/pa_vxnode.h: started XML * src/main/: pa_common.C, pa_sql_driver_manager.C: http:// * src/: classes/file.C, classes/image.C, classes/mail.C, include/pa_string.h, main/pa_common.C, main/pa_sql_driver_manager.C: introducing string[body]::pos(char) * src/: classes/file.C, classes/image.C, classes/mail.C, include/pa_memory.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/pa_sql_driver_manager.C, types/pa_vimage.h: size_t pos everywhere checks changed to check for eq STRING_NOT_FOUND * src/main/pa_string.C, src/main/untaint.C, tests/Makefile: string optimize bit implemented * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: String::ArrayFragment::append_positions fixed * src/: classes/table.C, include/pa_string.h, main/pa_string.C: String::this_starts fixed * src/main/pa_string.C, tests/Makefile: string::pos fixed * src/: include/pa_hash.h, main/execute.C, main/pa_string.C: hashcode implemented fully, including per-char callback [it can be - substr CORD node] * src/: include/pa_array.h, main/compile.tab.C: gif encoding rewritten to rewalloc with 100byte buf ahead * src/classes/image.C, src/classes/op.C, src/classes/table.C, src/include/pa_string.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/pa_common.C, src/main/untaint.C, tests/Makefile: attempt to do gif encoding to CORD_ec [bad] would rewrite as realloc now * src/: classes/date.C, classes/file.C, classes/form.C, classes/image.C, classes/math.C, classes/op.C, classes/table.C, include/pa_cache_managers.h, include/pa_charsets.h, include/pa_common.h, include/pa_request.h, include/pa_sql_driver_manager.h, include/pa_table.h, main/pa_charset.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_request.C, main/pa_uue.C, targets/isapi/parser3isapi.C, types/pa_value.C, types/pa_value.h, types/pa_vmail.C, types/pa_vmethod_frame.C, types/pa_vstateless_class.h: 2*2 worked :) * parser3.dsw, src/classes/date.C, src/classes/file.C, src/include/pa_exec.h, src/include/pa_string.h, src/main/pa_exec.C, src/main/pa_sql_driver_manager.C: empty run passed OK * src/: classes/hash.C, classes/string.C, classes/table.C, types/pa_value.C: all linked todo: debug * src/: classes/mail.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vstateless_class.C: all compiled. todo:link * src/types/pa_wcontext.C: pa_wcontext.C compiled * src/types/pa_vtable.C: pa_vtable.C compiled * src/types/pa_vstring.C: pa_vstring.C compiled * src/types/pa_vstatus.C: pa_vstatus.C compiled * src/types/: pa_vmath.C, pa_vmethod_frame.C, pa_vmethod_frame.h, pa_vobject.C, pa_vrequest.C, pa_vresponse.C, pa_vstateless_class.C, pa_vstateless_class.h: pa_vstateless_class.C compiled * src/: classes/xdoc.C, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C: pa_vmail.C compiled * src/types/: pa_vhash.C, pa_vimage.C: pa_vimage.C compiled * src/types/pa_vform.C: pa_vform.C compiled * src/types/pa_vfile.C: pa_vfile.C compiled * src/types/: pa_value.h, pa_vclass.C, pa_vcookie.C, pa_vstateless_class.C: pa_vcookie.C compiled * src/: classes/string.C, types/pa_value.C, types/pa_value.h, types/pa_vhash.h: pa_value.C compiled * src/: main/execute.C, main/pa_string.C, types/pa_wcontext.h: classes.lib main.lib compiled * src/classes/void.C: void.C compiled * src/: classes/string.C, classes/table.C, include/pa_string.h, main/pa_string.C, types/pa_vtable.C, types/pa_vtable.h: table.C compiled * src/: classes/string.C, include/pa_request.h, include/pa_string.h, main/pa_string.C: string.C compiled * src/: classes/op.C, classes/string.C, classes/table.C, classes/void.C, include/pa_sql_connection.h, include/pa_string.h, main/pa_request.C, main/pa_string.C: op.C compiled * src/classes/: math.C, op.C: math.C compiled * src/: classes/mail.C, classes/string.C, classes/table.C, types/pa_vmail.h: mail.C compiled * src/classes/: int.C, table.C: int.C compiled * src/: classes/hash.C, classes/image.C, classes/string.C, classes/table.C, include/pa_memory.h, include/pa_string.h, main/pa_memory.C, types/pa_vimage.h, types/pa_vmail.C: image.C compiled * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_request.h, include/pa_sql_connection.h: hash.C compiled * src/: classes/classes.C, classes/classes.awk, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, include/pa_memory.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, main/pa_string.C, types/pa_vdate.h, types/pa_vmethod_frame.h: file.C table.C compiled * src/: include/pa_string.h, main/pa_string.C, main/pa_uue.C, main/untaint.C: main.lib compiled 2003-03-21 paf * src/: classes/op.C, include/pa_cache_managers.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/pa_exception.C, main/pa_globals.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, types/pa_vimage.C: pa_sql_driver_manager.C compiled * src/: classes/hash.C, classes/image.C, classes/op.C, classes/xdoc.C, classes/xnode.C, include/pa_common.h, include/pa_hash.h, include/pa_request.h, include/pa_string.h, main/compile.C, main/pa_common.C, main/pa_request.C, types/pa_vmail.C, types/pa_vresponse.C, types/pa_vxnode.C: pa_request.C compiled * src/: classes/hash.C, classes/mail.C, classes/op.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vhash.h, types/pa_vimage.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vresponse.h, types/pa_vtable.C: pa_request.C 50% compiled * src/: include/pa_exec.h, include/pa_string.h, main/pa_exec.C, main/pa_string.C: pa_exec.C compiled [win32 only for now] todo: on unix * src/: include/pa_charset.h, include/pa_charsets.h, include/pa_exec.h, main/compile.tab.C, main/pa_charset.C, main/pa_charsets.C, main/pa_dictionary.C, main/pa_exec.C: pa_charsets.C compiled * src/: classes/image.C, classes/mail.C, classes/op.C, include/pa_request.h, include/pa_string.h, main/compile.tab.C, main/compile.y, main/execute.C, main/pa_common.C, main/pa_request.C, types/pa_junction.h, types/pa_method.h, types/pa_vcode_frame.h, types/pa_vimage.h, types/pa_vmethod_frame.h: execute.C compiled * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_cache_managers.h, include/pa_charsets.h, include/pa_common.h, include/pa_exec.h, include/pa_memory.h, include/pa_operation.h, include/pa_request.h, include/pa_sapi.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_exec.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: introducing StringBody [C++ CORD wrapper] * src/: lib/cord/cordbscs.c, main/pa_string.C: test14 [bug fixed] * src/: classes/file.C, include/pa_charset.h, main/pa_charset.C: $file::exec/cgi[script; $.charset[this is script's charset] command line, env values, input got transcoded before call stdout, stderr got transcoded after call * src/classes/file.C: ^file::exec/cgi now does not pass post data by default. use: ^file::exec[...;$.stdin[$request.body] * src/main/pa_common.C: } typo bug fix * src/main/pa_common.C: } typo bug fix 2003-03-20 paf * src/: include/pa_string.h, lib/cord/cordbscs.c, main/pa_string.C, main/untaint.C: cord bug fix, but still errors todo: clear out * src/include/pa_string.h: more tests * src/main/pa_string.C: string.pos fixed * src/lib/: ltdl/config_fixed.h, ltdl/configure, ltdl/configure.in, ltdl/libltdl.dsp, ltdl/ltdl.c, ltdl/ltdl.h, pcre/dftables.c, pcre/get.c, pcre/internal.h, pcre/maketables.c, pcre/pcre.c, pcre/pcre.h, pcre/pcre_parser_ctype.c, pcre/study.c: undone bad replaces * src/: classes/image.C, include/pa_dictionary.h, include/pa_string.h, lib/ltdl/ltdl.c, lib/ltdl/ltdl.h, lib/pcre/internal.h, lib/pcre/pcre.c, lib/pcre/study.c, main/compile.tab.C, main/pa_dictionary.C, main/pa_string.C, main/untaint.C, types/pa_vmail.C: more tests [bugs fixed] * src/include/pa_string.h: warning * src/include/pa_string.h: this_starts fixed * src/: include/pa_string.h, main/pa_string.C: added: assertion on new String ctor & append params convention * src/: classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_common.h, include/pa_memory.h, include/pa_string.h, main/compile.tab.C, main/pa_common.C, main/pa_exception.C, main/pa_exec.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/untaint.C, targets/isapi/parser3isapi.C, types/pa_vimage.C, types/pa_vmail.C: more tests OK * src/: include/pa_array.h, include/pa_hash.h, include/pa_memory.h, include/pa_string.h, main/pa_memory.C, main/pa_string.C: test: gc/exit runned OK * src/types/pa_vmail.C: another naming problem: should not name vars like that: unpredictable close caused problems with later sending mail: Mar 20 06:39:53 pt-6 sendmail[19044]: File descriptors missing on startup: stdin; Bad file number todo: find out why so many filters(stream) here. probably wrong? * src/: include/pa_dictionary.h, include/pa_string.h, main/pa_common.C, main/pa_dictionary.C, main/pa_string.C, main/untaint.C: test compiled * src/: classes/image.C, classes/mail.C, classes/math.C, classes/string.C, include/pa_dictionary.h, include/pa_hash.h, include/pa_memory.h, include/pa_string.h, lib/cord/cordbscs.c, lib/cord/cordxtra.c, lib/pcre/dftables.c, lib/pcre/get.c, lib/pcre/maketables.c, lib/pcre/pcre.c, lib/pcre/pcre.h, lib/pcre/pcre_parser_ctype.c, lib/pcre/study.c, main/compile.tab.C, main/pa_common.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_memory.C, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_vfile.h, types/pa_vmail.C: untaint.C 99% [except mail&sql&optimize] * parser3.dsw, src/classes/file.C, src/classes/image.C, src/classes/op.C, src/classes/string.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_common.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_request_charsets.h, src/include/pa_sql_connection.h, src/include/pa_string.h, src/main/compile.tab.C, src/main/execute.C, src/main/pa_charset.C, src/main/pa_common.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_stylesheet_manager.C, src/main/untaint.C, src/sql/pa_sql_driver.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_value.C, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_venv.h, src/types/pa_vform.C, src/types/pa_vmail.C, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vresponse.C, src/types/pa_vstatus.C, src/types/pa_vstring.C, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_wcontext.h: untaint.C 30%, pa_common.C [done, without http for now] 2003-03-19 paf * src/: classes/date.C, classes/form.C, classes/hash.C, classes/image.C, classes/mail.C, classes/op.C, classes/xdoc.C, classes/xnode.C, include/pa_array.h, include/pa_config_fixed.h, include/pa_exception.h, include/pa_memory.h, include/pa_sapi.h, include/pa_string.h, include/pa_table.h, main/compile.C, main/compile_tools.C, main/execute.C, main/pa_charset.C, main/pa_common.C, main/pa_exception.C, main/pa_request.C, main/pa_socks.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.C, types/pa_vcookie.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vmail.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: started test * src/lib/pcre/: dftables.c, get.c, maketables.c, pcre.c, pcre.dsp, pcre.h, pcre_parser_ctype.c, study.c: restored bad replaces * src/: classes/op.C, include/pa_array.h, include/pa_memory.h, include/pa_string.h, main/pa_string.C: string compiled todo: test it * src/: classes/classes.dsp, classes/string.C, classes/table.C, include/pa_array.h, include/pa_common.h, include/pa_dictionary.h, include/pa_exception.h, include/pa_string.h, include/pa_table.h, lib/cord/cord.dsp, main/compile.tab.C, main/main.dsp, main/pa_common.C, main/pa_string.C, targets/cgi/parser3.dsp, types/pa_method.h, types/pa_value.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/types.dsp: string reimplementation with cord+array: 70% 2003-03-18 paf * src/: classes/date.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_hash.h, include/pa_string.h, main/pa_string.C, types/pa_vmail.C: lots of replacements, todo:we can ignore lang in cmp and pos really, but would split properly! * src/lib/cord/: cord.dsp, cordbscs.c, cordprnt.c, cordxtra.c: gc: cord part made parser/src/lib: it's not compiled into libgc by default * parser3.dsw, src/classes/classes.dsp, src/classes/classes.h, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/include/Makefile.am, src/include/pa_cache_managers.h, src/include/pa_charset.h, src/include/pa_charsets.h, src/include/pa_common.h, src/include/pa_dictionary.h, src/include/pa_exception.h, src/include/pa_exec.h, src/include/pa_globals.h, src/include/pa_hash.h, src/include/pa_memory.h, src/include/pa_pool.h, src/include/pa_request.h, src/include/pa_request_charsets.h, src/include/pa_sapi.h, src/include/pa_sql_connection.h, src/include/pa_sql_driver_manager.h, src/include/pa_string.h, src/include/pa_stylesheet_connection.h, src/include/pa_stylesheet_manager.h, src/include/pa_table.h, src/include/pa_uue.h, src/lib/pcre/get.c, src/main/Makefile.am, src/main/compile.C, src/main/compile.tab.C, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/main.dsp, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_globals.C, src/main/pa_memory.C, src/main/pa_pool.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_manager.C, src/main/pa_table.C, src/main/pa_uue.C, src/main/untaint.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.C, src/types/pa_junction.h, src/types/pa_method.h, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_venv.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.C, src/types/pa_vhash.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C, src/types/pa_vmath.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.C, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, src/types/types.dsp: started porting to gc: PA_Object done lots of replacements also * src/: include/pa_pool.h, main/execute.C, targets/cgi/pa_pool.C: gc logging 2003-03-17 paf * src/classes/date.C, src/classes/file.C, src/classes/form.C, src/classes/image.C, src/classes/mail.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_pool.h, src/include/pa_pragma_pack_begin.h, src/include/pa_pragma_pack_end.h, src/include/pa_string.h, src/include/pa_types.h, src/main/compile.C, src/main/compile.tab.C, src/main/execute.C, src/main/pa_charset.C, src/main/pa_common.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_globals.C, src/main/pa_pool.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_manager.C, src/main/pa_uue.C, src/main/untaint.C, src/targets/cgi/pa_pool.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, src/targets/cgi/pool_storage.h, src/types/pa_vcookie.C, src/types/pa_vdouble.h, src/types/pa_vfile.C, src/types/pa_vform.C, src/types/pa_vint.h, src/types/pa_vmail.C, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, www/htdocs/.htaccess, www/htdocs/auto.p: libgc attempt 2003-03-13 paf * src/: include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, targets/cgi/parser3.C: lt_dlexit called * src/include/pa_request.h, src/lib/ltdl/libltdl.dsp, src/lib/md5/md5.dsp, src/main/compile.tab.C, src/main/execute.C, src/main/pa_request.C, src/targets/cgi/parser3.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vobject.h, src/types/pa_vstateless_class.h, src/types/pa_vstatus.C, src/types/types.dsp, www/htdocs/.htaccess: set_base, set_derived simplified [counter leaks fixed] * ChangeLog, src/include/pa_config_fixed.h, src/types/pa_vstatus.C, src/types/types.dsp: incorporated status class patch From: "Victor Fedoseev" Sent: Thursday, January 23, 2003 8:14 AM now we have $status.rusage.maxrss,tv_sec,tv_usec un WIN32 [plus Win32 specific: QuotaPeakNonPagedPoolUsage QuotaPeakPagedPoolUsage PeakPagefileUsage] 2003-03-12 paf * configure, configure.in, src/lib/ltdl/configure, src/lib/ltdl/configure.in, src/targets/cgi/Makefile.am: lib/ltdl/Makefile now created by /configure.in only [were by lib/ltdl/configure.in OVERWRITE] * configure, configure.in, src/targets/cgi/Makefile.am: libstdc++ linkage fixed for g++ 3.2.2 * src/include/pa_stylesheet_manager.h: gcc 3.2 rightliy complained on using privately declared class [fixed] * src/: include/pa_sql_driver_manager.h, main/compile.tab.C: gcc 3.2 rightliy complained on using privately declared class [fixed] * src/targets/cgi/parser3.C: 1. more detailed log on signals. 2. sigpipe before request constructor now causes death * src/: include/pa_request.h, main/compile.tab.C, main/execute.C, targets/cgi/parser3.C: SIGPIPE now can be intercepted and does not cause exception in exception handler * configure, configure.in, src/targets/cgi/Makefile.am: configure now default links libstdc++ statically. that can be overriden by --with-dynamic-stdcpp 2003-03-11 paf * src/main/compile.tab.C, src/main/compile.y, src/sql/pa_sql_driver.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, www/htdocs/.htaccess: removed necessity of libstdc++ * src/include/pa_request.h: ANTI_ENDLESS_EXECUTE_RECOURSION doubled * src/include/pa_request.h: ANTI_ENDLESS_EXECUTE_RECOURSION doubled 2003-03-08 paf * tests/Makefile: make install & co * src/: include/pa_request.h, classes/op.C: removing vclass,object.h -> pa_request.h dependency * src/: classes/mail.C, classes/response.C, include/pa_request.h, main/pa_request.C: removing vform,response,cookie.h -> pa_request.h dependency * src/include/pa_request.h: removing vmail.h -> pa_request.h dependency [testing...] * src/: include/pa_config_fixed.h, types/pa_vxdoc.C: yet another return 0; fixed * src/: include/pa_config_fixed.h, types/pa_vmail.C, types/pa_vmail.h: vmail.C received just compiled [not tested] * src/classes/xdoc.C: forgotten: global xdoc when ndef XML * src/main/pa_request.C: forgotten: ifdef XML * src/main/pa_request.C, www/htdocs/.htaccess: forgotten: ifdef XML * src/targets/cgi/parser3.C: todo: move to latest xml version on win32 and run memleak tests again * src/targets/cgi/parser3.C: charsets: see some strange things with old xml lib-- it's internal memory handling has faults * src/: include/pa_types.h, main/pa_charset.C: charsets: fixed problems when transcode from charset A to A. * src/: main/untaint.C, types/pa_vmail.C: mail: transcode fixed. todo: still problems when transcode from charset A to A. * src/classes/hash.C, src/classes/mail.C, src/classes/string.C, src/classes/table.C, src/include/pa_array.h, src/main/pa_sql_driver_manager.C, src/types/pa_vmail.C, src/types/pa_vmail.h, www/htdocs/.htaccess, www/htdocs/index.html: started full-scale-site-test [~ http://parser.ru sources] some fixes * tests/: 021.html, 031.html, 033.html, 109.html, 110.html, 111.html, 112.html, 113.html, 114.html, 115.html, 116.html, 117.html, 118.html, 119.html, 120.html, results/109.processed, results/110.processed, results/111.processed, results/112.processed, results/113.processed, results/114.processed, results/115.processed, results/116.processed, results/117.processed, results/118.processed, results/119.processed, results/120.processed: xml: tests 109 dom create/show 110 xpath selectSingle 111 xdoc.create from tainted & 112 xdoc.create/output with russian attr value 113 xpath selectString/Number 114 dom attributes.count 115 xpath selectBool 116 output media-type change 117 transform by dom stylesheet 118 empty transform result 119 dom setAttribute 120 nbsp letter output =END OF PREPARED XML TESTS= 2003-03-07 paf * src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_stylesheet_connection.h, tests/108.html, tests/108.xsl, tests/results/108.processed: xml: test 108 transform with params [bugs fixed] * src/: main/pa_charset.C, targets/cgi/parser3.C: fixed: mem leak from copy/paste bug * src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_request.h, src/main/execute.C, src/main/pa_charset.C, src/main/pa_exception.C, src/main/pa_globals.C, src/main/pa_request.C, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, tests/107.html, tests/results/107.processed: xml: test: 107 bug fixes * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_value.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: test: 107 bug fixes * tests/: 106.html, results/106.processed: test: 106 xdoc create, string * src/include/pa_charset.h, src/main/pa_charset.C, www/htdocs/.htaccess: xml: charset two mem alloc functions used for different cases [libxml, libxsl] * src/classes/classes.C: fixed: prevent system classes from modification to lock ALL the classes, not only directly used * src/: classes/xdoc.C, types/pa_vxdoc.h, types/pa_vxnode.h: xml: linked * src/: classes/xdoc.C, types/pa_vxdoc.h: xdoc.C compiled 2003-03-06 paf * src/classes/xdoc.C: xdoc.C 50% * src/: classes/xnode.C, classes/xnode.h, include/pa_charset.h, include/pa_memory.h, include/pa_request.h, include/pa_string.h, main/pa_globals.C, main/pa_request.C, main/pa_stylesheet_manager.C: xnode.C compiled * src/: include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: xml: stylesheet&manager done * src/: include/pa_memory.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C: xml: stylesheet&manager STARTED * src/: include/pa_globals.h, main/pa_charset.C, main/pa_exception.C, main/pa_globals.C: xml: exceptions * src/: include/pa_charset.h, include/pa_config_fixed.h, include/pa_memory.h, include/pa_pool.h, main/pa_charset.C, main/pa_memory.C, main/pa_pool.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: xml: charsets * tests/023.html: in some cases it rounded up badly. postponing solution of that problem, making more simple test * tests/: 058_paf2000.png, results/058.processed: .png added with -kb now * src/include/pa_charset.h, src/include/pa_charsets.h, src/main/pa_charset.C, src/main/pa_charsets.C, www/htdocs/.htaccess: charset_utf8 declaration moved to charsets.C 2003-03-05 paf * src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C, tests/105.html, tests/results/105.processed: String::match bug fixed * src/classes/op.C, src/main/main.dsp, tests/104.html, tests/results/104.processed, www/htdocs/.htaccess: ^bpt operator added [does int3 in debug build on win32] * tests/: 057.html, results/057.processed: test bug fixed * www/htdocs/: auto.p, autoptr.html, base.p, derived.p, font.gif, global.xsl, index.html, mailreceive.eml, mailreceive.html, operators.p, parser-status.html, people.dtd, some.p: removed old tests * src/targets/cgi/Makefile.am: linker needed more tricks to link OK * src/classes/math.C: can be: crypt in -lcrypt OK, but crypt.h be missing * src/: include/Makefile.am, main/Makefile.am, types/Makefile.am: forgotten files added to Makes * ltmain.sh: ltmain.sh added * src/types/: pa_vhash.C, pa_vhash.h: hash_default_element_name change undone ;( * src/types/: pa_vhash.C, pa_vhash.h: hash_default_element_name made static * src/: classes/math.C, classes/op.C, classes/string.C, main/pa_exec.C, targets/cgi/Makefile.am: gcc more happy. todo:make linker happy * src/: classes/file.C, include/pa_exec.h, main/pa_exec.C: pa_exec env param made optional 2003-03-04 paf * src/: classes/image.C, include/pa_request.h, include/pa_stack.h, types/pa_vimage.h: number of gcc compiler bugs fixed * tests/: 103.html, 103mark.gif, 103paf2001.gif, results/103.processed: tests: 103 image.copy transparence test * src/main/execute.C, tests/101.html, tests/102.html, tests/results/101.processed, tests/results/102.processed: tests: 101 method/variable name conflict test 102 form fields change should not not change anything [bug fix] * tests/: 057.html, 099.html, 100.html, results/057.processed, results/099.processed, results/100.processed: tests: 57 date create 2002: added 99,100 response:body/download * src/classes/image.C, tests/098.html, tests/098font.gif, tests/results/098.processed: test: 98 image font text [bug fixed] * src/main/pa_common.C, src/targets/cgi/parser3.C, tests/097.html, tests/results/097.processed: test: 97 file::load http:// [bugs fixed] * src/classes/hash.C, src/classes/image.C, src/classes/table.C, src/include/pa_memory.h, tests/096.html, tests/096_dir/163.jpg, tests/096_dir/188.jpg, tests/results/096.processed: tests: 96 image EXIF [bug fixed] * src/classes/table.C, src/main/execute.C, tests/061.dat, tests/061.html, tests/062.html, tests/063.html, tests/064.html, tests/065.html, tests/066.html, tests/067.html, tests/068.html, tests/069.html, tests/070.html, tests/071.html, tests/072.html, tests/073.html, tests/074.html, tests/075.html, tests/076.html, tests/077.html, tests/078.html, tests/080.html, tests/081.html, tests/082.html, tests/083.html, tests/084.html, tests/085.html, tests/086.html, tests/087.html, tests/088.html, tests/089.html, tests/090.html, tests/091.html, tests/092.html, tests/093.html, tests/094.html, tests/095.html, tests/results/061.processed, tests/results/062.processed, tests/results/063.processed, tests/results/064.processed, tests/results/065.processed, tests/results/066.processed, tests/results/067.processed, tests/results/068.processed, tests/results/069.processed, tests/results/070.processed, tests/results/071.processed, tests/results/072.processed, tests/results/073.processed, tests/results/074.processed, tests/results/075.processed, tests/results/076.processed, tests/results/077.processed, tests/results/078.processed, tests/results/080.processed, tests/results/081.processed, tests/results/082.processed, tests/results/083.processed, tests/results/084.processed, tests/results/085.processed, tests/results/086.processed, tests/results/087.processed, tests/results/088.processed, tests/results/089.processed, tests/results/090.processed, tests/results/091.processed, tests/results/092.processed, tests/results/093.processed, tests/results/094.processed, tests/results/095.processed, tests/079.html, tests/results/079.processed: tests: 61 file::stat size 62 string->int autoconvert 63 double .int,dec,div,mul 64 date compare 65 file: basename,justname,justext 66 math:crypt 67 string.match simple on long 68 string.match normalized simple on long 69 string.int 70 file::stat content-type 71 table.join 72 hash parameter conditional pass 73 date daylightsaving,yearday 74 date arithmetics 75 response date values/attributes 76 string.pos of void, void.pos 77 syntax parsing 78 cookie tainting 79 switch with local 80 scientific numeric literal in string autoconvert 81 xor: logical and numerical 82 for delims 83 menu delims 84 table.hash distinct 85 long string replace 86 throw+catch current language preserve 87 bit shifts 88 junction tests + $caller test 89 hash.foreach selfmodification 90 int/void to int 91 $caller test 92 junction is + def junction tests 93 $caller test 94 syntax test 95 table.hash(keygenerator) [bug fixed] * src/main/: execute.C, pa_table.C: test: 59 table.locate [bug fixed] 60 string eq string [bug fixed] * tests/: 053.html, 054.html, 055.html, 056.html, 057.html, 058.html, 058_paf2000.png, 059.html, 060.html, results/053.processed, results/054.processed, results/055.processed, results/056.processed, results/057.processed, results/058.processed, results/059.processed, results/060.processed: test: 53 string.replace 54 junctions 55 table.hash 56 call indirect 57 date.create[string] 58 image.measure[png] * tests/: 052.html, outputs/049.processed, outputs/050.processed, outputs/051.processed, results/052.processed: test: 52 pre/match/post test: passed AS-IT-WERE, but wrong :) separate task: fix that 2003-03-03 paf * tests/: 043.html, 044.html, 045.html, 046.html, 047.html, 048.html, 049.html, 050.html, 051.html, 051b.p, 051t.p, Makefile, parser-cygwin.sh, parser-unix.sh, run_parser.sh, outputs/049.processed, outputs/050.processed, outputs/051.processed, results/001.processed, results/002.processed, results/003.processed, results/005.processed, results/006.processed, results/008.processed, results/009.processed, results/011.processed, results/012.processed, results/013.processed, results/014.processed, results/015.processed, results/016.processed, results/017.processed, results/020.processed, results/021.processed, results/022.processed, results/024.processed, results/025.processed, results/026.processed, results/027.processed, results/028.processed, results/029.processed, results/030.processed, results/031.processed, results/049.processed, results/050.processed, results/051.processed, results/043.processed, results/044.processed, results/045.processed, results/046.processed, results/047.processed, results/048.processed: tests: 43,44,45 date rolls 46 autoevaluating junction 47 table.select 48 name with subvar 49 hash-creating switch 50 process 51 started parent/child, works as it were but it were NOT GOOD, created separate task to fix that * tests/: 042.html, results/042.processed: test: 42 exception.handled * tests/: 041.html, results/041.processed: test: 41 table.locate by expression * tests/: 040.html, results/040.processed: test: 39 method result of type table 40 method param junction auto evaluate * tests/: 039.html, results/039.processed: test: 37 method result of type table * src/main/pa_request.C, src/types/pa_vmath.C, tests/033.html, tests/034.html, tests/035.html, tests/036.html, tests/037.html, tests/038.html, tests/results/033.processed, tests/results/034.processed, tests/results/035.processed, tests/results/036.processed, tests/results/037.processed, tests/results/038.processed: tests: 33 string.replace 34 string.upper 35 table created 36 local/global vars with juntions 37 table clone 38 math PI & number formatting math class registring typo fixed * src/classes/op.C, src/include/pa_request.h, src/include/pa_string.h, src/main/execute.C, src/main/pa_request.C, src/main/pa_string.C, src/main/untaint.C, src/types/pa_vcode_frame.h, src/types/pa_wcontext.h, tests/032.html, tests/results/032.processed: uchar changed to String_UL in all places [was not everywhere] untaint test: 032 * src/targets/cgi/parser3.C, tests/004.html, tests/Makefile, tests/results/004.processed, www/htdocs/.htaccess, tests/parser-cygwin.sh, tests/parser-unix.sh: removed -H command line key, now testing using .sh file with SERVER_SOFTWARE=xxx 2003-02-26 paf * src/main/execute.C, src/types/pa_vstateless_class.h, tests/024.html, tests/025.html, tests/026.html, tests/027.html, tests/028.html, tests/029.html, tests/030.html, tests/031.html, tests/results/024.processed, tests/results/025.processed, tests/results/026.processed, tests/results/027.processed, tests/results/028.processed, tests/results/029.processed, tests/results/030.processed, tests/results/031.processed: fixed bug with name_cstr mutable CharPtr more tests * src/: include/pa_sapi.h, main/pa_globals.C, main/pa_memory.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: SAPI::abort << abort. die now just exits * src/classes/classes.awk, src/classes/classes.h, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_memory.h, src/include/pa_sapi.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_venv.h, src/types/pa_vform.C, tests/015.html, tests/016.html, tests/017.html, tests/018.html, tests/019.html, tests/019paf2001.gif, tests/020.html, tests/021.html, tests/022.html, tests/023.html, tests/022_dir/a.html, tests/022_dir/b.txt, tests/022_dir/c.htm, tests/results/015.processed, tests/results/016.processed, tests/results/017.processed, tests/results/018.processed, tests/results/019.processed, tests/results/020.processed, tests/results/021.processed, tests/results/022.processed, tests/results/023.processed: methoded_array now contains all Mxxx classes SAPI::get_env now returns info on pool more tests * src/include/pa_array.h, src/include/pa_hash.h, src/include/pa_memory.h, src/main/pa_charset.C, tests/001.html, tests/002.html, tests/003.html, tests/004.html, tests/005.html, tests/006.html, tests/007.html, tests/008.html, tests/009.html, tests/010.html, tests/011.html, tests/012.html, tests/013.html, tests/014.html, tests/Makefile, tests/outputs/create-dir, tests/results/001.processed, tests/results/002.processed, tests/results/003.processed, tests/results/004.processed, tests/results/005.processed, tests/results/006.processed, tests/results/007.processed, tests/results/008.processed, tests/results/009.processed, tests/results/010.processed, tests/results/011.processed, tests/results/012.processed, tests/results/013.processed, tests/results/014.processed: hash cloning fixed 2003-02-25 paf * src/main/pa_common.C: typo fixed 2003-02-24 paf * src/types/pa_vcookie.C: fixed all places with bad get_string(0) [one remained] * src/: include/pa_request.h, main/execute.C: few bad get_string(0) [should have been get_string(&pool)] todo: check other such calls * src/: main/compile.tab.C, main/execute.C, types/pa_vfile.h: test10, bad lookups xxx* xxx=smartptr.get(); << is bad style, after ";" original object got destructed, and xxx points to sky * ChangeLog, src/classes/string.C: match bug fixed * src/types/pa_vmail.C: body [text/html] transcoded to $.charset[specified] now * src/main/pa_common.C: stupid gcc [2.95.4] generated bad code which failed to handle sigsetjmp+throw: crashed inside of pre-throw code. rewritten simplier [though duplicating closesocket code] * src/main/pa_common.C: stupid gcc [2.95.4] generated bad code which failed to handle sigsetjmp+throw: crashed inside of pre-throw code. rewritten simplier [though duplicating closesocket code] 2003-02-21 paf * operators.txt, src/targets/cgi/parser3.C, src/types/pa_vcookie.C: $cookie:name[$.expires[date << can be now]] written makefile with regression tests [raw] * src/targets/cgi/parser3.C: MAKE_TEST must be used inside of 'make tests' only [it's not forcing CGI mode now] now use -H to output CGI header when parser used in command line [useful for tests also] * src/targets/cgi/parser3.C: MAKE_TEST environment variable switches on CGI mode, and is used in regression tests * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, types/pa_vcookie.h, types/pa_venv.h: env fixed * src/: include/pa_memory.h, main/pa_memory.C: inlined memory handling pa_* * src/: include/pa_memory.h, main/pa_memory.C, include/pa_array.h, include/pa_exception.h, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_array.C, main/pa_pool.C: reorganized memory handling files * src/main/pa_array.C: pool::format_integer terminator fixed * src/main/execute.C, src/targets/cgi/parser3.C, www/htdocs/autoptr.html: release mode now compiles OK test to show benefits of free * src/: classes/file.C, classes/image.C, classes/mail.C, classes/op.C, classes/xdoc.C, main/pa_charset.C, main/pa_exec.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, types/pa_vimage.C, types/pa_vxdoc.h: fixed all cstr's that must use pool [as the one in ^process] * src/classes/op.C: fixed process. sould now check for all cstr's -- some must use pool [as the one in ^process] 2003-02-20 paf * src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/main/pa_string.C, src/types/pa_method.h, src/types/pa_value.C, src/types/pa_vmethod_frame.h, www/htdocs/autoptr.html: string cmp fixed * src/: include/pa_config_fixed.h, targets/cgi/parser3.C: form values passed OK now 2003-02-19 paf * src/: classes/form.C, include/pa_charset.h, include/pa_pool.h, main/pa_charset.C, main/pa_exception.C, main/pa_request.C, main/pa_stylesheet_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.dsp, types/pa_vcookie.C, types/pa_vform.C, types/pa_vmail.C, types/pa_vxnode.C: found&kill all remaning leaks resulted from pooled::malloc calls [excluding in gd -- planning complete rewrite extremely ugly code] * src/targets/isapi/: pa_pool.C, pool_storage.h: removed unneeded files 2003-02-17 paf * src/: classes/date.C, classes/double.C, classes/file.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/response.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.h, include/pa_stack.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, sql/pa_sql_driver.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.h, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h, types/pa_wcontext.h, types/pa_wwrapper.h: fixed all remained bugs of unitialized simple-typed field * src/: classes/classes.C, classes/classes.h, main/execute.C, main/pa_charset.C, main/pa_request.C: another bug of unitialized simple-typed field fixed. todo: find&kill all like that one * src/: main/execute.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h: few bugs in debug output fixed * src/: include/pa_stack.h, main/compile.C, main/execute.C, main/pa_request.C: stack-stored items need extra .ref to prevent object_ptr from delete[them] * src/: classes/date.C, classes/op.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_array.h, include/pa_charset.h, main/Makefile.am, main/main.dsp, main/pa_charset.C, main/pa_common.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vmail.C: fixed more leaks resulted from pooled::malloc calls * src/: main/pa_request.C, targets/cgi/parser3.C, types/pa_vfile.C: couple mem leaks rusulted from old pooled::malloc usage. todo:find more like those * src/main/: compile.C, compile_tools.C: 2*2! * src/: include/pa_array.h, include/pa_request.h, main/execute.C: stackItem fixed [there were no string on stack before] * src/: main/execute.C, main/pa_request.C, types/pa_vmethod_frame.C: first letters out OK * src/: classes/classes.C, include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_value.h, types/pa_vint.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vvoid.h, types/pa_wcontext.h: class fields of simple type not initialized with zeros :( while class fields of class types initialized with default constructors. learn C++ * src/: classes/classes.awk, classes/double.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/xdoc.C, classes/xnode.C, include/pa_array.h, include/pa_string.h, main/pa_exec.C, types/pa_vmail.C: parser3.exe - 0 error(s), 0 warning(s) 2003-02-14 paf * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C: 13 link errors * src/: classes/file.C, include/pa_request.h, main/pa_request.C, main/pa_sql_driver_manager.C, targets/cgi/parser3.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vimage.C, types/pa_vtable.C: all compiled, only 14 link errors :) * src/: classes/classes.C, classes/classes.awk, classes/file.C, classes/hash.C, classes/mail.C, classes/op.C, include/pa_common.h, include/pa_request.h, include/pa_sapi.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C: classes.lib - 0 error(s), 0 warning(s) parser.C compiled * src/: classes/classes.dsp, classes/op.C, classes/string.C, classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vhash.h, types/pa_vint.h, types/types.dsp: op compiled * src/: classes/classes.dsp, classes/response.C, classes/string.C, include/pa_dictionary.h, include/pa_string.h, main/pa_string.C, main/untaint.C, types/pa_vtable.h: string, response compiled 2003-02-07 paf * src/: classes/table.C, types/pa_vtable.h: table compiled 2003-02-06 paf * src/: classes/mail.C, include/pa_request.h, main/pa_request.C: mail compiled * src/: classes/image.C, classes/string.C, classes/xdoc.C, include/pa_common.h, include/pa_hash.h, main/pa_common.C, types/pa_vfile.h, types/pa_vimage.h: image compiled * src/classes/: file.C, form.C: form compiled * src/: classes/classes.dsp, classes/file.C, include/pa_common.h, include/pa_exec.h, main/pa_common.C, main/pa_exec.C, types/pa_vfile.C, types/pa_vfile.h: file compiled * src/: classes/hash.C, classes/math.C, types/pa_vmath.C, types/pa_vmath.h: math compiled [win32] * src/: classes/hash.C, include/pa_hash.h, include/pa_table.h, types/pa_vstring.h: hash compiled 2003-02-04 paf * src/: classes/date.C, classes/hash.C, include/pa_exec.h, include/pa_hash.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, main/pa_common.C, main/pa_exec.C, main/pa_string.C, types/pa_method.h, types/pa_vform.C, types/pa_vhash.h: hash 50% compiled * src/: classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_request.h, main/pa_globals.C, main/pa_string.C: date compiled * src/classes/: classes.dsp, double.C: double compiled * src/: classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vxdoc.h, types/pa_vxnode.h: int compiled * src/: classes/date.C, classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_vvoid.h: void compiled :) * src/: include/pa_globals.h, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_pool.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_uue.C, main/untaint.C, types/pa_value.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vimage.C, types/pa_vmath.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vstateless_class.C, types/pa_vstatus.C, types/pa_vstring.C, types/pa_vtable.C, types/pa_wcontext.C, types/types.dsp: removed stupid value_includes.h * src/types/: pa_value.C, pa_value_includes.h, pa_vrequest.C: trying to remove stupid value_includes.h * src/main/pa_exec.C: pa_exec compiled on win32 * src/main/pa_exec.C: libmain.a compiled on six [unix] * src/: include/pa_globals.h, include/pa_request.h, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vcookie.C, types/pa_vdate.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vmail.C, types/pa_vobject.C, types/pa_vrequest.C, types/pa_vstateless_class.C, types/pa_vstatus.C, types/pa_vtable.C: libtypes.a compiled gcc * src/: include/pa_config_includes.h, include/pa_dictionary.h, main/pa_common.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_socks.C: libmain.a gcc and mail.lib msvc++ compiled * src/: include/pa_array.h, include/pa_config_includes.h, include/pa_dictionary.h, main/pa_dictionary.C, main/pa_exec.C, main/pa_socks.C, main/pa_sql_driver_manager.C: gcc libmain.a compiled * src/main/pa_globals.C: merged changes from 1.149-1.150 (stupid name conflicts) * src/: main/compile_tools.h, main/execute.C, main/pa_table.C, types/pa_vmethod_frame.h, types/pa_vvoid.h: yuk: gcc on cygwin yelds "virtual memory exhausted" while trying to compile execute.C [eating up to 127MB] 2003-02-03 paf * src/: include/pa_config_includes.h, include/pa_hash.h, include/pa_operation.h, include/pa_pool.h, include/pa_string.h, main/pa_common.C, types/pa_value.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/types.dsp: started gcc compiling pa_common compiled * src/: include/pa_exception.h, include/pa_pool.h, main/pa_exception.C: exception gcc change #1 * src/include/: Makefile.am, pa_hash.h, pa_pool.h: gcc refused to compile _P identifier. it replaced it to some strange 0x0000040 * src/types/: pa_vmath.C, pa_vmethod_frame.C: vmath compiled * src/types/pa_vtable.C: vtable compiled * src/types/: pa_vstring.C, pa_vstring.h: vstring compiled * src/: include/pa_cache_managers.h, main/pa_request.C, types/pa_vstatus.C, types/pa_vstatus.h: vstatus compiled * src/types/pa_vstateless_class.C: vstateless_class compiled * src/types/: pa_vresponse.C, pa_vresponse.h: vresponse compiled * src/types/pa_vrequest.C: vrequest compiled * src/types/: pa_value.C, pa_value.h, pa_vclass.C, pa_vclass.h, pa_vobject.C, pa_vobject.h: vobject compiled * src/: classes/form.C, classes/mail.C, include/pa_request.h, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vform.C, types/pa_vmail.C, types/pa_vmail.h: vmail compiled * src/types/: pa_vimage.C, pa_vimage.h: vimage compiled * src/: include/pa_pool.h, main/pa_request.C, types/pa_value.C, types/pa_vclass.C, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vform.C, types/pa_vform.h, types/pa_vobject.h: vform compiled * src/: include/pa_request.h, main/execute.C, main/pa_request.C: main.lib - 0 error(s), 0 warning(s) * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.h: execute compiled 2003-01-31 paf * src/: include/pa_array.h, include/pa_operation.h, include/pa_request.h, main/execute.C, main/main.dsp, types/pa_vjunction.h: started last file from main library: execute * src/: include/pa_request.h, include/pa_sapi.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vhash.h: pa_request compiled * src/: classes/op.C, classes/string.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_sql_connection.h, main/compile.tab.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vform.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vresponse.h, types/pa_vtable.h, types/pa_wcontext.C, types/pa_wcontext.h, types/types.dsp: most pa_request compiled * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_operation.h, include/pa_pool.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/ltdl/config_fixed.h, lib/ltdl/ltdl.c, lib/ltdl/ltdl.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/dftables.c, lib/pcre/get.c, lib/pcre/maketables.c, lib/pcre/pcre.c, lib/pcre/pcre.h, lib/pcre/pcre_parser_ctype.c, lib/pcre/study.c, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/getopt.c, targets/cgi/getopt.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_value.C, types/pa_value.h, types/pa_value_includes.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: grammar compiled * ChangeLog, src/classes/classes.h, src/classes/op.C, src/include/pa_cache_managers.h, src/include/pa_charset.h, src/include/pa_charsets.h, src/include/pa_common.h, src/include/pa_dictionary.h, src/include/pa_exception.h, src/include/pa_exec.h, src/include/pa_pool.h, src/include/pa_request.h, src/include/pa_sapi.h, src/include/pa_sql_connection.h, src/include/pa_sql_driver_manager.h, src/include/pa_string.h, src/include/pa_table.h, src/include/pa_uue.h, src/main/compile.C, src/main/compile.tab.C, src/main/compile_tools.C, src/main/compile_tools.h, src/main/main.dsp, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_table.C, src/main/pa_uue.C, src/main/untaint.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vclass.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_venv.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C, src/types/pa_vmath.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.h, src/types/pa_vstring.h, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, www/htdocs/.htaccess: ConstStringPtr died, long live StringPtr 2003-01-30 paf * src/: include/pa_charset.h, include/pa_request.h, include/pa_sql_driver_manager.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_request.C, types/pa_vobject.h, types/pa_vstatus.h: grammar compiled * src/: classes/classes.h, include/pa_pool.h, main/compile.C, main/compile.tab.C, types/pa_value.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/types.dsp: vstateless_class compiled * src/main/compile.C: compile compiled * src/: include/pa_array.h, include/pa_operation.h, include/pa_table.h, main/compile_tools.C, main/compile_tools.h, main/pa_table.C: compile_tools compiled * src/: include/pa_operation.h, main/compile.y, main/compile_tools.C, main/compile_tools.h: started compile_tools. vagues ideas of how to free compiled code * src/: include/pa_opcode.h, main/compile_tools.h, main/execute.C, main/main.dsp, types/pa_value.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h: value compiled 2003-01-29 paf * src/: include/pa_globals.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_wcontext.h, types/types.dsp: vmethodframe, pa_request.h compiled * src/lib/ltdl/config_fixed.h: libltdl compiled without warnings now * src/: include/pa_array.h, include/pa_exception.h, include/pa_pool.h, main/pa_exception.C: gd compiled * src/types/: pa_vfile.C, pa_vfile.h, pa_vimage.C, pa_vimage.h: gd compiled * src/: classes/file.C, include/pa_globals.h, main/pa_globals.C, types/pa_value.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h: vfile compiled * src/: include/pa_common.h, include/pa_globals.h, include/pa_string.h, main/pa_globals.C, types/pa_value.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vform.C, types/pa_vform.h: vcookie compiled * src/: include/pa_exception.h, main/pa_cache_managers.C, main/pa_charsets.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_pool.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_uue.C: #include "pa_value_includes.h" everywhere in main * src/: include/pa_request_charsets.h, include/pa_request_info.h, main/main.dsp, main/untaint.C: more compiled * src/: include/pa_charsets.h, include/pa_request.h, include/pa_request_info.h, include/pa_string.h, main/pa_charsets.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vresponse.h: vrequest compiled * src/types/: pa_value.h, pa_vdate.h, pa_vform.h, pa_vhash.h, pa_vobject.C, pa_vobject.h, pa_vrequest.C, pa_vresponse.C, pa_vresponse.h, pa_wcontext.h: vrequest compiled * src/: classes/classes.h, include/pa_charset.h, include/pa_charsets.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/main.dsp, main/pa_charset.C, main/pa_charsets.C, main/pa_globals.C, main/untaint.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vmath.C, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vvoid.h: vrequest,vdouble,vint compiled * src/: classes/classes.h, classes/math.C, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, main/main.dsp, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vjunction.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.h, types/types.dsp: vmath compiled 2003-01-28 paf * src/: classes/classes.h, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/table.C, classes/xdoc.C, classes/xnode.h, main/execute.C, main/main.dsp, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.h: started main: compile_tools * src/: include/pa_charset.h, include/pa_exception.h, include/pa_request.h, include/pa_string.h, main/untaint.C: untaint compiled * ChangeLog, src/include/pa_array.h, src/include/pa_string.h, src/main/execute.C, src/main/untaint.C, src/types/pa_vmail.C: more compiled. struck with string::store_to needing to know source/client charsets * src/: include/pa_exception.h, include/pa_uue.h, main/pa_uue.C, types/pa_vfile.h: uue compiled * src/: include/pa_table.h, main/pa_string.C, main/pa_table.C: table compiled * src/: include/pa_cache_managers.h, main/pa_cache_managers.C, main/pa_globals.C, main/pa_sql_driver_manager.C: globals compiled * src/: include/pa_charset.h, main/pa_charset.C, main/pa_charsets.C: charset/s simplified [charset::pool_for_load introduced] * src/: classes/date.C, include/pa_charset.h, include/pa_charsets.h, include/pa_globals.h, main/pa_charset.C, main/pa_charsets.C, main/pa_globals.C, main/pa_request.C: pa_charsets compiled * src/: include/pa_array.h, include/pa_exec.h, include/pa_hash.h, include/pa_pool.h, main/pa_exec.C: pa_exec win32 compiled * src/: include/pa_pool.h, main/pa_common.C, types/pa_vdouble.h: common compiled * src/: include/pa_charsets.h, main/pa_charsets.C, main/pa_sql_driver_manager.C: pa_charsets compiled * src/: include/pa_array.h, include/pa_charset.h, include/pa_charsets.h, include/pa_pool.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, main/pa_sql_driver_manager.C, types/pa_vhash.h, types/pa_vint.h: sql_driver_manager compiled * etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: ukranian letter i with two dots added to koi, all ukranian letters added to win1251. typographic simbol 0xb9 deleted from win1251 [strange one & were abscent from koi] 2003-01-27 paf * src/: include/pa_exception.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_string.h, main/pa_common.C, main/pa_exec.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: paused on sql_manager * src/: include/pa_cache_managers.h, include/pa_pool.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, main/pa_sql_driver_manager.C, types/pa_vtable.h, types/pa_vvoid.h: vtable compiled * src/: classes/op.C, include/pa_globals.h, include/pa_hash.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_table.h, main/pa_sql_driver_manager.C, main/pa_table.C: table compiled * src/: include/pa_cache_managers.h, main/pa_cache_managers.C: cache_managers compiled * src/: include/pa_array.h, include/pa_charset.h, include/pa_pool.h, main/pa_charset.C: charset compiled * src/: include/pa_pool.h, main/pa_common.C: common compiled * src/: include/pa_array.h, include/pa_common.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_common.C, main/pa_string.C, types/pa_value.C, types/pa_value.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vstateless_class.h, types/pa_wcontext.C, types/pa_wcontext.h: wcontext compiled 2003-01-24 paf * src/: classes/classes.C, classes/classes.h, include/pa_array.h, include/pa_common.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_common.C, main/pa_globals.C, main/pa_string.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.h: more patched * src/: classes/op.C, include/pa_array.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, main/pa_dictionary.C, main/pa_exception.C, main/pa_string.C, main/pa_table.C: string compiled * src/: include/pa_array.h, include/pa_common.h, include/pa_dictionary.h, include/pa_exception.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, main/pa_common.C, main/pa_dictionary.C, main/pa_exception.C, main/pa_string.C: dictionary compiled 2003-01-23 paf * src/: include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/pa_common.C, main/pa_exception.C, main/pa_globals.C, types/pa_value.C, types/pa_value.h: resurrected pool in new sense: now it's factory, producing&accounting memory chunks for read[autofree] buffers * src/: include/pa_array.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_table.h, main/pa_exception.C, main/pa_table.C: table compiled * src/: classes/image.C, classes/op.C, include/pa_array.h, include/pa_exception.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_sapi.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/pa_exception.C, main/pa_globals.C, main/pa_string.C, main/pa_table.C: aint that easy * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, main/main.dsp: continued with Hash * src/main/pa_common.C: connect_string allocated on heap[wes on stack] now. and exception can be reported OK now [can be reported outside of pro c with that stack] 2003-01-22 paf * src/: include/pa_array.h, include/pa_charset.h, include/pa_dictionary.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_array.C, main/pa_hash.C, main/pa_pool.C, main/pa_string.C: started auto_ptr. PA_Object is base: contains references_count. auto_ptr template calls add_ref/release 2003-01-21 paf * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/pcre_parser_ctype.c, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, main/compile.tab.C, main/compile.y: 2002->2003 2003-01-16 paf * www/htdocs/index.html: image.copy fixed transparent resampling * operators.txt, src/include/pa_globals.h, src/main/pa_common.C, src/main/pa_globals.C, www/htdocs/index.html: http:// introducing $.any-status(1) * operators.txt, src/include/pa_config_fixed.h, src/main/pa_common.C, www/htdocs/index.html: http request now return status. and not fail on status!=200 2003-01-15 paf * src/main/pa_globals.C: localized pa_xmlFileRead/Close 2003-01-14 paf * src/lib/ltdl/: config.guess, config.sub, install-sh, missing, mkinstalldirs: removed some ancient files [they in / really] * src/lib/ltdl/: config_fixed.h, libltdl.dsp, ltdl.c: ltdl.c regretfully needed patch in two places. in config_fixed.h made stubs for lib to compile in MSVC 2003-01-13 paf * config.guess, config.sub, ltmain.sh: removed last piece of configure.in(libtool) hacks * src/lib/ltdl/: COPYING.LIB, acinclude.m4, config.h, config_auto.h.in, configure, configure.in, libltdl.dsp, ltdl.c, ltdl.h: moved to latest libtool (1.4.3) 2003-01-10 paf * src/lib/ltdl/: configure, configure.in: PROG_NM * src/main/pa_globals.C: moved to latest xml lib versions, changed patches. libxml2 >= 2.5.1 [ftp://xmlsoft.org/libxml2-2.5.1.tar.gz] libxslt >= 1.0.23 [ftp://xmlsoft.org/libxslt-1.0.23.tar.gz] gdome2 >= 0.7.2 [http://gdome2.cs.unibo.it/tarball/gdome2-0.7.2.tar.gz] * INSTALL: moved to latest versions of xml libs libxml2 >= 2.5.1 [ftp://xmlsoft.org/libxml2-2.5.1.tar.gz] libxslt >= 1.0.23 [ftp://xmlsoft.org/libxslt-1.0.23.tar.gz] gdome2 >= 0.7.2 [http://gdome2.cs.unibo.it/tarball/gdome2-0.7.2.tar.gz] 2003-01-09 paf * INSTALL: xml,xslt,gdome lib urls updated * config.guess, config.sub, missing, mkinstalldirs, src/include/pa_config_auto.h.in, src/lib/ltdl/config_auto.h.in, src/lib/ltdl/configure, src/lib/ltdl/configure.in, src/targets/cgi/Makefile.am: moved to autoconf 2.57 & automake 1.7.2 * depcomp: moving to automake 1.7.2 2002-12-27 paf * src/include/pa_version.h: 0007 * src/doc/aliased.dox, src/doc/index.dox, src/doc/module.dox, src/doc/pooled.dox, www/htdocs/index.html: removed outdated parts, made links to language docs * src/include/pa_config_auto.h.in: comment 2002-12-26 paf * src/classes/file.C: ^file:fullpath[a.gif] when document root did not contain trailing / fixed. * INSTALL: changing SAFE_MODE politics * src/include/pa_config_auto.h.in: changing SAFE_MODE politics * src/main/: pa_common.C, pa_exec.C: changing SAFE_MODE politics 2002-12-25 paf * src/main/pa_globals.C: optimized-xml * src/main/pa_globals.C: optimized-as-is 2002-12-24 paf * src/main/: pa_common.C, pa_pool.C: pool::copy on zero size|ptr fixed [were really called with zero size when .html?a=&b=] * src/classes/mail.C: $MAIL in @conf now invalid when configured with --with-sendmail * src/main/pa_exec.C, www/htdocs/index.html: fork/pipe error now [old always-pipe-error fixed] 2002-12-23 paf * src/types/pa_vcookie.C: $cookie:field[put value] fixed [were ignoring parameters & were storing only string with default expires * src/main/pa_charset.C: From: "Victor Fedoseev" To: "Alexandr Petrosian (PAF)" Sent: Monday, December 23, 2002 4:22 AM Subject: bug â Charset::transcode_buf2xchar 2002-12-20 paf * src/targets/cgi/parser3.C: removed last \n appending in non-win32 non-cgi [script] runs 2002-12-19 paf * INSTALL: --without-iconv recommended [it crashes on some systems [tested on elik]] moreover, it's not needed there [parser registers charsets itself] * INSTALL: --without-iconv recommended [it crashes on some systems [tested on elik]] * operators.txt, src/include/pa_globals.h, src/include/pa_request.h, src/main/pa_globals.C, src/main/pa_request.C, www/htdocs/index.html: $response:download * src/classes/mail.C: 'to' check bugfix [now checked only on ms compiler [win32]]. 2002-12-18 paf * src/classes/xdoc.C: doc->URL on xdoc.load set correctly now 2002-12-17 paf * src/targets/cgi/parser3.C: merged die&iis changes * src/targets/cgi/parser3.C: 1. on win32 in die: abort() reverted to exit(1) 2. more flexible iilegal call check 2002-12-16 paf * ltmain.sh: some automakes silly insist on having this handy * src/main/untaint.C: filespec russian small 'r' changed to latin 'p' bug fix 2002-12-15 paf * src/main/untaint.C: filespec russian small 'r' changed to latin 'p' * configure.in, src/include/pa_config_auto.h.in, src/main/compile.C, src/main/pa_common.C: merged small changes from branch 6 to HEAD * src/main/compile.C: removed warning * src/main/pa_common.C: ftruncate having checked * configure.in, src/include/pa_version.h: new version 2002-12-14 paf * www/htdocs/index.html: exception type fixed * src/classes/table.C: removed unnecessary code * src/sql/pa_sql_driver.h: exception type fixed 2002-12-09 paf * src/types/pa_vvoid.h, www/htdocs/index.html: $void.store[now] error * src/targets/cgi/parser3.C: ::die now tries to write core dump * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: ::die now tries to write core dump * src/targets/cgi/parser3.C: ::die now tries to write core dump * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: changed exception handling mech in sql handlers #2 * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: changed exception handling mech in sql handlers * src/sql/pa_sql_driver.h: changed exception handling mech in sql handlers * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: changed exception handling mech in sql handlers * configure.in: removed configure.in:AC_LIBTOOL, it caused automake to write makefile which used libtool to install things, which is not needed 2002-12-06 paf * operators.txt, src/main/compile.tab.C, src/types/pa_vhash.h: $hash.fields -- pseudo field to make 'hash' more like 'table' 2002-12-05 paf * src/classes/mail.C, src/types/pa_vmail.C, src/types/pa_vmail.h, www/htdocs/index.html: smtp cc/bcc OK now * src/main/untaint.C, www/htdocs/index.html: mail header closed properly * src/main/pa_common.C, src/main/untaint.C, src/types/pa_vmail.C, www/htdocs/index.html: mail header ',' allowed. still bugs in smtp [only one receiptient works, cc, bcc ignored now, and MAILED ;)] [strncpy killed, memnchr used] * src/main/pa_table.C: table-copy now current=0 * src/main/pa_array.C, src/main/pa_table.C, www/htdocs/index.html: wow! found/fixed bug in lowlevel proc * src/targets/cgi/parser3.C: more checks on http://domain/parser.cgi start [maybe some getenv returns "", checked that now * src/targets/cgi/parser3.C: more checks on http://domain/parser.cgi start [maybe some getenv returns "", checked that now * src/targets/cgi/parser3.C, www/htdocs/index.html: error logging made unbuffered [so that out-of-mem errors reached log] * src/classes/mail.C, src/targets/cgi/parser3.C, src/types/pa_vmail.C, www/htdocs/index.html: mail:send MIME-Version default * src/main/main.dsp: pa_version included into main.dsp * www/htdocs/index.html: smtp line ends fixed. now \r\n [not \r]. some smtp servers [win32] leave \n intact, and some clients [bat] fail to show letter correctly 2002-12-04 paf * src/types/pa_vform.C: $form:field string value cut by premature 0 * parser3.dsw, src/main/compile.tab.C, src/main/main.dsp, www/htdocs/.htaccess, www/htdocs/index.html: lib/libltdl -> lib/ltdl Win32 changes. s * src/classes/classes.awk: more strict *.C$ * gnu.dsp: restored * configure.in, gnu.dsp, src/lib/Makefile.am, src/lib/ltdl/Makefile.am, src/lib/ltdl/README, src/lib/ltdl/acinclude.m4, src/lib/ltdl/config.guess, src/lib/ltdl/config.h, src/lib/ltdl/config.sub, src/lib/ltdl/config_auto.h.in, src/lib/ltdl/config_fixed.h, src/lib/ltdl/configure, src/lib/ltdl/configure.in, src/lib/ltdl/install-sh, src/lib/ltdl/libltdl.dsp, src/lib/ltdl/ltdl.c, src/lib/ltdl/ltdl.h: src/lib/ltdl/Makefile now created with /configure, not ltdl/configure, so it does have no problems with automake. ltdl/configure AC_OUTPUT(Makefile<>attachment<< * src/classes/image.C, www/htdocs/index.html: ^image.font << bad font file-size now properly reported 2002-11-26 paf * src/main/pa_request.C: fixed lang in reponse header * src/main/pa_common.C, www/htdocs/.htaccess: utf8 prefix ignored @read text * operators.txt, src/main/pa_common.C, www/htdocs/index.html: http:// response status!=200 made exception: http.status with source=bad status# 2002-11-25 paf * configure.in, src/classes/image.C, src/include/pa_config_auto.h.in, src/include/pa_config_includes.h, src/main/Makefile.am, src/main/pa_common.C, src/main/pa_globals.C: http:// and image const void related probs fixed * operators.txt, src/main/pa_common.C, www/htdocs/index.html: http fields now UPPERCASE $file[^file::load[http://there]] $file.SERVER * src/classes/file.C, src/classes/image.C, src/classes/xdoc.C, src/include/pa_common.h, src/main/pa_common.C, src/main/pa_request.C, www/htdocs/index.html: checked http options [invalid onces now reported] made default user-agent: paf * operators.txt, src/classes/file.C, src/classes/table.C, src/classes/xdoc.C, src/include/pa_common.h, src/include/pa_globals.h, src/main/pa_common.C, src/main/pa_globals.C, src/main/pa_request.C, src/types/pa_vfile.C, src/types/pa_vfile.h, www/htdocs/index.html: table/xdoc/file::load now understand http:// prefix and additional params, sample: $rates[^xdoc::load[http://www.cbr.ru/scripts/XML_daily.asp?date_req=02/03/2002; $.USER-AGENT[parser3] ]] 2002-11-22 paf * src/classes/image.C, src/include/pa_globals.h, src/main/execute.C, src/main/pa_globals.C, src/types/pa_vimage.C, src/types/pa_vimage.h, www/htdocs/.htaccess, www/htdocs/index.html, operators.txt: $image.exif support $image.exif.DateTime & co 2002-11-21 paf * src/main/: pa_exec.C, untaint.C: cstr(UL_UNSPECIFIED) [not _PASS_APPENDED) * src/classes/image.C: jpeg size measure fixed: were badly skipping EXIF information [were big block and it's size were considered negative :(] * operators.txt, src/classes/image.C, src/include/pa_common.h, src/main/pa_common.C, src/types/pa_vmail.C, www/htdocs/index.html: image.measure internals rewritten. no there's reader.seek, and all's ready for EXIF extraction [now we fail to measure files with EXIF info] * src/main/pa_common.C: O_TRUNCATE killed, ftruncate used instead: O_TRUNC truncates even exclusevely write-locked file [thanks to Igor Milyakov for discovering] 2002-11-20 paf * src/targets/cgi/parser3.C: logging @signal += query_string * configure.in, src/include/pa_config_auto.h.in, src/include/pa_config_includes.h, src/targets/cgi/parser3.C: comment * src/targets/cgi/parser3.C: SIGNALS overriden @ main top * src/: include/pa_request.h, main/execute.C, main/pa_request.C, targets/cgi/parser3.C: SIGUSR1 >> writes to error_log uri of currently processed document SIGPIPE >> interrupts request processing [exception = DB rollback] * src/main/pa_exec.C: comment * src/main/pa_exec.C: pa_exec: data written only if size>0 * operators.txt, src/classes/file.C: ^file::exec/cgi[file;$.stdin[] << disable HTTP-POST repassing * src/: include/pa_config_fixed.h, main/pa_common.C, main/pa_exec.C, targets/cgi/parser3.C: ^file:exec/cgi [pa_exec] pipe read errors now checked 2002-11-19 paf * src/targets/cgi/parser3.C: removed #ifdef WIN32 around check of CGI: Illegal call 2002-11-01 paf * src/main/execute.C: comment 2002-10-31 paf * src/main/execute.C: found out why, checked that for now. todo: find out a way for that user could do that * www/htdocs/: base.p, derived.p, index.html: this example creates base object, which is wrong, todo: find out why * src/types/pa_vstateless_object.h: object put replaces static parent if any * src/types/pa_vobject.C: object put replaces static parent if any * src/classes/form.C, src/classes/mail.C, src/classes/op.C, src/classes/xnode.h, src/main/compile.tab.C, src/main/execute.C, src/main/pa_request.C, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_venv.h, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/base.p, www/htdocs/derived.p, www/htdocs/index.html: static fix merged * src/: main/compile.tab.C, types/pa_vobject.C: killed $virtual_fields in dynamic, but one can reach derived static[class] variable from base * src/: classes/op.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: fixed statics, left $virtual_fields in dynamic * src/types/: pa_vobject.C, pa_vstateless_class.C: realized that one can't remember derivates in base class: there's so many of them. also there can be no virtual method calls in static classes * src/classes/form.C, src/classes/mail.C, src/classes/op.C, src/classes/xnode.h, src/main/execute.C, src/main/pa_request.C, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_venv.h, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/base.p, www/htdocs/derived.p, www/htdocs/index.html: static call $self fixed * src/main/execute.C: comment * src/classes/op.C, src/types/pa_value.h, src/types/pa_vobject.h, www/htdocs/base.p, www/htdocs/derived.p, www/htdocs/index.html, www/htdocs/operators.p, www/htdocs/some.p: ^process[$caller.self]{...} now compiles to last derived object part of that 'self' 2002-10-30 paf * www/htdocs/: derived.p, some.p: include method overriding tested OK 2002-10-29 paf * src/targets/isapi/parser3isapi.C: comment on 404 bad status re-passing [iis to blame] * src/classes/string.C: changed string.save to pass current sql connection to cstr thus one can ^connect[some server]{ $s[insert into table x (x) values (^taint[sql]{value})] ^s.save[some.sql] } and he'd get in some.sql file code with properly escaped. [tried in mssql->mysql export->import of binary data] 2002-10-28 paf * www/htdocs/: index.html: bad email handling test 2002-10-25 paf * src/types/pa_vresponse.C: case insensitive response user fields get/put * src/: include/pa_hash.h, main/pa_hash.C, main/pa_request.C, types/pa_vresponse.C: saving for maybe-future 2002-10-23 paf * operators.txt, src/classes/table.C: ^table.hash{code}... ^table.hash(expr)... * src/types/pa_vmail.C, www/htdocs/index.html: email whitespace trimBoth-ed 2002-10-22 paf * src/types/: pa_vform.C, pa_vform.h: removed needless VForm::Append...(...Value) * src/main/execute.C: $.name outside of $name[...] checked * src/main/: compile.tab.C, compile.y: lexer changed to fix ^call[]^#HH bug [that situation yelded no EON, which whas wrong] 2002-10-21 paf * operators.txt, src/types/pa_vform.C, src/types/pa_vform.h: $form:qtail $form:imap.x/y * operators.txt, src/types/pa_vform.C: $form:nameless = "?value&...", "...&value&...", "...&value" * operators.txt, src/types/pa_vform.C: $form:image-map * operators.txt, src/classes/file.C, www/htdocs/index.html: /some/page.html: ^file:fullpath[a.gif] => /some/a.gif 2002-10-17 paf * src/main/: compile.tab.C, compile.y: operators precedence changed a little: logical not and bitwise negation precedence made highest, << and >> bitshits precedence made equal [were << higher than >>] * src/classes/op.C: exception handling fixed [were bad with contexts] 2002-10-16 paf * www/htdocs/index.html: bad compile to system class test * src/classes/op.C, src/include/pa_request.h, src/main/execute.C, src/main/pa_request.C, www/htdocs/index.html, www/htdocs/derived.p: Request::self considered equal to VMethodFrame::self, and removed, Request::get_self() mapped to VMethodFrame.self() * src/: classes/op.C, main/pa_request.C: VMainClass now has name = $hash in open field now gives old good error meesage 2002-10-15 paf * src/types/pa_vjunction.h, www/htdocs/index.html: ^if(def $junction){was true}{now false} use ^if($junction is junction){was and now true} * src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_charset.h, src/include/pa_pool.h, src/main/pa_charset.C, src/main/pa_pool.C, src/types/pa_vxnode.C, www/htdocs/index.html: xml->parser strings now have origin, which points to place where value left xml library and came to parser: place of dom field extraction/call * src/classes/op.C, src/include/pa_opcode.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/types/pa_vmethod_frame.h, www/htdocs/derived.p: removed last pieces of old code allowing $junction.xxx at compile time * ChangeLog, src/classes/op.C, src/main/compile.tab.C, src/main/compile.y, src/types/pa_vmethod_frame.h: process[self] objects also considered [were only classes] * ChangeLog, src/classes/op.C, src/include/pa_request.h, src/types/pa_vmethod_frame.h, www/htdocs/derived.p, www/htdocs/index.html: ^process[CLASS]{body} now executed with CLASS self. [ (request&method_frame).self temporarily changed ] * src/classes/hash.C, src/classes/op.C, www/htdocs/index.html, www/htdocs/operators.p: method_frame now always changed, with no exception to native calls. for&foreach changed to use method_frame.caller for their var's name context * src/main/execute.C, src/targets/cgi/parser3.C, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, www/htdocs/operators.p: compiling to system classes disabled * www/htdocs/: derived.p, index.html: test of ^process from operator called from user class * operators.txt, src/classes/op.C, www/htdocs/operators.p: ^process[$caller.CLASS]{code-string} added * operators.txt, src/classes/op.C, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/pa_request.C, src/types/Makefile.am, src/types/pa_vjunction.C, src/types/pa_vjunction.h, src/types/pa_vmethod_frame.h, src/types/types.dsp, www/htdocs/operators.p: removed $junction.get $junction.set[] introducing $caller * src/types/pa_value.h: removed outdated comments. doxygen would find them lower by inheritance tree * src/types/pa_vjunction.C: ident 2002-10-14 paf * src/classes/op.C: process compiles to code's class class * src/classes/form.C, src/classes/mail.C, src/classes/op.C, src/include/pa_request.h, src/main/compile.C, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/pa_request.C, src/types/pa_vstateless_class.h, www/htdocs/index.html: operators now main-class-methods * src/classes/op.C, src/include/pa_request.h, www/htdocs/index.html, www/htdocs/operators.p: ^try{^call{}} now has better stack trace [has "call" & co there] * src/: include/pa_request.h, main/execute.C, main/pa_request.C: operators @auto now executed in MAIN context * src/main/execute.C: operator execution context now = MAIN, not closest stack frame @touchit[] $i[after] ----t.html $i[before] << local ^touchit[] $i << now 'before', were 'after' ---t.html $i[before] << notlocal [main] ^touchit[] $i << now 'after' * src/main/execute.C: comment * src/types/pa_vclass.C, src/types/pa_vobject.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, www/htdocs/index.html, www/htdocs/operators.p: $form:CLASS resurrected [wes killed in action] * src/types/pa_vxnode.C: misreplace fixed * configure, configure.in, src/include/pa_config_auto.h.in, src/types/pa_vstatus.C, operators.txt, www/htdocs/index.html: $status:rusage.tv_secs/usecs introduced 2002-10-09 paf * src/classes/double.C, src/classes/int.C, src/classes/string.C, www/htdocs/derived.p, www/htdocs/index.html: ^string.int[] now failes on empty string [or uses (default)] 2002-10-08 paf * src/main/untaint.C: mail header quoted printable changed after RFC reread * operators.txt: plan on ^if(method * src/types/pa_vxnode.C: misreplace 2002-09-24 paf * src/targets/cgi/Makefile.am: LIBS were bad name in .am * src/types/pa_vmail.C: HAVE_TIMEZONE & co now checked and mailreceive would compile on freebsd now * src/include/pa_config_fixed.h, src/types/pa_vmail.C, acconfig.h, configure, configure.in, src/include/pa_config_auto.h.in, src/targets/cgi/Makefile.am: HAVE_TIMEZONE & co now checked and mailreceive would compile on freebsd now * src/classes/file.C, src/main/untaint.C, www/htdocs/index.html: 1. file spec language changed: now there are only few chars are untainted: * ? ' " < > | and, on unix, : \ ~ [russian letters and SPACES now enabled, one should use ^untaint[uri]{...} now] 2. $list[^file:list[dir]] now returns simply tainted names in $list.name, not tainted as filespec @russianindex[] #dir with files with russian-lang names $where[dir] $dir[^file:list[$where;\.txt^$]] ^dir.menu{ $dir.name
} 2002-09-23 paf * src/types/pa_vdouble.h: double->int round added * src/classes/date.C: date bug fix, now round(floatDays*secondsPerDay) * src/classes/date.C: date bug fix, now round(floatDays*secondsPerDay) 2002-09-20 paf * src/main/execute.C, www/htdocs/index.html: code junction calls disabled [before: code was compiled in such a way, that there were no code-junctions in OP_CALL] this now error: @badjunctioncall[] ^badjunctioncallinside{code} @badjunctioncallinside[code] ^code[] * src/main/compile.tab.C, src/main/compile.y, www/htdocs/index.html: changed grammer on junction expanding to include ^junction.method * src/main/pa_common.C: -d "DIR/" now true * src/classes/xdoc.C, www/htdocs/index.html: xdoc::create[name] now sets $request:charset as internal xdoc encoding, and after decoding attributes set by dom functions now encoded OK, not as digital entities * src/classes/xdoc.C: empty transform result, being taken as file now returns empty file, not raises stupid error about "stat-ed file" * src/types/pa_vhash.h, www/htdocs/operators.p: hash.foreach modification of existing keys allowed * src/types/types.dsp: introducing $junction.get/put(1) one can write iterators now: ^user-foreach[key;value]{$key=$value
} @user-foreach[key;value;code] ^for[i](1;10){ $code.key($i) $code.value($i*2) $code } * src/main/compile_tools.h: mistype * src/targets/cgi/Makefile.am: binaries now depend on makefiles, thus taking linking options configure changes into account [were: ignoring] * src/types/: pa_vjunction.C, Makefile.am: introducing $junction.get/put(1) one can write iterators now: ^user-foreach[key;value]{$key=$value
} @user-foreach[key;value;code] ^for[i](1;10){ $code.key($i) $code.value($i*2) $code } * src/include/pa_opcode.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/main.dsp, src/targets/cgi/parser3.dsp, src/types/pa_vjunction.h, www/htdocs/.htaccess, www/htdocs/index.html: introducing $junction.get/put(1) one can write iterators now: ^user-foreach[key;value]{$key=$value
} @user-foreach[key;value;code] ^for[i](1;10){ $code.key($i) $code.value($i*2) $code } 2002-09-19 paf * Makefile.am: new: make commit * aclocal.m4: forced to be older 2002-09-18 paf * parser3.dsw, src/include/pa_opcode.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, www/htdocs/index.html: << >> int shifts * src/: include/pa_common.h, include/pa_request.h, main/pa_common.C, main/pa_request.C: auto.p exists but unreadable - now this - fatal error * src/classes/file.C, www/htdocs/index.html, www/htdocs/mailreceive.eml: ^file::exec/cgi $.stdin[can be file now] so that one can pass binary data there * src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_request.h, www/htdocs/index.html: pa_request contexts made privated, plus get_{self/method_frame} to read. Request_context_saver used in ^try to save flang too. [were not saved] * src/types/pa_vresponse.C: header value chains joined before output, this should help $.subject[$var $var] from being converted to subject: ?koi8-r?Q?...?= ?koi8-r?Q?...?= 2002-09-17 paf * src/: main/execute.C, types/pa_value.h, types/pa_vmethod_frame.h: removed changes, operators executed with calling self. lots of code with ^include code relies on defined/defining self variables $a[1] ^include[print_a.p] print_a.p: $a ^include[set_a.p] a=$a set_a.p: $a[1] * src/classes/op.C, src/main/execute.C, src/main/pa_request.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vmethod_frame.h, src/types/pa_vstateless_class.h, www/htdocs/operators.p: operators now executed with MAIN self. it's for ^include sake, too strong a change * src/classes/op.C, www/htdocs/index.html, www/htdocs/operators.p: made place for ^process to compile it's code to in case of no self * src/main/execute.C, www/htdocs/index.html: found ancient param to Junction, removed. allowed passing self to native_code_operators [for ^process to work, she needs self] * src/: main/execute.C, types/pa_value.C, types/pa_value.h, types/pa_vstateless_class.h: found ancient param to Junction, removed. allowed passing self to native_code_operators [for ^process to work, she needs self] * src/main/execute.C, src/main/pa_request.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vmethod_frame.h, src/types/pa_vstateless_class.h, www/htdocs/index.html, www/htdocs/operators.p: allowed Request.self to be 0, checked that in VMethodFrame get/put and $self. * src/classes/table.C, src/classes/xdoc.C, www/htdocs/index.html: table::sql options table::create copy options options checked, wrong option now fatal error * src/main/pa_string.C, www/htdocs/index.html: string.replace fixed [were missing words on pieces boundaries] * bin/auto.p.dist.in: strange \n * configure, configure.in: .so now detected [can be .sl on hpux, .dll on cygwin, .so in other cases) * configure, configure.in, bin/auto.p.dist.in: .so now detected [can be .sl on hpux, .dll on cygwin, .so in other cases) * operators.txt, src/classes/hash.C, src/classes/table.C, src/include/pa_globals.h, src/main/pa_globals.C, www/htdocs/index.html: table.sql hash::sql flag to allow duplicate keys [$.distinct(1/0)] first record taken [were last] * src/classes/hash.C, src/classes/table.C, src/include/pa_sql_connection.h, www/htdocs/index.html: table.sql hash::sql duplicate keys now errors * src/classes/hash.C: foreach delims bug fixed [were ,2,3] * src/classes/op.C, src/classes/table.C, www/htdocs/index.html: menu/for delims bug fixed [were ,2,3] 2002-09-16 paf * src/classes/file.C, www/htdocs/index.html: file::cgi line ends can be both unix & dos. and they can be unix [\n\n] on win when 'use CGI' used, it causes stdout to be binary. now detected closest header break. * src/: main/untaint.C, types/pa_vmail.C: mail:send closing ?= now closed right 2002-09-13 paf * operators.txt, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.h, www/htdocs/index.html: (expression #comment) (multiline expression #comment line2 #comment ) (expression #comment with (brackets) comment) << OK * operators.txt, src/main/compile.tab.C, src/main/compile.y, www/htdocs/index.html: !| bitwise !|| numerical xor now [preparing for expression #comments] * src/main/compile.tab.C, src/main/compile.y, www/htdocs/index.html: @method[$name] now parse error * src/: include/pa_config_fixed.h, main/pa_socks.C: HAVE_WINSOCK_H cheched in pa_socks.C * configure, configure.in, src/include/pa_config_auto.h.in: HAVE_WINSOCK_H created in configure.in * src/main/compile.tab.C, src/main/compile.y, src/types/pa_vresponse.C, www/htdocs/index.html: cookie date now clean [were mistakenly tainted & that worked bad with opera -- 'happily' that worked OK with msie] 2002-09-12 paf * src/types/: pa_vclass.C, pa_vmail.C, pa_vobject.C: VObject & VClass get_element now first looks to fields, next to methods & co todo: the rest reason: more speed * src/main/untaint.C: quoted printable encoding stops before \s*<...>$ * src/main/untaint.C, www/htdocs/index.html: quoted printable ' ' now =20 and encoding stops before <...>$ 2002-09-11 paf * src/main/pa_charset.C, src/targets/cgi/parser3.dsp, www/htdocs/index.html: while fixing ( xmlCharEncodingInput/OutputFunc callbacks returned bad value ) forgot to check users of those funcs. not all were using that return value convention * src/lib/pcre/ibm-1254.ucm, etc/parser3.charsets/windows-1254.cfg: windows-1254 added 2002-09-10 paf * src/: classes/op.C, main/execute.C, types/pa_wcontext.h: VCodeFrame parent param were specified badly * src/: main/execute.C, types/pa_value.h, types/pa_wwrapper.h: WWrapper which used in constructing objects(second param to sql method) ^...sql{}[$.default{code}] now has parent, wich helps code in hash to survivi * src/: include/pa_request.h, main/execute.C: removed redundant param to execute [stack said 'thanks'] * src/: classes/op.C, main/execute.C, types/pa_value.C, types/pa_value.h, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: moved junction kill responsibility to wcontext * src/classes/file.C: decided not to log exec's with stderr, that could be warnings, and it's up to scritper to log/show them * src/classes/double.C, src/main/execute.C, www/htdocs/index.html: double:sql badly called write_assign_lang, not write_no_lang, thus doing unnecessary double/string converstion, which were loosing time&precesion * src/main/pa_charset.C, src/types/pa_vmail.C, www/htdocs/index.html: xmlCharEncodingInput/OutputFunc callbacks returned bad value in case of unfinished in buffer processing, causing accidental transcode stop [in case that source enc != utf-8 & there is incomplete utf-8 sequence at the end of 16000block iside of libxml lib] tfm readed & code updated 2002-09-04 paf * configure: makes with sjlj * INSTALL, src/include/pa_config_fixed.h, src/include/pa_sql_connection.h, src/main/pa_sql_driver_manager.C, www/htdocs/index.html: -with-sjlj-exceptions define checked. on win32 it made default * src/include/pa_config_auto.h.in: sjlj define * configure, configure.in: introducing --with-sjlj-exceptions [hpux can not work with longjump/throw pair, and one must switch that on there. todo: detect that automatically] * src/types/pa_vxnode.C, www/htdocs/index.html: removed too strong checks of xnode.elements. now, for instance, if element does not have any attributes, $xnode.attributes is void, not error 2002-09-02 paf * operators.txt, src/main/execute.C, src/targets/cgi/parser3.dsp, www/htdocs/index.html: removed double_result, didn't help * src/main/execute.C: double_result made to move that var away from hungry g++ optimizer (-O2), before: it were optimized and comparison operators worked badly * src/types/pa_vdate.h: removed debug * Makefile.am, src/types/pa_vdate.h: happy now only install-exec * src/main/execute.C: fixed numeric < & co so that thay now use c=a-b, c OPERATOR 0. this works fine on solaris/intel for still unknown reason. 2002-08-29 paf * parser3.dsw, src/classes/classes.dsp, src/classes/hash.C, src/classes/op.C, src/classes/string.C, src/include/pa_request.h, src/lib/md5/md5.dsp, src/main/execute.C, src/main/main.dsp, src/main/pa_request.C, src/targets/cgi/parser3.dsp, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vmail.C, src/types/pa_vmethod_frame.h, src/types/pa_wcontext.h, src/types/types.dsp, www/htdocs/index.html: junction_cleaner moved to auto VMethodFrame [called less frequent, allowed to remove ugly Junction.change_context-s from many places, switch, mail:send..html{}, ..] request.root renamed to method_frame [more easyreading] ancient {...PUSH/POPs...} changed to stack vars [speed up] 2002-08-28 paf * src/types/pa_vcookie.C, www/htdocs/index.html: $cookie:name[&] $cookie:name << now tainted * src/types/pa_vcookie.C, www/htdocs/index.html: fixed cookie delete when $cookie:name[$.value[]] * operators.txt, src/classes/string.C, www/htdocs/derived.p, www/htdocs/index.html: ^string.split[delim[;options]] 2002-08-27 paf * etc/parser3.charsets/Makefile.am: merged from 3.0.0005 * operators.txt, src/main/compile.tab.C, src/main/compile.y, www/htdocs/index.html, www/htdocs/mailreceive.eml: # now delimiter * INSTALL: recommended latest gmime 1.0.5 2002-08-26 paf * configure, configure.in: apache13/hook added to make dist. 2002-08-23 paf * src/include/pa_common.h, src/main/pa_common.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, www/htdocs/index.html: when auto.p beside binary [cgi, isapi] not accessible [due to bad rights or whatever] it's error now 2002-08-21 paf * www/htdocs/derived.p: "BASE:" "BASE::" syntax allowed, means "base class". compiled as if here they named base class * Makefile.am: can use: make happy equals to make update install * src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, www/htdocs/derived.p: "BASE:" "BASE::" syntax allowed, means "base class". compiled as if here they named base class * src/main/pa_string.C, www/htdocs/index.html: fixed bad language bug, [were wrong string cloning constructor] * src/main/execute.C, src/types/pa_vobject.h, www/htdocs/base.p, www/htdocs/derived.p, www/htdocs/index.html: fixed virtual calls * bin/auto.p.dist.in, src/targets/cgi/parser3.C, src/types/pa_vfile.C, src/types/pa_vmail.C, www/htdocs/mailreceive.eml, www/htdocs/mailreceive.html: $mail.received.file.value.content-type fixed 2002-08-20 paf * src/classes/file.C, www/htdocs/index.html: fixed language of file:file result * operators.txt, src/classes/void.C, www/htdocs/index.html: ^void.pos[...] = -1 merged from 3.0.0005 * operators.txt, src/classes/void.C: ^void.pos[...] = -1 * operators.txt, src/classes/void.C, www/htdocs/index.html: ^void.length[] = 0 merged from 3.0.0005 * src/classes/void.C, operators.txt: ^void.length[] = 0 2002-08-19 paf * src/classes/xdoc.C: xdoc getElementsByTagName, ...NS overriden, work now * src/: classes/xnode.C, types/pa_vxdoc.C: xdoc.fields fixed [were error in xnode, which were not catched in xdoc] * src/: include/pa_stylesheet_connection.h, main/pa_globals.C: prepared: // validate each document after load/create (?) //xmlDoValidityCheckingDefaultValue = 1; 2002-08-15 paf * src/classes/classes.h, www/htdocs/index.html: write to static var caused useless Exception, introduced Methoded::put_element wich consumes those * operators.txt, src/include/pa_common.h, src/main/pa_common.C, src/types/pa_vcookie.C, src/types/pa_vdate.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, www/htdocs/index.html: $response:field[date] $response:field[$.xxx[date]] * src/classes/hash.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/include/pa_sql_connection.h, www/htdocs/index.html: fixed source of ^hash::sql{bad} * operators.txt: $request:body unprecessed POST request body * src/types/pa_vrequest.C, www/htdocs/index.html: $request:body unprecessed POST request * src/types/pa_value.h, src/types/pa_vdate.h, src/types/pa_vrequest.C, src/types/pa_vxdoc.C, src/types/pa_vxnode.C, www/htdocs/index.html: few barks: bark("%s field not found", 0, &aname) * operators.txt, src/classes/form.C, src/include/pa_pool.h, src/include/pa_request.h, src/main/pa_pool.C, src/types/pa_vform.C, src/types/pa_vform.h, www/htdocs/.htaccess: planning/preparing_to $request:body r.post_data now const * src/classes/image.C, src/classes/op.C, src/classes/xdoc.C, src/classes/xnode.C, src/main/execute.C, src/types/pa_value.h, src/types/pa_vhash.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vtable.h, www/htdocs/index.html: instead of type() checking everywhere used Value.as now user descendants can be used in params. VObject::as_*, is_defined now taken from bases. xtable(table) ^if($xtable) now OK * src/: main/execute.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vxdoc.C, types/pa_vxdoc.h: is->as 2002-08-14 paf * src/classes/xnode.h, src/main/execute.C, src/targets/cgi/parser3.dsp, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_venv.h, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/index.html: is now works with VObject & VClass * src/types/pa_vmail.C: mail: turned off utf8 to source transcoding * src/targets/cgi/: fixopt.C, fixopt.h, parser3.C, Makefile.am: removed fixopt stupidity. on stupid linux use cd /document/root ../cgi/parser3 script * src/targets/cgi/fixopt.C: fixopt now preprocesses command line params, splitting them by space, excluding argv[0], argv[argc-1] * src/targets/cgi/: Makefile.am, parser3.C, parser3.dsp, fixopt.C, fixopt.h: fixopt now preprocesses command line params, splitting them by space, excluding argv[0], argv[argc-1] * src/targets/cgi/parser3.C: -f config file * src/targets/cgi/parser3.C, www/htdocs/auto.p, www/htdocs/derived.p, www/htdocs/index.html: fixed .log file dir 2002-08-13 paf * src/types/pa_vobject.C, www/htdocs/derived.p, www/htdocs/index.html: allow override parent variables, useful for form descendants [in vobject too, were in vclass] * src/types/pa_vclass.C, www/htdocs/index.html: allow override parent variables, useful for form descendants * src/types/pa_vclass.C, www/htdocs/derived.p: checked: form[vclass]fields can be overwritten in derived(table) * src/: classes/form.C, classes/mail.C, classes/op.C, classes/xnode.h, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: introduced Value::get_element(..., bool looking_down) [needed to exclude endless recoursion] * src/types/: pa_vclass.C, pa_vobject.C: reorganized modules todo: fix bug with put endless recoursion todo: check 'as' * src/types/: Makefile.am, pa_vclass.h, pa_vobject.h, types.dsp: reorganized modules todo: fix bug with put endless recoursion todo: check 'as' * src/types/pa_vobject.h, www/htdocs/derived.p: checked: table fields can be overwritten in derived(table) * www/htdocs/derived.p: sample: dont convinient that table fields can be overridden * src/types/pa_vobject.h, www/htdocs/derived.p, www/htdocs/index.html: derived classes can have fields of their own now * src/classes/table.C, src/types/pa_vtable.C, src/types/pa_vtable.h, www/htdocs/derived.p: fixed error message on using non-created table * src/classes/form.C, src/classes/hash.C, src/classes/mail.C, src/classes/op.C, src/classes/xnode.h, src/include/pa_request.h, src/main/compile.C, src/main/compile.tab.C, src/main/execute.C, src/main/pa_request.C, src/types/pa_value.h, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_venv.h, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h, www/htdocs/derived.p: VObject.get/out now looking down/up tree todo: fix error message on non-constructed parents 2002-08-12 paf * src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, www/htdocs/derived.p: table derived OK * src/main/execute.C: ^base:create[] dynamic call rewritten todo: thorough testing * src/: main/compile.tab.C, main/compile.y, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_wcontext.h, types/pa_valiased.C, types/pa_valiased.h, types/Makefile.am: ^base:create[] dynamic call rewritten todo: thorough testing * www/htdocs/: base.p, derived.p: not good - along upward-virtual call self eq child * src/types/pa_value.h, src/types/pa_vclass.h, src/types/pa_vobject.h, www/htdocs/base.p, www/htdocs/derived.p: VObject ctor now instantates base class, remembers it and saves child in parent VObject.get_class now returns last child = downward virtual calls OK * src/main/execute.C, src/types/pa_value.h, src/types/pa_vclass.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_vfile.h, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.h, src/types/pa_vresponse.h, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstring.h, src/types/pa_vtable.h, src/types/pa_vxdoc.h, src/types/pa_vxnode.h, src/types/pa_wcontext.h, src/types/types.dsp, www/htdocs/index.html: killed VAliased [redundant], moved $CLASS to VObject only [parser class instance] * bin/auto.p.dist.in: more like in dist on parser.ru * bin/auto.p.dist.in: fixed sendmail default comment * src/main/pa_request.C: $response:body[file] content-type check fixed [were bad when content-type is hash] 2002-08-09 paf * src/main/execute.C, src/types/pa_value.h, src/types/pa_vclass.h, src/types/pa_vobject.h, src/types/pa_vxdoc.h, www/htdocs/index.html: started as() 2002-08-08 paf * operators.txt, src/classes/date.C, src/include/pa_globals.h, src/main/pa_globals.C, www/htdocs/index.html: year column in month calendar [week year] * src/main/execute.C, www/htdocs/index.html: error reporting on object writes to MAIN improved [were ruind with fixing $obj[^if(1){$obj}] ] * operators.txt, src/types/pa_vdate.h, www/htdocs/index.html: $date.yearday $date.daylightsaving * src/classes/mail.C, src/types/pa_vmail.C, www/htdocs/auto.p, www/htdocs/index.html: in letter texts one can use tainted data now. only she must specify the language. ^mail:send[ $.from[paf@mail.design.ru] $.to[paf@mail.design.ru] $.subject[^taint[uri][ìîñêâà]=2] $.text[^taint[uri][ìîñêâà]=] ] * www/htdocs/index.html: ^process now prints more precise origin * src/classes/file.C, src/classes/op.C, src/types/pa_vfile.C, www/htdocs/index.html: ^process now prints more precise origin * src/include/pa_string.h, www/htdocs/index.html: String::first_char now not fails on empty strings ^if(-f '') now ok and in 3 other places. * operators.txt, src/include/pa_string.h, src/main/pa_string.C: String::first_char now not fails on empty strings ^if(-f '') now ok and in 3 other places. 2002-08-07 paf * src/classes/string.C, src/main/pa_string.C, www/htdocs/index.html: ^string.mid(0;bad) fixed * src/main/pa_string.C, www/htdocs/index.html: ^string.mid(0;bad) fixed * src/main/execute.C, src/types/pa_vcode_frame.h, src/types/pa_vmethod_frame.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, www/htdocs/index.html: vcodeframe were mistakenly not completely transparent to object writes. $hash[^if(1){$hash}] now works * operators.txt, src/classes/op.C: ^cache...{...^cache<client only when text/* or simple onoverridden $response:body 2002-08-01 paf * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/pcre_parser_ctype.c, main/compile.C, main/compile.tab.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: $Date: 2013/10/29 16:21:27 $ * src/: classes/classes.C, classes/classes.dsp, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.dsp, Makefile.am, classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: ident.C* removed * operators.txt, src/classes/file.C, src/main/pa_request.C: file:find[/can/do/this/now.txt] * src/targets/cgi/parser3.C: usage to stdout now 2002-07-31 paf * src/types/pa_vmail.C: mail: errors-to: now default "postmaster" * src/: classes/mail.C, types/pa_vmail.C: mail: errors-to: now default "postmaster" * src/: classes/mail.C, types/pa_vmail.C: mail from/to now must be. -f postmaster now default sendmail key word "postmaster" replaced to $.from 2002-07-30 paf * configure, configure.in, src/targets/cgi/pa_config_paths.h.in, src/targets/cgi/parser3.C: removed pa_config_paths.h * src/main/pa_charset.C: comment * src/main/pa_charset.C, www/htdocs/auto.p: UTF-8 to 1byte charset convert, no char in table, &#decimal; * src/main/pa_request.C: comment * etc/parser3.charsets/windows-1251.cfg: section sign [russian paragraf] 2002-07-11 paf * src/main/pa_exec.C: build command line badly added params twice [and first time without ' ']. double wrong. fixed. * src/main/pa_exec.C: invalid .exe caused error message with params wich parser did not provide = reported badly. fixed that. * src/classes/mail.C: $MAIL[ # xxx ] now ok * operators.txt: plan: sql detailed exception 2002-07-01 paf * src/: classes/form.C, main/pa_request.C: @conf bug fixed [MForm.configure_admin were called when request.main_class ==0 * src/classes/form.C: 10*0x400*400 bug fix [4M not 10M] * src/classes/form.C: content_length type fix 2002-06-30 paf * src/classes/mail.C: merged from 4 * src/classes/mail.C: restored $MAIL 2002-06-28 paf * configure, configure.in: removed paths.h * configure, src/include/pa_version.h, src/targets/cgi/pa_config_paths.h.in: lates changes from 4 build merged, makes updated * ChangeLog, configure, operators.txt, src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_config_fixed.h, src/include/pa_pool.h, src/include/pa_version.h, src/main/pa_charset.C, src/main/pa_pool.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.dsp, src/types/pa_vmail.C, www/htdocs/index.html: merged latest updates to head 2002-06-27 paf * src/targets/: cgi/parser3.dsp, isapi/parser3isapi.dsp: post-build not error now * operators.txt, src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_config_fixed.h, src/include/pa_pool.h, src/main/pa_charset.C, src/main/pa_pool.C, www/htdocs/index.html: ^xdoc::create[[uri]]... base uri for document being created, imports and other relative file names would be relative to this uri default uri=path_translated * src/classes/xdoc.C, www/htdocs/index.html: xsltParseStylesheetDoc bug workaround 2002-06-26 paf * configure, configure.in, src/include/pa_version.h: release_3_0_0004 * src/main/pa_string.C: blank string '', ' ' considered 0 now * src/targets/cgi/parser3.C: /cgi-bin/parser empty filename checked 2002-06-25 paf * www/htdocs/index.html, src/main/pa_string.C: emtpy string, or string of whitespaces considered bad number now * www/htdocs/index.html: ^xdoc.transform[xdoc < * configure: parser3.conf renamed to auto.p autoconf changes * INSTALL, configure.in, operators.txt, bin/Makefile.am, bin/auto.p.dist.in, src/doc/doxygen.cfg, src/include/pa_globals.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, www/htdocs/auto.p, www/htdocs/index.html: parser3.conf renamed to auto.p 2002-06-18 paf * configure, configure.in, src/include/pa_version.h: version to configure.in * INSTALL: reflected .conf.dist dir change * Makefile.am, configure, configure.in, bin/Makefile.am, etc/parser3.charsets/Makefile.am: parser3.conf.dist moved to bin, .in & *.am updated * src/classes/file.C: strncasecmp * src/classes/file.C: strcasecmp * bin/Makefile.am, etc/Makefile.am, www/htdocs/index.html: bin/parser3.conf.dist [moved from etc * src/classes/file.C: ^file::exec[script;$.bad error case insensitive check now * src/classes/file.C, www/htdocs/index.html: ^file::exec[script;$.bad now error, not skip * configure, configure.in, src/include/pa_pool.h, src/include/pa_types.h: pack configure.in detection simplified. figured out that gcc on sparc not that stupid as thought previously: on sparc: when it sees packed class it modifies it's field-access-code to byte operations [stb, ldub] instead of 4byte operations [st, lduh] so packed must be all parts of packed class, i.e. it's parents&fields(classes). for now it's only String that packed and what was wrong is that it's parent - Pooled, were not packed. fixed that. 2002-06-14 paf * operators.txt: more precise xml-to-text options * operators.txt, src/types/pa_vxnode.C: xnode attribute_node.name/value xnode pi.node.data 2002-06-12 paf * configure, configure.in, src/targets/cgi/Makefile.am, src/targets/cgi/parser3.C: removed root conf define creation * INSTALL, configure.in, operators.txt, etc/Makefile.am, src/include/pa_globals.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/pa_globals.C, src/main/pa_request.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C: parser3.conf now one and only * src/classes/mail.C: sendmail -ti [default now] * src/: classes/mail.C, main/pa_request.C: $MAIL $CHARSETS allowed to be strings. for convinient #ing * src/: include/pa_globals.h, include/pa_request.h, main/execute.C, main/pa_globals.C, main/pa_request.C: @rootconf [were @conf] * src/: include/pa_globals.h, include/pa_request.h, main/main.dsp, main/pa_globals.C, main/pa_request.C: @conf 2002-06-11 paf * src/classes/file.C: check simplified * src/classes/file.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.C, www/htdocs/.htaccess, www/htdocs/index.html: suexec env keys filter plus CGI_ as valid prefix * src/classes/file.C, src/include/pa_request.h, src/include/pa_sapi.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, www/htdocs/index.html: file::exec/cgi to pass HTTP_ vars introducing SAPI::environment 2002-06-10 paf * operators.txt, src/classes/op.C, src/include/pa_common.h, src/main/pa_common.C: lock failures reported now * src/main/compile_tools.C, www/htdocs/index.html: ^if(" 1 "){y} bug fixed optimization string->double @ compile time were not-enough-checking... * src/main/compile.tab.C, src/main/pa_string.C, www/htdocs/index.html: whitespace after number in autoconvert now ignored * src/types/pa_vform.C, src/types/pa_vform.h, www/htdocs/index.html: $form: not determined yet check * src/classes/mail.C: mail netscape attachment name fixed. todo: $response:body content-type:name * configure, configure.in: hpux check, nsl link, no socket * operators.txt: old merge conflict removed * configure, configure.in: pack even address access on sparc&co arch checked in configure * configure, src/include/pa_version.h: makes * configure, configure.in, src/include/pa_version.h: makes * src/main/untaint.C: (bug#2) mail subject got always prepended with charset even when all letters were 7bit one * src/main/pa_common.C: merged fixed -d (bug) * src/main/pa_common.C: fixed -d (bug) 2002-06-03 paf * ChangeLog, operators.txt, etc/parser3.charsets/windows-1251.cfg, src/classes/classes.dsp, src/main/compile.tab.C, src/main/main.dsp, src/main/pa_globals.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.dsp, src/types/types.dsp, www/htdocs/index.html: fixed .dsp-s along with reorganized cvs modules dirs structure * src/: classes/classes.dsp, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: reorganized cvs modules 2002-05-28 paf * src/targets/cgi/parser3.C: info.uri now "" 2002-05-17 paf * src/classes/: table.C: ^table.save << checked empty pre/match/post columns 2002-05-16 paf * src/classes/image.C, www/htdocs/index.html: image::measure can png now 2002-05-15 paf * operators.txt, src/classes/date.C, www/htdocs/index.html: ^date::create[%H:%M[:%S]] added * etc/parser3.charsets/windows-1251.cfg: 0x forgot, fixed * operators.txt, src/classes/date.C, www/htdocs/.htaccess, www/htdocs/auto.p, www/htdocs/index.html: ^date::create[%Y[-%m[-%d[ %H[:%M[:%S]]]]]] [-%m now 2002-05-14 paf * etc/parser3.charsets/: windows-1251.cfg: added 3 quotes 2002-05-07 paf * ChangeLog, src/classes/classes.dsp, src/classes/op.C, src/include/pa_globals.h, src/include/pa_request.h, src/include/pa_table.h, src/main/compile.tab.C, src/main/compile.y, src/main/main.dsp, src/main/pa_globals.C, src/main/pa_request.C, src/main/pa_table.C, src/targets/isapi/pa_pool.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.dsp, src/targets/isapi/pool_storage.h, src/types/types.dsp, www/htdocs/parser-status.html: Table name2number field now &. main_method_name now on Request pool rather on global_pool [Junction+VJunction created on same pool as name = were created on global pool, causing mem leaks] * src/classes/classes.dsp, src/classes/op.C, src/include/pa_globals.h, src/include/pa_request.h, src/include/pa_table.h, src/main/compile.tab.C, src/main/compile.y, src/main/main.dsp, src/main/pa_globals.C, src/main/pa_request.C, src/main/pa_table.C, src/targets/isapi/pa_pool.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.dsp, src/targets/isapi/pool_storage.h, src/types/types.dsp, www/htdocs/parser-status.html: Table name2number field now &. main_method_name now on Request pool rather on global_pool [Junction+VJunction created on same pool as name = were created on global pool, causing mem leaks] 2002-05-06 paf * src/: main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/parser3isapi.C: removed 100*40 bytes per request memory leak [nonpool malloc in globals] * src/: main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/parser3isapi.C: removed 100*40 bytes per request memory leak [nonpool malloc in globals] 2002-04-30 paf * configure, src/include/pa_version.h: version now not b * src/targets/cgi/parser3.C, www/htdocs/global.xsl, www/htdocs/index.html: request.uri now never 0 2002-04-29 paf * configure.in: removed b * src/: classes/op.C, include/pa_exception.h, main/pa_request.C: Exception::comment/type checked in (), no there's no empty type/comment by default * ChangeLog, src/doc/ClassExample1.dox, src/doc/ClassExample3.dox, src/doc/aliased.dox, src/doc/methoded.dox, src/doc/string.dox, src/doc/value.dox, src/include/pa_exception.h, src/main/pa_request.C, src/targets/cgi/parser3.C: merged from 0001 2002-04-26 paf * src/doc/doxygen.cfg, src/targets/cgi/parser3.dsp, www/htdocs/index.html: doxygen dot image size reduced 2002-04-25 paf * src/targets/cgi/: parser3.C: setenv in .htaccess when cgi is not under that dir got REDIRECT_ prefix before HTTP_PARSER_x_CONFIG, now that took into account * operators.txt, src/classes/date.C: ^date::create[2002-12-33 01:03:04] * ChangeLog, operators.txt, src/classes/date.C, www/htdocs/index.html: ^date::create[2002-12-33 01:03:04] * ChangeLog: updated changelog * www/htdocs/index.html: sample of 'using junction out of context' * src/classes/table.C, www/htdocs/.htaccess, www/htdocs/index.html: removed restriction on column count to ^table.hash to work, now must be >0 [were >1] 2002-04-24 paf * src/: classes/classes.dsp, main/compile.tab.C, main/main.dsp, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: MSVC profile targets 2002-04-23 paf * operators.txt, src/classes/string.C, www/htdocs/index.html: int/double/string:sql{}[$.default{code}] fixed [were barking: "junction used outside of context"] 2002-04-22 paf * types.txt, src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C, src/types/pa_vstring.C, src/types/pa_vstring.h: ^string.optimize[] * src/: include/pa_globals.h, include/pa_table.h, main/pa_globals.C, main/pa_string.C, main/pa_table.C: fixed match table template * src/classes/: string.C: optimize removed from string .left/right/pos * src/main/execute.C: rolled back to before_killing_userjunction_contexts * src/main/execute.C, www/htdocs/index.html: user junctions context killed * src/main/execute.C, www/htdocs/index.html: junctions to local contexts got cleanized&checked later 2002-04-19 paf * src/classes/string.C, src/include/pa_request.h, src/include/pa_string.h, src/main/pa_request.C, src/main/pa_string.C, src/types/pa_vstring.C, src/types/pa_vstring.h, www/htdocs/index.html: string now optimized prior to .left .right .mid .pos .match when that is profitable, and always before .replace when $ORIGINS(1) optimization disabled economy from not wasting mem on lots of strings which occur by lots of String:mid calls to get parts of source string between found_occurances * src/classes/file.C: ovector now local economy: 16 bytes per ^file:list * src/: include/pa_globals.h, include/pa_table.h, main/pa_globals.C, main/pa_string.C: String::match table columns globalized, not created @ each ^match anymore economy: sizeof(Array)+space on 3+x cells=24+ bytes per ^match * src/: classes/op.C, classes/string.C, types/pa_value.h: VTable removed from each String::match replace iteration, and made stacked sizeof(VTable)=12bytes economy on each replace code * src/doc/footer.htm: 2001, * src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C, www/htdocs/index.html: string.match[]['] option enables generation of $match.prematch .match .postmatch columns * src/main/pa_string.C: String::match options analized without cstr-ing them now * src/doc/: doxygen.cfg, footer.htm, html2chm.cmd, postbuild.txt, sources2html.cmd, view_chm.cmd, view_html.cmd, chmhelper.pl: config updated to doxygen 1.2.15, created helper which fixes minor bugs in chm project files & htm tree. changed extension to .htm 2002-04-18 paf * src/doc/doxygen.cfg: .chi generation disabled * src/classes/classes.h, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/types/pa_vxdoc.C, www/htdocs/index.html: xdoc(xnode) now fully - fields&methods * src/: classes/classes.h, classes/hash.C, types/pa_value.h, types/pa_vbool.h, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vobject.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h: fclass_real lowered from VStateless_class to VObject * src/main/pa_request.C, src/types/pa_valiased.h, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstring.h, www/htdocs/index.html: VStateless_string_object speicalized light version of VStateless_object * src/classes/op.C: ^throw comment param made optional * src/types/pa_valiased.C, src/types/pa_valiased.h, src/types/pa_vclass.h, src/types/pa_vobject.h, src/types/pa_wcontext.C, www/htdocs/index.html: VAliased get/set alias now virtual and implemented down in VClass, fclass_alias removed, * src/types/pa_value.C: forced to cut that from .h because of VStateless_class usage [undefined in .h] * src/include/pa_opcode.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/pa_request.C, src/types/pa_vmethod_frame.h, www/htdocs/index.html: OP_GET_METHOD_FRAME merged with OP_CALL, VCodeFrame move to stack [no more heap waste on each CALL] * src/classes/classes.h, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xnode.C, src/include/pa_globals.h, src/include/pa_request.h, src/main/execute.C, src/main/pa_globals.C, src/main/pa_request.C, src/types/Makefile.am, src/types/pa_value.h, src/types/pa_vdouble.h, src/types/pa_vform.C, src/types/pa_vhash.h, src/types/pa_vint.h, src/types/pa_vmath.h, src/types/pa_vmethod_frame.h, src/types/pa_vstateless_class.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, src/types/types.dsp, www/htdocs/index.html: removed Value::fname 2002-04-17 paf * src/: doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, doc/compiler.dox, doc/module.dox, doc/pooled.dox, doc/string.dox, doc/targets.dox, include/pa_pool.h, include/pa_types.h: dox updated to current state, PTHROW freshen to throw & co * src/types/pa_vhash.h: vstring wrong parent fixed * src/classes/op.C: taint local result var bug fixed 2002-04-16 paf * asm.txt, form.txt, lang.txt, sql.txt: removed outdated. see in Attic asm.txt as most interesting * src/main/pa_request.C, src/targets/isapi/parser3isapi.C, www/htdocs/index.html: removed check, preventing content-length: 0 from appearing * src/main/execute.C, www/htdocs/index.html: $result in @main now taken into account as in usual functions * src/doc/postbuild.txt, src/main/execute.C, www/htdocs/index.html: $result in @postprocess & @unhandled_exception now taken into account as in usual functions * src/doc/postbuild.txt: instructions on post .html build * src/doc/: doxygen.cfg, html2chm.cmd: .chm file only now, no .chi * src/classes/file.C, src/main/pa_exec.C, www/htdocs/index.html: stderr of execs mark as tainted * src/main/pa_request.C: uri in error log * src/: classes/date.C, main/compile.tab.C, targets/cgi/parser3.C: cheched date:create(days) param for validity [later were assumed valid and crashed on invalid onces] * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C, targets/cgi/parser3.C: OP_CALL -> OP_CALL__WRITE and used that for removing VString wrapper * src/classes/op.C: exception2vhash file now tainted * src/classes/op.C: _process pseudo origin copied from local var to heap * src/classes/op.C, www/htdocs/auto.p: extra check on empty file in origin in _execute 2002-04-15 paf * src/: main/execute.C, types/pa_value.h: fixed name update * src/classes/: file.C, op.C, table.C: finished dual write_xxx_lang functions * src/: classes/file.C, classes/hash.C, classes/op.C, include/pa_request.h, main/execute.C, types/pa_wcontext.h: started dual write_xxx_lang functions, if checked & works * src/: classes/date.C, classes/file.C, classes/mail.C, classes/string.C, classes/xnode.C, include/pa_request.h, types/pa_value.h, types/pa_wcontext.h: removed absolutely unnecessary VString shells * src/main/execute.C: CodeFrame soul fixed [mistakenly killed by prev changes] * src/: classes/image.C, classes/op.C, classes/string.C, classes/table.C, include/pa_request.h, main/execute.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_wcontext.h: StringOrValue wcontext result, now ready for dual writes * src/targets/cgi/parser3.C: ctime sometimes can be just "", checked that * src/main/: compile.tab.C, compile.y, compile_tools.C, compile_tools.h, execute.C: OP_GET_ELEMENT+OP_GET_ELEMENT__WRITE changed to OP_WRITE_VALUE in var get cases * src/classes/op.C, src/include/pa_globals.h, src/include/pa_opcode.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/pa_globals.C, src/main/pa_request.C, src/targets/cgi/parser3.C, www/htdocs/index.html: switch in hash constructor fixed [were problems with using of stacked wwrapper after it's death] 2002-04-12 paf * operators.txt, src/classes/table.C, www/htdocs/index.html: table.select(expression) 0 2002-04-11 paf * src/: classes/string.C, include/pa_request.h, main/execute.C: Request::process_internal codeFrame & wwrapper stacked [not wasting heap anymore] 2002-04-10 paf * src/: classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/int.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_request.h, main/execute.C, main/pa_string.C: killed Request::process() wrapping VString(String) in case we need only String * src/include/pa_string.h, src/main/pa_string.C, src/main/untaint.C, www/htdocs/index.html: killed 8 bytes from String.head 2002-04-09 paf * src/: main/compile.tab.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: removed { char *a; { /*sub local*/char b[...]; a=b; situations * operators.txt, src/classes/xdoc.C: xslt params made literal * src/classes/xdoc.C, www/htdocs/global.xsl, www/htdocs/index.html: xslt params fixed * src/: main/pa_common.C, targets/cgi/parser3.C, types/pa_vdouble.h, types/pa_vint.h: int/double get_string now not pool.malloc(MAX_NUMBER) but really neaded * operators.txt, src/classes/double.C, src/classes/int.C, www/htdocs/global.xsl: int/double.int/double(default) 2002-04-04 paf * src/include/pa_string.h, src/main/pa_string.C, www/htdocs/index.html: fixed string.replace [when reconstructing pieces were split by max_integral(piece.size), thus some strings to replace happen to be split into two = not replaced) * src/targets/cgi/: parser3.C, parser3.dsp: document root in standalone version = current dir * src/targets/cgi/parser3.C: document root in standalone version = current dir 2002-04-03 paf * configure, configure.in: more checks on nonexistent charset * INSTALL, configure, configure.in: root config configure options 2002-04-02 paf * src/main/compile.C: parser.compile [exception name more like in doc] 2002-04-01 paf * src/: classes/mail.C, include/pa_string.h, main/untaint.C, targets/isapi/parser3isapi.dsp: mail subject encoding taken from .content-type.charset, not .charset 2002-03-29 paf * etc/parser3.charsets/koi8-r.cfg: koi8-r += ukranian letters * operators.txt, src/classes/date.C, www/htdocs/index.html: ^date::create now may not supply day, default 1. checked 29.03 -> 29.02 roll on non 366 days' year. | 31.05->31.04 roll 2002-03-28 paf * operators.txt, src/classes/date.C, src/classes/op.C, src/include/pa_globals.h, src/include/pa_hash.h, src/main/pa_globals.C, src/types/pa_vdate.h, www/htdocs/index.html: ^cache[file][date]{ ^cache(seconds) ^cache[date] } * src/classes/: xdoc.C, xnode.C, xnode.h: removed redundant pool param 2002-03-27 paf * operators.txt, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_exception.h, src/include/pa_request.h, src/include/pa_stylesheet_connection.h, src/main/compile.C, src/main/compile_tools.C, src/main/execute.C, src/main/pa_array.C, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_pool.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_table.C, src/main/untaint.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_value.h, src/types/pa_vcookie.C, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vhash.h, src/types/pa_vmethod_frame.h, src/types/pa_vstatus.C, src/types/pa_vtable.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.h, src/types/pa_wcontext.C, src/types/pa_wwrapper.h, www/htdocs/index.html: assigned exception types * operators.txt, src/classes/op.C, src/include/pa_config_fixed.h, src/include/pa_request.h, src/main/execute.C, src/main/pa_request.C: decided agains resetting exception_trace, just changed name 2002-03-26 paf * src/: include/pa_common.h, main/pa_exec.C: windows exec chdir fixed * src/classes/op.C, www/htdocs/index.html: forced language of $source field of exception to 'tainted', so that sql-langed-frags could be outputed outside of connect * operators.txt: removed date.roll limit of +-1 offset * src/classes/date.C, www/htdocs/index.html: removed date.roll limit of +-1 offset * operators.txt, src/classes/date.C, www/htdocs/index.html: fixed date roll on daylightsaving days mktime took into account tm_isdst flag, which remained from BEFORE roll, but should have been reset 2002-03-25 paf * operators.txt, src/targets/cgi/parser3.C: http_site_config_filespec * src/: classes/file.C, classes/mail.C, include/pa_exec.h, main/pa_exec.C: f(!forced_allow) to allow --with-sendmail to work with any/both --disable-foreign-group-files --disable-execs * INSTALL: "--with=sendmail=COMMAND" comment * INSTALL, configure, configure.in, src/classes/mail.C, src/include/pa_config_auto.h.in, src/main/pa_exec.C, src/targets/cgi/Makefile.am: --disable-foreign-group-files now disables execs also. introducing --sendmail * operators.txt: pgsql options comment * INSTALL: comment on --disable-link-stdcpp * INSTALL, configure, configure.in, src/targets/cgi/Makefile.am: libstdc++ link skipping configure option * src/: classes/op.C, include/pa_sql_connection.h: sql connection with error were put to cache with 'marked_to_rollback' flag, all consequent even OK requests rolled back 2002-03-22 paf * src/main/pa_exec.C: createprocess nowindow flag check on readfile false return * operators.txt: few comments on sets 2002-03-18 paf * operators.txt, src/classes/op.C, src/include/pa_exception.h, src/include/pa_globals.h, src/include/pa_request.h, src/include/pa_stack.h, src/main/pa_globals.C, src/main/pa_request.C, www/htdocs/index.html: introducing ^try * src/: main/pa_charset.C, targets/isapi/pa_threads.C, types/pa_vdouble.h: removed some tested @tests 2002-03-15 paf * operators.txt, src/classes/table.C, www/htdocs/index.html: ^table.locate(logical expr) 2002-03-13 paf * src/main/pa_exception.C: checked not-pooled malloc 2002-03-11 paf * INSTALL, configure, configure.in, src/include/pa_config_auto.h.in: --disable-foreign-group-files * src/main/pa_common.C: --disable-foreign-group-files * INSTALL, www/htdocs/index.html: --disable-execs * src/main/pa_exec.C, www/htdocs/index.html: --disable-execs * configure, configure.in, src/include/pa_config_auto.h.in: --disable-execs * src/include/pa_config_fixed.h, src/main/pa_exec.C, www/htdocs/index.html: --disable-execs * src/types/pa_vfile.C: $file.text now 0A linebreaks, file::exec/cgi linebreaks "0D0A" changed to 0A onces 2002-03-05 paf * operators.txt, src/classes/date.C: date week calendar columns named * operators.txt, src/classes/date.C: date week calendar columns named * src/targets/isapi/: parser3isapi.C, parser3isapi.dsp: iis5 now requires headers to be terminated with \r\n manually [refuses to separate header/body itself] * src/main/pa_globals.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, www/htdocs/index.html: isapi site config beside .dll 2002-03-04 paf * src/classes/op.C, src/types/pa_vfile.C, www/htdocs/index.html: process body now evaluated in PASS language * src/: classes/op.C, include/pa_string.h, main/pa_string.C: string deserialize checks on broken file * src/targets/isapi/: pa_threads.C, parser3isapi.C, parser3isapi.dsp: isapi updated 2002-03-01 paf * src/main/pa_exec.C: execle -> execve, now argc OK 2002-02-28 paf * src/main/untaint.C: removed some debug comments * src/main/pa_charsets.C: when placing charset to cache using global name now [were request] * configure, configure.in: apache module updated * www/htdocs/auto.p: apache module updated * src/main/pa_string.C: origin by first piece preferred before last piece 2002-02-27 paf * src/main/pa_charset.C: size_t * INSTALL: shared/static-xml with-pathlink * operators.txt: SMTP comment 2002-02-26 paf * src/main/pa_exec.C: more precise names for vars, cosmetic * src/classes/xnode.C, www/htdocs/auto.p, www/htdocs/global.xsl, www/htdocs/index.html: in some situation, xpath query returned result with type NODESET, but empty nodeset member field, checked that 2002-02-22 paf * INSTALL: without-zlib comment * etc/parser3.charsets/windows-1251.cfg: ° * configure, configure.in: glib###.a detection fixed * INSTALL: hashfile removed from INSTALL * Makefile.am: make update * src/main/pa_string.C: string iterators fixed again, so were String::join_chain * src/main/pa_string.C: string iterators fixed again, so were String::join_chain * src/include/pa_string.h, src/main/pa_string.C, www/htdocs/auto.p, www/htdocs/index.html: string iterators fixed again, so were String::join_chain * src/types/pa_vcookie.C: cookie "expires=0" = "session" * operators.txt, src/types/pa_vcookie.C: cookie "expires=0" = "session" * configure, configure.in, src/include/pa_config_auto.h.in: --with-shared-xml --with-static-xml * src/: classes/classes.dsp, main/compile.tab.C, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: *.dsp: removed refereces to win32db & ancient xalan&xml * acconfig.h: acconfig move in cvs[from src/libltdl to /] * operators.txt, src/classes/classes.dsp, src/main/main.dsp, src/types/types.dsp: removed hashfile support from sources for now * configure, configure.in, src/classes/Makefile.am, src/classes/hashfile.C, src/include/Makefile.am, src/include/pa_config_auto.h.in, src/include/pa_db_connection.h, src/include/pa_db_manager.h, src/include/pa_db_table.h, src/main/Makefile.am, src/main/pa_db_connection.C, src/main/pa_db_manager.C, src/main/pa_db_table.C, src/main/pa_globals.C, src/targets/cgi/Makefile.am, src/types/Makefile.am, src/types/pa_vhashfile.C, src/types/pa_vhashfile.h: removed hashfile support for now 2002-02-21 paf * src/main/untaint.C: removed debug code, activated commented-for debug parts * Makefile.am: make cvsupdate * src/: include/pa_string.h, include/pa_types.h, main/pa_string.C, main/untaint.C: STRING_*FOREACH_ROW changed to stop at append_row, not at link zero now string to string appending works 2002-02-20 paf * src/include/pa_string.h, src/main/execute.C, src/main/untaint.C, src/targets/cgi/pa_pool.C, src/targets/cgi/parser3.C, www/htdocs/index.html: //#define DEBUG_STRING_APPENDS_VS_EXPANDS * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: economy: 22% * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: space uptimized: string::link_row removed * src/include/pa_string.h, src/include/pa_stylesheet_connection.h, src/main/pa_db_manager.C, src/main/pa_dictionary.C, src/main/pa_string.C, src/main/untaint.C, src/targets/cgi/parser3.C, src/types/pa_vcookie.C, src/types/pa_vstring.h, www/htdocs/index.html: speed uptimized: string::is_empty * operators.txt, src/include/pa_common.h, src/include/pa_config_fixed.h, src/include/pa_string.h, src/include/pa_types.h, src/main/compile.tab.C, src/main/execute.C, src/main/pa_string.C, src/main/untaint.C, src/targets/cgi/pa_pool.C, src/targets/cgi/parser3.C, www/htdocs/auto.p, www/htdocs/global.xsl, www/htdocs/index.html: strign to string append optimiziation idea and estimates 2002-02-19 paf * src/classes/math.C: not used directly [but erroreously reported that 'is', thus registering twice&other probs] * src/classes/: xdoc.C, xnode.C: getElementsByTagName and *NS moved to node [element] * src/main/compile.C: without string_origins parse error file+line+col possible * src/main/: compile.C: without string_origins not worked 2002-02-18 paf * src/types/pa_vdouble.h: since we have in_expression removed that trick i've installed into double::as_string * src/main/pa_globals.C: extern "C" was removed too fast * src/include/pa_opcode.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/types/pa_wcontext.h, www/htdocs/index.html: in_expression aimed to solve old problem with string/nonstring values, now in expressions double/int values are passed as-is, without stupid tostring/fromstring conversions * src/main/: main.dsp, pa_globals.C: removed unneded #ifdef __cplusplus } #endif * src/main/compile.tab.C: bison env set so one could compile without cygwin installed * src/: classes/classes.dsp, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, types/types.dsp: win32xml now contains gnome xml libs parser .dsp-s changed accordingly * operators.txt, src/targets/cgi/parser3.C: PARSER_ROOT_CONFIG * operators.txt, src/classes/date.C: date::create [were date::set, with backward comp * src/classes/math.C, www/htdocs/index.html: math:random range check fixed * src/main/compile.tab.C, src/main/compile.y, www/htdocs/global.xsl, www/htdocs/index.html: integer division stops name * INSTALL: local install comment * ltconfig, ltmain.sh: removed libtool subpart files * acinclude.m4, aclocal.m4, configure, configure.in, src/include/pa_config_auto.h.in, src/include/pa_config_includes.h, src/targets/cgi/Makefile.am, src/targets/cgi/parser3.C: removed libtool usage from build mech * operators.txt: \ comment 2002-02-13 paf * src/include/pa_config_includes.h: sys/time time both included now. vaguely remember confilicts on this on some system [not on six|ablv] so when would see them again would think up proper check * INSTALL, configure, configure.in, src/targets/cgi/Makefile.am: --with-glib-config CXXLINK=$(CC) for targets/cgi/parser3 * src/main/pa_common.C: truncation never occured when writing files on unix [since i've changed cache mech] fix * src/main/pa_common.C: strnchr: sanity check added * etc/parser3.charsets/windows-1257.cfg: id added * etc/parser3.charsets/windows-1257.cfg, src/targets/cgi/parser3.C: baltic charset file generated, in generation script ispunct check added 2002-02-08 paf * src/: include/Makefile.am, sql/Makefile.am, targets/isapi/Makefile.am: forgotten makes * src/types/: pa_vcookie.C: VCookie::fill_fields one check forgotten * src/types/pa_vcookie.C: VCookie::fill_fields one check forgotten * INSTALL, README: install&others updated * AUTHORS, COPYING, ChangeLog, INSTALL: install&others updated * Makefile.am, configure, configure.in, etc/parser3.charsets/Makefile.am, src/Makefile.am, src/classes/Makefile.am, src/main/Makefile.am, src/main/pa_status_provider.C, src/targets/Makefile.am, src/targets/cgi/Makefile.am, src/types/Makefile.am: 'make dist' works * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charsets.C, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, classes/image.C, main/pa_common.C, main/pa_exec.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vhashfile.C, types/pa_vimage.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vstring.C, types/pa_vtable.C, types/pa_vxdoc.C, types/pa_vxnode.C, main/pa_charset.C: name spelling * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.tab.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: 2002 2002-02-07 paf * src/main/pa_socks.C: swapped headers to avoid compiler warnings * configure, configure.in, src/include/pa_config_auto.h.in, src/main/pa_common.C, src/main/pa_socks.C: compiled under cygwin added yet another locking function: fcntl * config.sub: on cygwin configure passes it with strange i1586 const, hacked it to mean i586 * src/main/: compile.C, compile.tab.C, compile.y, compile_tools.h: disabled $if reference due to conflicts with local variables * operators.txt, src/classes/xdoc.C, src/include/pa_config_fixed.h: xdoc::set obsolete now, now xdoc::create, with both sences * operators.txt, src/classes/table.C, src/include/pa_array.h, src/include/pa_table.h, src/main/pa_array.C, src/main/pa_table.C, www/htdocs/auto.p, www/htdocs/index.html: table::create now // 'set' name obsolete now table clone. * operators.txt, src/classes/string.C, src/include/pa_config_fixed.h, src/main/compile.tab.C: ^int/double/string.format now can be called with normal [] brackets, not stupid {} as it were implemented for some strange reason. retaining backward compatibility due to some already-implemented servers * src/: include/pa_array.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h: operators now detected by check at name_without_curly_rdive_read rule whether diving code constists only of OP_VALUE+string+OP_GET_ELEMENT. and last op code substituted with OP_GET_ELEMENT_OR_OPERATOR to form OP_VALUE+string+OP_GET_ELEMENT_OR_OPERATOR. code 2002-02-06 paf * configure, configure.in: prefix expanded, grr * operators.txt, src/classes/mail.C: mail:send config changed 2002-02-05 paf * operators.txt: regex options commented * src/main/: pa_exec.C: argv0 now correct * src/types/pa_vstatus.C: status:rusage 3 * src/types/pa_vstatus.C: status:rusage 2 * operators.txt: status:rusage described int operators * src/types/pa_vstatus.C: status:rusage 1 * configure.in, src/types/Makefile.am, src/types/pa_vstatus.h, src/types/types.dsp: status:rusage * configure.in, operators.txt, src/classes/file.C, src/classes/op.C, src/include/pa_common.h, src/include/pa_config_includes.h, src/main/compile.tab.C, src/main/pa_common.C, www/htdocs/index.html: rewritten ^cache to use non-blocking-exclusive-caches * src/main/pa_common.C: text file read mode on win32 adjusted [speed impact. was off for debugging purpose, but forgotten afterwards] 2002-02-01 paf * src/classes/op.C: file_write does EX lock after create, while file_read does SH after open, so there's a moment after create but before EX lock when read can sneak into, and read just-created-for-writing-and-not-yet-locked file, added a check for that in ^cache...read 2002-01-31 paf * src/main/: compile.y, compile.tab.C: disabled operator call after ^xxx: * src/main/: compile.tab.C, execute.C: made operators lookup first in ^xxx situation. so that one could not do $if[1] ^if[xxx] * src/: include/pa_opcode.h, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, types/pa_wcontext.h: operators check 6.1 rewritten. now check is done at compile time * src/main/execute.C: operators check 5 floated up old error of staying in 'entered class/object' state after $a($a..) it prevented operators from being called thereafter * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: operators check 4 floated up old error of staying in 'entered object' state after ^a.a(a) it prevented operators from being called thereafter * src/main/execute.C: operators check 3 floated up old error of staying in 'entered class' state after $a:a(a) it prevented operators from being called thereafter * src/main/execute.C, src/types/pa_wcontext.h, www/htdocs/auto.p, www/htdocs/index.html: operators check 2 floated up old error of staying in 'entered class' state after $a:a[a] it prevented operators from being called thereafter * src/main/execute.C, www/htdocs/index.html: operators check, thay mistakenly seen in $class:operator $object.operators contexts * src/classes/xdoc.C, src/targets/cgi/parser3.dsp, www/htdocs/index.html: now compiles under win32 * INSTALL, configure, configure.in, ident.awk, etc/Makefile.am, src/classes/Makefile.am, src/main/Makefile.am, src/targets/cgi/Makefile.am, src/targets/cgi/pa_config_paths.h.in, src/targets/cgi/parser3.C, src/types/Makefile.am: lowered indent.awk back to src/ * AUTHORS, COPYING, ChangeLog, INSTALL, Makefile.am, NEWS, README, acinclude.m4, aclocal.m4, asm.txt, config.guess, config.sub, configure, configure.in, form.txt, ident.awk, install-sh, lang.txt, ltconfig, ltmain.sh, missing, mkinstalldirs, operators.txt, parser3.dsw, sql.txt, types.txt, etc/Makefile.am, etc/parser3.charsets/Makefile.am, etc/parser3.charsets/koi8-r.cfg, etc/parser3.charsets/windows-1250.cfg, etc/parser3.charsets/windows-1251.cfg, src/Makefile.am, src/classes/Makefile.am, src/include/pa_config_auto.h.in, src/main/Makefile.am, src/targets/cgi/Makefile.am, src/targets/cgi/parser3.C, src/types/Makefile.am, www/Makefile.am, www/htdocs/auto.p, www/htdocs/global.xsl, www/htdocs/index.html, www/htdocs/parser-status.html, www/htdocs/people.dtd: moved etc&www out of src, moved configure&co out of src added windows-1250.cfg straightened installation scripts procedure made targets/cgi/parser3.C be dependant on ./configure --sysconfdir change 2002-01-30 paf * src/classes/xdoc.C: acconfig.h changed [comments before #undefs removed] those comments were a mistake, and prevented libltdl from function properly 2002-01-29 paf * src/: Makefile.am, classes/Makefile.am: removed libltdl/libtool creation [modified acinclude.m4 which were creating int into just assignment LIBTOOL=../libtool] added default system config&charsetts prepared 'make install', now it installs targets/cgi/parser3 into bin directory etc/parser3.conf & etc/parser3.charsets/* into $sysconfdir and $sysconfdir/parser3.charsets respectively * src/: classes/xdoc.C, include/pa_charset.h, include/pa_globals.h, main/pa_globals.C: few forgotten ifdef XML added 2002-01-28 paf * src/: classes/Makefile.am, targets/cgi/Makefile.am: xalan-patch removed * src/main/pa_exception.C: dom|generic error output fix * src/classes/xnode.C: xdoc.importNode 3 [check err] * src/classes/xnode.C: xdoc.importNode 2 [mistype err] * src/: classes/xnode.C, types/pa_vxdoc.h: xdoc.importNode 1 [fixed as_node helper func to accept docs] * src/: classes/xdoc.C, classes/xnode.h, main/pa_exception.C: xdoc.importNode 0 * src/classes/xdoc.C: xdoc::set now untaints OK 2002-01-25 paf * src/main/: compile.tab.C, compile.y: #comment before @ after @SPECIAL now works OK * src/main/: pa_exec.C: unix: exec now does chdir to script dir * src/main/pa_exec.C: max arg count now 10, and proper message on violation that added * src/classes/hash.C: unified hash::sql, now ^hash::sql{query}[[$.limit(2) $.offset(4)]] * src/: classes/file.C, include/pa_common.h, main/pa_common.C: ^file:lock[filename]{code} * src/: classes/file.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_common.h, main/pa_common.C, types/pa_vfile.h: removed redundant pool param to some pa_common funcs * src/: include/pa_charset.h, main/pa_globals.C: http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc * src/: include/pa_charset.h, main/pa_charset.C, include/pa_config_fixed.h, main/compile.tab.C: typedef XMLCh... not stupid illegal define 2002-01-24 paf * src/include/pa_version.h: changed version number * src/: classes/hashfile.C, include/pa_db_table.h, include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_db_connection.C, main/pa_db_table.C, types/pa_vhashfile.C, types/pa_vhashfile.h: merged from r17 - hashfile without logfiles * src/: classes/hashfile.C, include/pa_db_table.h, main/compile.tab.C, main/pa_db_connection.C, main/pa_db_table.C, types/pa_vhashfile.C, types/pa_vhashfile.h: hashfile: removed use of transactions [libdb removed DB_INIT_LOCK, DB_INIT_LOG, DB_INIT_TXN init bits, thus got rid of huge log files, which cluttered disk without huge need] * src/classes/: xdoc.C, xnode.C, xnode.h: gdome_xml_doc_get_xmlDoc handy macro, which is strangly abscent in dome lib * src/classes/xdoc.C: xsltSaveResultTo checked <0 response * src/classes/xdoc.C: checked empty response * src/classes/xnode.C: xdoc.select fixed context node [were always /, not self node] * src/classes/xnode.C: xnode.select returns array always now, in case 'nothing found' returns empty array * src/classes/xnode.C: xpath nodes select bug [0] instead of [i], be more tender with ctrl/c/v 2002-01-23 paf * src/: classes/xdoc.C, main/pa_globals.C: xdoc::load/set entities substituted. // 2. when dom tree with entites goes under transform text nodes // got [erroreosly] cut on first entity occurance * src/types/pa_vdouble.h: double prec. todo: get rid of twice-converting * src/types/pa_vdouble.h: %.20E now float format when %g produced 'e' in output this is for regretful twice-converting here: $a(double value) when they write double falue they convert it to string first, thus %g were losing precesion. todo: think up some way to remove double->string string->double twice-converting * src/: classes/xdoc.C, main/pa_globals.C, types/pa_vdouble.h: %.20E now default float format this is for regretful twice-converting here: $a(double value) when they write double falue they convert it to string first, thus %g were losing precesion. todo: think up some way to remove double->string string->double twice-converting * src/: classes/xdoc.C, include/pa_stylesheet_connection.h, main/pa_globals.C: xmlSubstituteEntitiesDefault(1) now global, reasons in comment inside * src/main/pa_globals.C: xslt linked dynamically. [mistekenly were statically linked] * src/: include/pa_exception.h, main/compile.tab.C, main/pa_exception.C: removed exception va_list constructor. 1. not needed anymore 2. there were a conflict[causing errors] between ctor(, va_list) ctor(, ...) compiler[both msvc and gcc] never detected an ambiguilty here, compiling ctor(, "hello") into ctor(, va_list) which, of course, caused gpf * src/main/pa_globals.C: removed debug xslt messages 2002-01-22 paf * src/: classes/xdoc.C, include/pa_stylesheet_connection.h, main/pa_globals.C: xsl stylesheet load: parsed entities, this helps compiling stylesheet properly. example: this refused to work, «» stranly worked only this way: «» docs says "set it to 1", never going into details, so I decided to try NOT to do that * src/classes/table.C: join behaived badly in case named tables structure mismatched: 0 strings sneaked into dest failing afterwards. replaced them with empty strings 2002-01-21 paf * src/main/pa_charset.C: checked empty transcoders in transcode_cstr|buf * src/classes/xdoc.C: xdoc::load error source = filespec * src/classes/xdoc.C: transform error source now stylesheet_filespec * src/: classes/xdoc.C, classes/xnode.C, include/pa_stylesheet_connection.h, main/pa_charset.C, main/pa_globals.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/Makefile.am: autoconf gnome * src/: classes/xdoc.C, classes/xnode.C, include/pa_exception.h, include/pa_globals.h, include/pa_stylesheet_connection.h, main/pa_exception.C, main/pa_globals.C, targets/cgi/pa_threads.C: xslt generic error 1 * src/: include/pa_stylesheet_connection.h, main/pa_exception.C: xml generic message 1 * src/classes/table.C: ^table::load empty lines or #comments before headline * src/: include/pa_array.h, include/pa_globals.h, include/pa_request.h, include/pa_threads.h, main/pa_array.C, main/pa_exception.C, main/pa_globals.C, main/pa_request.C, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C: xml generic errors 0 2002-01-16 paf * src/: classes/hash.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_db_connection.h, include/pa_request.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/pool_storage.h: auto closers to sql_connection, stylesheet_connection auto destroyers to remaining gnome objects * src/classes/xdoc.C: few comments 2002-01-15 paf * src/classes/xdoc.C: xdoc file save string ready. todo: error handling * src/classes/xdoc.C: xdoc save rewritten using xmlAllocOutputBuffer less mallocs, more reallocs. less fragmented result * src/: classes/xdoc.C, include/pa_charset.h, main/pa_charset.C: started output options parsing 2002-01-14 paf * src/classes/xdoc.C: method * src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h, include/pa_pool.h, include/pa_stylesheet_connection.h, main/main.dsp, main/pa_charset.C, main/pa_globals.C, main/pa_pool.C, main/pa_stylesheet_manager.C, types/pa_vxdoc.h: xslt transform0. TODO: use output options handle errors * src/classes/: xdoc.C, xnode.C: ^xdoc.file 2002-01-11 paf * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: partial logical && || evaluation * src/classes/xnode.C: xpath selectNodes * src/: classes/xnode.C, include/pa_charset.h: xpath selectNode 3: string/number/bool * src/classes/xnode.C: xpath selectNode 2 * src/: classes/xnode.C, include/pa_charset.h, main/pa_charset.C: xpath selectNode 1 2002-01-10 paf * src/classes/xnode.C: xpath selectNode -100 [just written] * src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h, include/pa_exception.h, include/pa_pool.h, main/pa_charset.C, main/pa_pool.C: GdomeDOMString_auto_ptr c++ wrapper [calls refcounter] 2001-12-29 paf * src/: classes/xdoc.C, include/pa_exception.h, main/pa_charset.C, main/pa_exception.C, main/pa_globals.C: xdoc ^set ^string with glib works 0 2001-12-28 paf * src/: classes/xdoc.C, include/pa_charset.h, main/pa_charset.C, main/pa_exception.C: started glib transcoders * src/main/pa_globals.C: renamed gdome to libgdome.dll * src/: classes/classes.dsp, classes/mail.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_exception.h, include/pa_globals.h, main/compile.tab.C, main/main.dsp, main/pa_charset.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_socks.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: gnome libs just compiled in. no refcounting no xpath no xslt yet 2001-12-27 paf * src/: include/pa_charset.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_pool.h, main/main.dsp, main/pa_charset.C, main/pa_charsets.C, main/pa_globals.C, main/pa_pool.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/types.dsp: going away from xalan&xerces, started the process. globals [initialization pool [charset update charset [transcodings vxnode vxdoc [DOM calls * src/classes/Makefile.am: going away from xalan&xerces, not needed anymore 2001-12-26 paf * src/: include/pa_charset.h, include/pa_charsets.h, main/pa_charset.C, main/pa_charsets.C, main/pa_request.C: charset key globalized [bug] 2001-12-25 paf * src/: classes/mail.C, classes/table.C, include/pa_string.h, main/pa_string.C: table set & append changed splitting languages, separators now can be clean AND as-is same to mail command line $MAIN:MAIL.progX arguments 2001-12-24 paf * src/classes/mail.C: one parted text messages - no multipart mime-type anymore. for convinient if $.attach-ments * src/: classes/hashfile.C, classes/op.C, main/pa_db_table.C, main/pa_string.C: read from cache size check updated * src/main/: pa_string.C: String::join_chain another ugly bug :( 2001-12-21 paf * src/classes/date.C: date:sql-string now returns localtime * src/main/pa_request.C: $result in @main actually not working, to hell with it for now * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.h, types/pa_wcontext.h: $result in @main @postprocess @exception * src/main/execute.C: junction evaluation canceled - endless recursion detected 2001-12-19 paf * src/main/pa_charset.C: charset->charset transcoding via unicode intermediate * src/main/pa_request.C: CLASS_PATH now / = DOCUMENT_ROOT * src/classes/hashfile.C: ^hashfile.open DB_HOME now relative * src/classes/op.C: ^cache keypath now relative * src/classes/mail.C: changed weighting prior to sort * src/: classes/mail.C, include/pa_config_fixed.h: to/from 0 check were missing 2001-12-17 paf * src/main/pa_charset.C: ifndef XML were bad type * src/: include/pa_db_table.h, main/pa_db_table.C: db_table used outdated unset services_pool * src/: classes/mail.C, include/pa_charsets.h, include/pa_string.h, main/pa_charsets.C, main/untaint.C, types/pa_vrequest.C, types/pa_vresponse.C: ^mail:send[ $.charset[zzz] addded * src/main/untaint.C: allowed space in filespec * src/main/pa_charset.C: empty bufs transcode [forgot check :(] * src/classes/image.C: no govno * src/classes/image.C: govno 2001-12-16 paf * src/include/: pa_charset.h, pa_charsets.h: forgot to add * src/: main/Makefile.am, main/pa_charset.C, types/Makefile.am: charset_connection&manager replaced by charset&charsets * src/main/pa_charset.C: name_cstr 0 * src/main/untaint.C: uri lang now knows about client/source charsets * src/: classes/file.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset_connection.h, include/pa_charset_manager.h, include/pa_common.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_transcoder.h, main/compile_tools.h, main/main.dsp, main/pa_charset.C, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_charsets.C, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_transcoder.C, main/untaint.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vform.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/types.dsp: introducing Charset 2001-12-14 paf * src/: include/pa_request.h, include/pa_transcoder.h, main/pa_request.C, main/pa_transcoder.C, types/pa_vform.C, types/pa_vform.h: transcodeToUTF8[were FromUTF8] for forms todo: uri lang * src/main/pa_transcoder.C: transcodeToUTF8, now form&uri lang * src/targets/cgi/Makefile.am: -I../../pcre to .am * src/: include/pa_globals.h, main/pa_globals.C: removed unused defalts_name global * src/: include/pa_charset_connection.h, include/pa_pool.h, include/pa_request.h, main/main.dsp, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_request.C, types/Makefile.am, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.h, types/types.dsp, include/pa_transcoder.h, main/pa_transcoder.C, main/Makefile.am: changed charset model. now important: $request:charset $response:charset while $response:content-type.charset become unimportant [informational] 2001-12-13 paf * src/targets/: cgi/pa_pool.C, isapi/pa_pool.C: EOL@EOF * src/classes/xdoc.C: rewritten auto_ptr part other way2, because of stupid gcc 2.96 /usr/include/g++-3/memory:40: candidates are: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp> &) [with _Tp = FormatterListener] /usr/include/g++-3/memory:48: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp1> &) [with _Tp1 = FormatterListener, _Tp = FormatterListener] * src/: classes/xdoc.C, main/pa_sql_driver_manager.C: rewritten auto_ptr part other way, because of stupid gcc 2.96 /usr/include/g++-3/memory:40: candidates are: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp> &) [with _Tp = FormatterListener] /usr/include/g++-3/memory:48: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp1> &) [with _Tp1 = FormatterListener, _Tp = FormatterListener] * src/classes/xdoc.C: removed extra inc * src/targets/cgi/: pa_pool.C, parser3.C: msvc heap debugging flag * src/include/pa_types.h: msvc head debugging flag * src/classes/xdoc.C: freed up listener * src/classes/string.C: change msg '... code is not code' * src/: main/pa_db_connection.C, main/pa_db_manager.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/pool_storage.h: couple cache expiratiors were wrong [past/future prob] * src/: include/pa_cache_managers.h, include/pa_charset_manager.h, include/pa_config_fixed.h, include/pa_db_manager.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/pa_cache_managers.C, main/pa_globals.C: ~Cache_managers * src/: include/pa_config_fixed.h, main/pa_common.C, main/pa_string.C: removed signed mismatch warnings * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: removed 'expires' from header outputs * src/main/pa_string.C: string::recustruct erroreusly used outdated row ptr * src/classes/file.C: file::cgi bug, request_method were passed to SERVER_PROTOCOL but SERVER_PROTOCOL were forgotten * src/classes/xdoc.C: lang list updated 2001-12-10 paf * src/classes/math.C: ^math:random(n) now yields[0;n) not [0;n] * src/main/untaint.C: FILE_SPEC untainting changed so that one can erase files like that, knowing their full name introducing // theoretical problem with, for instance, "_2B" and "." fragments, // they would yield the same // because need_file_encode('_')=false // but we need to delete such files somehow, getting names from ^index * src/main/pa_string.C: ^string.replace bug fixed [bad string::join_chank break] 2001-12-07 paf * src/: classes/hashfile.C, classes/op.C, classes/table.C, include/pa_common.h, include/pa_config_auto.h.in, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_table.h, include/pa_request.h, main/pa_common.C, main/pa_db_table.C, main/pa_request.C, main/pa_string.C, types/pa_vhashfile.C: merged from r14_simple_cache * src/main/pa_string.C: stupid sparc architecture failed to access short at odd address 0x311f0 : lduh [ %i2 + 1 ], %l0 bus error, fixed that * src/main/pa_string.C: strange string deserialize bug on client[pmts], a bit shortened, * src/include/pa_config_auto.h.in: makes * src/: include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, main/pa_common.C: exclusive lock file write shared lock file read * src/: classes/op.C, include/pa_common.h, include/pa_config_fixed.h, main/pa_common.C: ^cache operator 2001-12-06 paf * src/: classes/op.C, classes/table.C, include/pa_request.h, main/pa_request.C: #ifdef RESOURCES_DEBUG * src/: main/compile.tab.C, targets/cgi/parser3.C: removed debug info * src/classes/hashfile.C: removed transaction from ^cache 2001-12-05 paf * src/targets/cgi/: parser3.C: fatal error reporting fixed. in IIS5 there were a prob with illegal call check 2001-12-04 paf * src/: classes/op.C, classes/table.C, include/pa_request.h, main/pa_request.C: measures to log 2001-11-23 paf * src/: classes/hashfile.C, classes/table.C, include/pa_db_table.h, main/pa_common.C, main/pa_db_table.C, main/pa_string.C, types/pa_vhashfile.C: merged from _0014, 1 * src/: classes/hashfile.C, classes/table.C, include/pa_db_table.h, main/pa_common.C, main/pa_db_table.C, types/pa_vhashfile.C: hashfile bugfix2 more wrong sizes. ^cache behaviour changed: if ^cache(33) would change 0660 bits in file_write & hashfile create * src/main/: pa_db_table.C, pa_string.C: cache bugfix [wrong types after pa_string optimization] 2001-11-22 paf * src/: classes/table.C, include/pa_table.h, main/pa_table.C: table.offset[whence] * src/classes/op.C: process cstr(,connection) * src/classes/op.C: process now gets its body on current language, not as-is * src/main/untaint.C: ORIGINS mode removed UHTML * src/main/untaint.C: ORIGINS mode was bad - forgot about optimize bit * src/classes/xdoc.C: cached xslt [removed nocache forcing] 2001-11-21 paf * src/: classes/xdoc.C, types/pa_vxdoc.C, types/pa_vxdoc.h: buffer_size checked all that * src/classes/op.C: ^untaint{body} as-is default now * src/: main/execute.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h: merged with no_bad_constructors_try * src/: main/execute.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h: fixed this: $bred[^string::length[]] $bred[^response::clear[]] $bred[^int::int[]] now VObject creation moved into overriden VClass::create_new_value, thus 0 from create_new_value means that class has no ctors 2001-11-13 paf * src/classes/classes.C: returned accedently removed if in foreach callbacks [when hash no-0-restructure] 2001-11-12 paf * src/main/pa_pool.C: changed xdoc createXXX politics, now string passed as-is to method, xalan makes & into & itself * src/classes/date.C: date.roll parser2 alg used * src/: classes/classes.C, classes/hash.C, classes/xdoc.C, include/pa_hash.h, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_dictionary.C, main/pa_hash.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: hash now does not containt 0 values. put 0 actullay removes. no check on 0 value in foreach now required 2001-11-11 paf * src/sql/pa_sql_driver.h: removed extra constructor, doc * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: CRLF * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql driver initialize not const 2001-11-10 paf * src/main/pa_exec.C: doc 2001-11-09 paf * src/classes/: string.C, xdoc.C: xdoc::set{code} now untaints param properly * src/classes/string.C: string.save now does untainting before saving * src/main/pa_common.C: line endings fixing fixed last piece[was still cstr oriented] * src/: include/pa_common.h, main/pa_common.C, types/pa_vform.C: line endings fixing got rid of cstr, now must work ok with post multipart * src/types/pa_vform.C: line endings fixed at post / multipart / not file also now 2001-11-08 paf * src/: include/pa_cache_managers.h, include/pa_charset_manager.h, include/pa_db_manager.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/pa_charset_manager.C, main/pa_db_manager.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: restructured Cache manager to be simple parent, not second parent [gcc 2.96 strangly refused to call virtual from second parent] * src/: include/pa_common.h, main/Makefile.am, targets/cgi/pa_pool.C: makes * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: apache 'status' class enabler ParserStatusAllowed * src/: include/pa_cache_managers.h, include/pa_charset_manager.h, include/pa_db_manager.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/main.dsp, main/pa_cache_managers.C, main/pa_charset_manager.C, main/pa_db_manager.C, main/pa_globals.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, types/pa_vstatus.h: cache_managers, maybe-expiring every request todo: apache 'status' class enabler 2001-11-05 paf * src/main/: pa_db_connection.C, pa_db_manager.C: expiration from debug to normal * src/main/: pa_db_connection.C, pa_db_manager.C, pa_request.C: hence i removed skipping 0 values in hash::for_each-es we need to check cleaned cache items manually. few more checks. expiring to 0 time was wrong, changed to 'now' time * src/targets/cgi/parser3.C: read can return 0, that means sort of sig_pipe on freebsd [moko's experiments]. checked that in cgi, on apache already done :) * src/main/: pa_db_connection.C, pa_db_manager.C: hence i removed skipping 0 values in hash::for_each-es we need to check cleaned cache items manually * src/main/: pa_db_connection.C, pa_db_table.C: parser_multithreaded check was wrong * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_charset_connection.h, include/pa_charset_manager.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.tab.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_common.C, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: $status:db fixed used not initialized in db_connection & db_table * src/: include/pa_charset_connection.h, main/pa_charset_manager.C: $status:charset * src/: classes/xdoc.C, include/pa_db_connection.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C, types/pa_vstatus.h: $status:stylesheet * src/: include/pa_charset_manager.h, include/pa_db_manager.h, include/pa_request.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/main.dsp, main/pa_charset_manager.C, main/pa_common.C, main/pa_db_manager.C, main/pa_globals.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_stylesheet_manager.C, types/pa_vstatus.h, types/pa_vxnode.C, types/types.dsp: started status parser class 2001-11-01 paf * src/include/pa_config_auto.h.in: makes * src/main/pa_hash.C: removed old extra include * src/: classes/math.C, include/pa_common.h: HAVE_TRUNC HAVE_ROUND checks [for hp, there are such in math.h] * src/classes/op.C: ^for endless loop check strightened * src/: classes/hash.C, classes/op.C, main/execute.C: changed root behavior in native calls. it left unchanged, so ^for ^foreach & co can use r.root to write their i & key,value there * src/classes/op.C: detected for var storage bug, fixed. todo:foreach * src/: classes/hash.C, classes/xdoc.C, classes/xnode.C, include/pa_hash.h, main/pa_hash.C, main/pa_request.C, types/pa_vhash.h, types/pa_vxnode.C: hash locking disabled changing of hash inside of foreach * src/: classes/hash.C, classes/hashfile.C, types/pa_vhashfile.C: ^hashfile.foreach[key|value]{body}[[separator]|{separator}] prev were hash.foreach * src/: classes/hash.C, classes/op.C, types/pa_vmethod_frame.h, types/pa_vstring.C, types/pa_vstring.h: ^foreach[key|value]{body}[[separator]|{separator}] * src/: classes/hash.C, include/pa_hash.h, main/pa_hash.C, types/pa_vcookie.C: ^hash.delete[key] 2001-10-31 paf * src/main/: compile.C, pa_common.C: completely empty file now considered "read", not ignored [not perfect trick used] * src/main/pa_common.C: simplier common ifdefs * src/main/pa_common.C: typing bug in common - bad ifdeff * src/main/pa_db_connection.C: z * src/main/: pa_db_connection.C, pa_sql_driver_manager.C: // lockdetector flags dbenv.lk_detect=DB_LOCK_RANDOM; * src/main/pa_sql_driver_manager.C: hiding passwords and addresses from accidental show [imagine user forgot @exception] * src/classes/table.C: ^table.save[[nameless|+append;]path] * src/: classes/file.C, classes/image.C, classes/mail.C, classes/string.C, classes/xnode.C, include/pa_common.h, main/pa_common.C: ^string.save[[append;]path] * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: \ in expression: int divide 10/3=3 * src/types/pa_vhashfile.h: hashfile ^delete to do something only inside of ^cache * src/: include/pa_threads.h, main/pa_db_connection.C, main/pa_db_table.C, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C: libdb DB_THREAD flag only when really needed 2001-10-30 paf * src/: classes/classes.dsp, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: enabled debug incremental compile * src/: include/pa_common.h, main/pa_common.C, types/pa_vform.C: form post data line endings not reformatted now. * src/types/: pa_vform.C, pa_vform.h: AppendFormEntry length param now required [had bug when file= has no value] * src/main/: pa_db_connection.C, pa_db_manager.C, pa_db_table.C, pa_exec.C, pa_request.C, pa_sql_driver_manager.C, pa_string.C: cstr(asis) default param removed * src/classes/xdoc.C: rolled back {} in xdoc.createTextNode for now * src/classes/xdoc.C: rolled back {} in xdoc.createElement for now * src/include/pa_dir.h: LOAD_DIR fixed * src/types/pa_vform.C: VForm::AppendFormEntry {length convention was broken} fix_line_breaks * src/include/: pa_config_fixed.h, pa_pragma_pack_begin.h, pa_pragma_pack_end.h, pa_string.h, pa_types.h: String & Origin packed with #pragma pack * src/include/pa_config_auto.h.in: pragma detection 2001-10-29 paf * src/types/pa_wcontext.h: bitfield syntax stricter * src/: classes/file.C, types/pa_vimage.C: image&file couple stack string hash.puts * src/include/pa_sql_connection.h: SQL_CONNECTION_FUNC_GUARDED name * src/include/pa_sql_connection.h: there were one wrong SQL_CONNECTION_FUNC_GUARDED [failed] * src/targets/isapi/pa_pool.C: added isapi&apache real_malloc debug param.someday either ifdef or remove it * src/targets/cgi/: pa_pool.C, parser3.C: removed debug defines * src/main/untaint.C: optimizing returned after debugging * src/: include/pa_string.h, include/pa_types.h, main/pa_string.C, main/untaint.C: memory hunging #pragma pack(1) 16 419 844 13 169 394 * src/: include/pa_string.h, main/pa_string.C, main/untaint.C, targets/cgi/pa_pool.C: String size_t replace to uint in proper places [todo:Array] * src/: main/execute.C, targets/cgi/pa_pool.C, targets/cgi/parser3.dsp, types/pa_wcontext.h, types/pa_wwrapper.h: debugging memory WContext flags to bits total 5 652 652/158731 total 5 469 332/158731 * src/: include/pa_array.h, main/pa_array.C: debugging memory Array:: without cache in get/put now [Mon Oct 29 18:23:02 2001] total 5 796 092/158731 [Mon Oct 29 18:25:27 2001] total 5 652 652/158731 * src/: include/pa_string.h, main/pa_string.C, targets/cgi/pa_pool.C: debugging memory String::fused_rows func now [Mon Oct 29 17:55:45 2001] total 5917436/158731 [Mon Oct 29 18:11:53 2001] total 5796092/158731 * src/: classes/file.C, include/pa_hash.h, include/pa_string.h, main/pa_globals.C, targets/cgi/pa_pool.C: debugging memory hash key ref now [Mon Oct 29 16:01:17 2001] total 17050496/202647 [Mon Oct 29 17:11:17 2001] total 16867948/202658 * src/: classes/file.C, classes/image.C, classes/string.C, classes/xdoc.C, include/pa_pool.h, include/pa_string.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/untaint.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_vstring.h: debuggging memory. string::as_int/double now usually uses stack, not heap [200K out of 17M :)] VString(String&) not copies reference [29M -> 17M] * src/main/pa_sql_driver_manager.C: ping to have services [old hiding bug] * src/Makefile.am: .am order * src/: include/pa_array.h, include/pa_charset_manager.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_hash.h, include/pa_request.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, include/pa_threads.h, types/pa_valiased.h, types/pa_vhashfile.h, types/pa_vstateless_class.h, types/pa_wcontext.h: gcc 3.0.1 required "friend class" ../include/pa_request.h:51: friend declaration requires class-key, i.e. `friend class Temp_lang' * src/: include/pa_exception.h, include/pa_sql_connection.h, main/pa_exception.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql driver impl changed in _throw part. the idea is to #1 jump to C++ some function to main body, where every function stack frame has exception unwind information and from there... #2 propagate_exception() 2001-10-28 paf * src/main/pa_db_connection.C: removed old consts * src/main/pa_db_connection.C: expire table [was accidently pasted with wrong type/cast] * src/main/: pa_db_connection.C, pa_db_table.C: exception translation * src/: classes/Makefile.am, targets/cgi/Makefile.am: db makes. remember to build DB2 with -fexceptions!!! * src/main/pa_db_table.C: DB_RMW defed * src/: include/pa_config_auto.h.in, include/pa_config_fixed.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, main/pa_db_connection.C, main/pa_db_table.C: db2 on linux with DB 2.4.14: (6/2/98) 2001-10-27 paf * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_table.h, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_globals.C, types/pa_vhashfile.C: DB2 ifdefs * src/: classes/Makefile.am, include/pa_config_fixed.h, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: makes with DB2 * src/: include/pa_config_auto.h.in, main/Makefile.am, types/Makefile.am: makes db * src/: main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp: vc projects libdb ifdefed into globals.C * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_table.h, main/pa_db_connection.C, main/pa_db_table.C: ^hashfile.clear[] * src/classes/classes.awk: no $ in var names * src/main/: pa_db_connection.C, pa_db_manager.C: db expiration connection&table [forgotten calls] 2001-10-26 paf * src/main/pa_db_connection.C: db checkpoints * src/: include/pa_db_connection.h, main/pa_db_connection.C: db checkpoints * src/classes/xdoc.C: xdoc createTextNode createElement UL_XML default. but entities still reparsed. todo: tothink * src/main/pa_db_connection.C: db recover mech 2 * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_hash.h, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_hash.C, types/pa_vhashfile.C, types/pa_vhashfile.h: db connections & tables now cached at create time & multithreaded * src/: classes/xdoc.C, types/pa_vxdoc.h: transform2 for parsed_source * src/main/pa_db_connection.C: about to remove connection from vhashfile * src/: main/pa_db_table.C, classes/hashfile.C: db: child transaction commit/rollback responsibility left to parent [as it sould - else there were a bug with double free] * src/include/pa_db_table.h: db: child transaction commit/rollback responsibility left to parent [as it sould - else there were a bug with double free] 2001-10-25 paf * src/: classes/hashfile.C, include/pa_common.h, include/pa_db_connection.h, include/pa_db_manager.h, main/main.dsp, main/pa_db_connection.C, main/pa_db_manager.C, types/pa_vhashfile.C, types/pa_vhashfile.h, include/pa_db_table.h, main/pa_db_table.C: started db_home [multiple, cached] todo: autorecover [tried, but not succeded, yet] * src/include/pa_dir.h: ancient gpf on dir not found fixed * src/: include/pa_db_connection.h, main/pa_db_manager.C: transaction parent passed 2001-10-24 parser * src/classes/Makefile.am: makes * src/targets/: cgi/pool_storage.h, isapi/parser3isapi.C, isapi/pool_storage.h: pool_storage fixed * src/: include/pa_common.h, main/pa_common.C, types/pa_vform.C, types/pa_vform.h: form fix_line_breaks * src/targets/cgi/pool_storage.h: makes * src/: classes/Makefile.am, targets/cgi/Makefile.am, targets/cgi/pool_storage.h: makes * src/sql/pa_sql_driver.h: version * src/: include/pa_common.h, main/Makefile.am, main/pa_common.C, types/pa_vform.C, types/pa_vform.h: .am * src/main/: pa_db_connection.C, pa_db_manager.C: hashfile setted this: DB_RMW Acquire write locks instead of read locks when doing the retrieval. Setting this flag may decrease the likelihood of deadlock during a read-modify-write cycle by immediately acquiring the write lock during the read part of the cycle so that another thread of control acquiring a read lock for the same item, in its own read-modify-write cycle, will not result in deadlock * src/targets/isapi/parser3isapi.dsp: doc * src/: classes/hashfile.C, types/pa_vhashfile.h: hashfile 1 * src/: classes/hashfile.C, include/pa_request.h: hashfile.cache 0 * src/: classes/hashfile.C, include/pa_db_connection.h, main/pa_db_connection.C: hashfile expired deleted from db when get & iterate * src/: main/pa_db_connection.C, types/pa_vhashfile.C: hashfile expiring 1 * src/types/: pa_vhashfile.C, pa_vhashfile.h: hashfile expiring 0 * src/: main/pa_db_connection.C, types/pa_vhashfile.C: db_connection not bothers with key when not returning expired data * src/: include/pa_db_connection.h, main/pa_db_connection.C, types/pa_vhashfile.C: db_cursor constructor public now * src/: include/pa_db_connection.h, main/pa_db_connection.C, types/pa_vhashfile.C, types/pa_vhashfile.h: hashfile data stamped, todo: put_element analize * src/: include/pa_db_connection.h, include/pa_string.h, main/pa_db_connection.C, main/pa_string.C: hashfile pieced serialize. todo stamp 2001-10-23 parser * src/: classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/mail.C, classes/response.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_config_fixed.h, include/pa_db_connection.h, main/pa_common.C, main/pa_db_connection.C, main/pa_request.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vresponse.h, types/pa_vtable.C: ^hashfile.hash[] * src/: classes/hashfile.C, classes/xdoc.C, include/pa_config_fixed.h, main/pa_db_manager.C, main/pa_globals.C: ifdefs so it compiled without db * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_manager.h, main/pa_db_connection.C, main/pa_db_manager.C, types/pa_vhashfile.h: ^hashfile.transaction{code} ^hashfile:clear[filename] ^hashfile.delete[key] 2001-10-22 parser * src/targets/: cgi/pa_pool.C, cgi/parser3.C, cgi/parser3.dsp, cgi/pool_storage.h, isapi/pool_storage.h: cgi += pool cleanups * src/: classes/classes.dsp, classes/hashfile.C, classes/xdoc.C, classes/xnode.C, include/pa_charset_connection.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_exception.h, include/pa_sapi.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_exception.C, main/pa_globals.C, main/pa_pool.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, main/pa_xslt_stylesheet_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vxdoc.C, types/pa_vxnode.C, types/types.dsp: hashfile 0 * src/types/pa_vhashfile.C: z * src/: classes/classes.dsp, classes/hashfile.C, include/pa_config_fixed.h, main/execute.C, targets/cgi/parser3.dsp, types/pa_vhashfile.C, types/pa_vhashfile.h, types/types.dsp: hashfile -100 * src/targets/isapi/parser3isapi.C: SEH minor ifdef changes * src/: include/pa_exception.h, include/pa_request.h, main/execute.C, main/pa_exception.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vclass.h, types/pa_vobject.h: stack backtrace 2001-10-19 parser * src/include/pa_pool.h: header * src/main/pa_pool.C: auto compiled on gcc * src/classes/image.C: comment * src/: include/pa_pool.h, main/pa_common.C: makes * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: xnode clone got freed * src/: classes/xdoc.C, classes/xnode.C, include/pa_pool.h, include/pa_types.h, main/pa_pool.C: first c++ exceptions result: can free up xalandomstring resulting from pool::transcode * src/: classes/Makefile.am, classes/xdoc.C, classes/xnode.C, include/pa_config_fixed.h, include/pa_exception.h, include/pa_stylesheet_connection.h, main/pa_charset_connection.C, main/pa_exception.C, main/pa_pool.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: switched to c++ exceptions 1xml configure fixed to exclude xalan-patch from non-xml compile * src/main/pa_request.C: pool:: context - get_context * src/: classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, include/pa_config_fixed.h, include/pa_exception.h, include/pa_pool.h, include/pa_request.h, include/pa_types.h, main/compile.C, main/compile_tools.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dictionary.C, main/pa_exception.C, main/pa_exec.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_vtable.C, types/pa_wcontext.C, types/pa_wwrapper.h: switched to c++ exceptions 0 * src/classes/classes.awk: $ removed 2001-10-18 parser * src/types/pa_vcookie.C: cookie:CLASS * src/main/main.dsp: project * src/: classes/xdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C: vxdoc set_document & ctor question "who owns document" solved * src/: classes/xdoc.C, main/pa_pool.C: extra free removed * src/: classes/xdoc.C, classes/xnode.C, include/pa_pool.h, main/pa_pool.C: encoding in dom creating funcs * src/: classes/xdoc.C, types/pa_vxdoc.h: dom created by create can be transformed now * src/classes/xdoc.C: dom created by create can be transformed now * src/classes/xdoc.C: z * src/classes/xdoc.C: comment * src/: classes/xdoc.C, classes/xnode.C, main/compile.tab.C: xdoc create now uses XercesDocumentBridge, appendChild&co now works * src/include/pa_stylesheet_connection.h: prev stylesheet destroyed @ recompile * src/main/: compile.tab.C, compile.y, pa_request.C: ^: no colon in $origin @exception[ * src/classes/: xdoc.C, xnode.C: xdoc::create[] now. and all dom tag names forced to XML lang * src/: classes/classes.dsp, classes/xdoc.C, types/types.dsp: fiew leechy-found bugs in code&doc fixed 2001-10-17 parser * src/: classes/classes.dsp, classes/string.C, main/pa_string.C, types/pa_vxnode.h, types/types.dsp: string::mid fixed, string.mid n functionality preserved * src/types/pa_vimage.h: removed unused vimage::save 2001-10-16 parser * src/: classes/string.C, main/pa_string.C: $string.mid(p[;n]) * src/classes/: xnode.C: removed few dom returns & changed op.txt * src/types/: pa_vhash.h, pa_vtable.h: hash can be used as boolean * src/classes/image.C: image.copy tolerance * src/classes/image.C: ::CopyResampled made gd2beta+my hands, very ineffective, but works for small paleted image * src/types/pa_vimage.C: comment * src/classes/image.C: gd size/resize bugfix * src/: classes/classes.dsp, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: ident >nul 2>&1 * src/main/pa_common.C: \r\n -> \n DOS \r -> \n Macintosh on all systems * src/: classes/image.C, types/pa_vimage.h: ^image.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h]]) 2001-10-15 parser * src/main/execute.C: z * src/classes/: xdoc.C: !::create{qualifiedName} * src/types/pa_vxnode.C: document_type_node. !readonly attribute DOMString name !notation_node. !readonly attribute DOMString publicId !readonly attribute DOMString systemId * src/types/: pa_vcode_frame.h, pa_wcontext.C: code_frame fixed - ::write badly passed string too transparently [failed to intercept it] * src/: classes/xdoc.C, classes/xnode.C, include/pa_config_fixed.h, include/pa_request.h, main/pa_sql_driver_manager.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: DOM1 major addtion, only few attributes/methods left 2001-10-13 parser * src/: main/pa_sql_driver_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: isapi&cgi couple non-pooled mallocs in main handler * src/targets/isapi/pool_storage.h: isapi pool storage reverse cleanups & frees order * src/types/pa_vcode_frame.h: couple comments * src/: main/execute.C, types/pa_vcode_frame.h: vcodeframe made transparent enough to handle hash if creation&passing * src/: include/pa_config_fixed.h, main/execute.C, main/pa_exception.C: noticed that vcodeframe not transparent enough, would change now 2001-10-12 parser * src/targets/isapi/parser3isapi.C: xalan&xerces multithread bug fixed. initialization&free on each thread! * src/classes/: double.C, int.C, string.C: sql{}[$.default[({})]] handling changed: now type of default param analized always, not only at problem time, thus helping early problem spotting * src/: classes/classes.dsp, classes/xdoc.C, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, types/types.dsp: xalan&xerces multithread bug fixed. initialization&free on each thread! 2001-10-11 parser * src/classes/xnode.C: xnode.selectSingle now * src/: classes/xdoc.C, classes/xnode.C, include/pa_exception.h, include/pa_pool.h, include/pa_stylesheet_connection.h, main/pa_exception.C, main/pa_pool.C: moved xslt exceptions convertors out of Pool into Exception * src/main/pa_string.C: const * src/: include/pa_string.h, main/pa_string.C: restructured string: linked pieces of same language together prior to String::replace * src/classes/hash.C: !^hash.add[addme] !^hash.sub[subme] !^a.union[b] = new !^a.intersection[b] = new !^a.intersects[b] = bool * src/classes/hash.C: !^hash::append[append_from] * src/: classes/hash.C, types/pa_vhash.h: !^hash::create[[copy_from]] * src/: classes/string.C, classes/table.C, include/pa_globals.h, include/pa_string.h, main/pa_globals.C, main/pa_string.C, main/untaint.C, types/pa_vvoid.h: untaint lang origins table fixed. got rid of empty_string, which caused errors - it hasnt exception but somebody[value.bark] tried to throw it on it's pool * src/include/pa_config_auto.h.in: makes 2001-10-10 parser * src/: classes/op.C, main/compile.tab.C: ^error[msg] * src/main/: compile.tab.C, compile.y: ^a[ @next_method << now unclosed ] would be reported here * src/main/: compile.tab.C, compile.y: ^a[^b] more informative compile error 2001-10-09 parser * src/: classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: makes * src/classes/Makefile.am: makes * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: xml transform win32 errors intercepted [xalan transformer patched and incorporated] * src/: classes/classes.dsp, classes/xdoc.C, include/pa_stylesheet_connection.h, main/main.dsp, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vxdoc.h, types/pa_vxnode.h, types/types.dsp: xalan patches starting * src/classes/: string.C, table.C: ^string.save[file] * src/classes/: date.C, table.C: calendar moved to date * src/classes/: op.C, table.C: table.hash[key field;value field(s) string/table] now * src/classes/: op.C, table.C: z * src/: classes/op.C, classes/table.C, types/pa_vfile.h, types/pa_vimage.h, types/pa_vjunction.h, types/pa_vxdoc.h, types/pa_vxnode.h: table:menu & op for delims made allowed not to be code [be string..] * src/classes/: double.C, file.C, image.C, int.C, op.C, string.C, table.C: lots of params->as_int/double/as_string/as_junction/as_no_junction messages added 2001-10-08 parser * src/: classes/date.C, classes/image.C, classes/string.C, classes/table.C, classes/void.C, include/pa_request.h: params->as_int/double message added * src/classes/image.C: image:circle [and round arc] uses Bresenham * src/: classes/image.C, types/pa_vcookie.C, types/pa_vimage.C: image:sector removed image:html internal "line-*" attribs * src/: classes/image.C, include/pa_common.h, main/pa_common.C, types/pa_vcookie.C: cookie urlencoded [netscape doc reread] * src/types/pa_vcookie.C: removing cookie made more netscape-like way * src/: classes/file.C, classes/form.C, main/pa_common.C, main/untaint.C: header untainting to UL_HTTP_HEADER, UL_MAIL_HEADER made nonforced [only tainted pieces] * src/: include/pa_common.h, main/pa_common.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: remove_crlf @ SAPI::log * src/main/untaint.C: \r to ' ' in origins mode * src/classes/xdoc.C: xdoc:load exceptions intercepted [like in set] * src/: classes/xdoc.C, include/pa_config_fixed.h, main/compile.tab.C, types/pa_vxdoc.h: parsedSource produced by nonstandard liaison freed up 2001-10-07 parser * src/: include/pa_config_fixed.h, main/compile.tab.C: restored project 2001-10-05 parser * src/: classes/xdoc.C, include/pa_pool.h, main/main.dsp, main/pa_pool.C: changed xdoc:set to prevent SAXParseException from outputing to cerr. lots of "todos" * src/main/untaint.C: http_header tainting more gentle with enquoting now * src/: classes/xdoc.C, include/pa_dictionary.h, main/main.dsp, main/pa_dictionary.C, main/pa_string.C, types/pa_vxdoc.h: started xml errorhandler. fixed string.replace a little, read @test * src/main/pa_string.C: found replace bug - first_that_starts(char *) does not have limit, and looks further eos, fixing.... * src/doc/: doxygen.cfg, html2chm.cmd, sources2html.cmd: paths * src/: classes/xdoc.C, main/compile.tab.C: xdoc.transform now * src/main/: pa_charset_connection.C: ctype another mem clear bugfix * src/main/: compile.tab.C, compile.y: disabled ^literals in names $result[^[$p^]z] now works fine * src/: include/pa_hash.h, main/pa_hash.C: Hash::size() calculated wrong. fixed it * src/main/pa_charset_connection.C: unicode zero pair at the beging of totable appered to be vital 2001-10-04 parser * src/classes/image.C: ^image.length[text] 2001-10-03 parser * src/main/pa_request.C: DEFAULT...charset was ignored when !XML * src/main/pa_request.C: restored pcre defaulting in request [mindlessly "optimized" yesterday] comment left 2001-10-02 parser * src/: main/pa_charset_manager.C, include/pa_stylesheet_connection.h: forgot non-xml pool.*charset needed * src/: include/pa_pool.h, main/pa_pool.C, types/pa_vresponse.h: forgot non-xml pool.*charset needed * src/classes/table.C: # config comments fixed * src/: classes/table.C, main/pa_charset_connection.C: table:load & charset_connection #comment now * src/: classes/classes.dsp, types/types.dsp: release projects options fixed to use release msvcrt lib * src/main/pa_charset_connection.C: pcre tables now const inside removed default - pcre handles that internally fixed bug on not-cleaning tables [previously was calloced, now member] * src/: include/pa_request.h, main/pa_charset_connection.C, main/pa_request.C, types/pa_vstring.h: pcre tables now const inside removed default - pcre handles that internally fixed bug on not-cleaning tables [previously was calloced, now member] * src/: include/pa_config_fixed.h, main/pa_charset_connection.C: tested charset reload on file change @ apache version = OK tested freeing up prev encoding on adding new = OK 2001-10-01 parser * src/main/pa_charset_connection.C: removed entitify external hack [internal installed] * src/main/Makefile.am: makes+removed dtd * src/: include/pa_charset_connection.h, include/pa_charset_manager.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_request.C: charset loading & caching mech 0 * src/: include/pa_stylesheet_connection.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_globals.C, main/pa_request.C: would make charset loading & caching mech now 2001-09-30 parser * src/main/pa_request.C: forgot to fill toTable * src/: include/pa_config_fixed.h, main/pa_request.C: started hack_s_maximumCharacterValues to XALAN_HACK_DIGITAL_ENTITIES but failed on win32 for now.. * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C: now charsets table configuration variable is: CHARSETS * src/: classes/xdoc.C, include/pa_request.h, main/pa_request.C: ctype with unicode 1. todo: no П entities on output somehow * src/: classes/file.C, classes/op.C, classes/string.C, include/pa_request.h, main/pa_request.C: started ctype with unicode values 2001-09-28 parser * src/: main/pa_request.C, classes/mail.C, classes/op.C, classes/xdoc.C, include/pa_stylesheet_connection.h: letter body string passed AS-IS now * src/classes/: xdoc.C, xnode.C: xdoc addencoding works! invented a way of user-configuring... todo: implement 2001-09-27 parser * src/classes/table.C: table.sort changed to sort table itself * src/: classes/xdoc.C, targets/isapi/parser3isapi.dsp: X^.getElementsByTagName[tagname] = array of xnode X^.getElementsByTagNameNS[namespaceURI;localName] = array of nodes removed - regretfully not supported @ xalan. maybe someday would reimplement, if needed. win32build system: solved long waiting anti-non-started-apache problem * src/: classes/classes.dsp, classes/xdoc.C, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: win32 ident make system so not to rebuild library [ident.C.new] 2001-09-26 parser * src/: classes/classes.dsp, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_config_fixed.h, main/main.dsp, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vxnode.C, types/types.dsp: z * src/classes/classes.C: forgot one non-xml check * src/: Makefile.am, classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: makes with clases.awk * src/targets/cgi/parser3.C: z * src/: include/pa_config_fixed.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: #ifdef SMTP * src/: classes/classes.dsp, classes/dnode.C, classes/dnode.h, classes/dom.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, main/compile.tab.C, types/pa_vdnode.C, types/pa_vdnode.h, types/pa_vdom.C, types/pa_vdom.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/types.dsp: xdoc&xnode now * src/: classes/classes.C, classes/classes.awk, classes/classes.dsp, classes/classes.h, classes/date.C, classes/dnode.C, classes/dnode.h, classes/dom.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, include/pa_array.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_xslt_stylesheet_manager.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/pa_xslt_stylesheet_manager.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdnode.C, types/pa_vdnode.h, types/pa_vdom.C, types/pa_vdom.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.dsp: added ident.awk and main.dsp splitted to main+classes+types along to .am * src/classes/Makefile.am: removed useless var * src/: classes/classes.cmd, main/main.dsp, targets/cgi/parser3.dsp: moved classes.inc generation on win32 to main.dsp 2001-09-25 parser * src/include/pa_config_auto.h.in: xml on linux[elik] works! no 1251 though, todo ICU * src/: Makefile.am, classes/Makefile.am, classes/dom.C, include/pa_stylesheet_connection.h, main/Makefile.am, main/pa_pool.C, targets/cgi/Makefile.am, types/Makefile.am, types/pa_vdom.h: xml configure makes 2001-09-24 parser * src/: classes/Makefile.am, include/pa_config_auto.h.in, types/Makefile.am: makes * src/targets/cgi/Makefile.am: makefiles * src/: Makefile.am, targets/Makefile.am, targets/cgi/pa_pool.C: started unix makes update * src/: Makefile.am, main/Makefile.am, targets/cgi/Makefile.am: started unix makes update * src/types/: pa_vdnode.C, pa_vvoid.h, pa_vtable.C: z * src/types/pa_value.h: z * src/types/: pa_vhash.h, pa_vtable.h, pa_vclass.h: fixed small bugs with usinge hash/table in expressions * src/types/: pa_vfile.h, pa_vimage.h, pa_vstring.h: fiew wrong resolved conflicts fixed [const] * src/: classes/classes.cmd, classes/image.C, classes/op.C, classes/table.C, include/pa_request.h, include/pa_sapi.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/main.dsp, main/pa_common.C, main/pa_sql_driver_manager.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vbool.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vform.C, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h: merged3 with before_xml [merge2 actually didn't happen - i've created tags on wrong branch. so this merge is in fact re-merge] 2001-09-21 parser * src/: main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp: updated project files [/ sadly produced "" in make file and sadly wrong interpreted on load] * src/: classes/classes.h, classes/hash.C, classes/op.C, classes/table.C, doc/doxygen.cfg, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_sapi.h, include/pa_sql_driver_manager.h, include/pa_string.h, main/compile.tab.C, main/main.dsp, main/pa_common.C, main/pa_exec.C, main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp: merged with before_xml * src/: classes/classes.C, classes/date.C, classes/dnode.C, classes/dom.C, classes/file.C, classes/form.C, classes/int.C, classes/mail.C, doc/doxygen.cfg, include/pa_config_fixed.h, include/pa_pool.h, main/main.dsp, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_xslt_stylesheet_manager.C, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.dsp, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.dsp, types/pa_valiased.C, types/pa_vcookie.C, types/pa_vdnode.C, types/pa_vdom.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vimage.C, types/pa_vrequest.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstring.C, types/pa_vtable.C, types/pa_wcontext.C: zillions of #ifdef XML created new projects for sql drivers [planning to remove sql drivers from main cvs project] first, will join latest changes * src/classes/: dom.C: defaulted dom writing methods encoding to pool.get_charset * src/classes/dom.C: defaulted dom writing methods encoding to pool.get_charset * src/include/pa_pool.h: defaulted dom writing methods encoding to pool.get_charset * src/: classes/dom.C, include/pa_pool.h, main/pa_pool.C, types/pa_vdnode.C, types/pa_vresponse.h: defaulted dom writing methods encoding to pool.get_charset * src/: include/pa_pool.h, main/pa_pool.C: checked whether transcoder were created right "unsupported encoding" message. not @ set time, but @ use time, so until xml output functions .string, .file, .save used - no encoding name check occur reduced transcode buffer size to 60 fixed pool cleanup - no registration needed, pools are officially destructured 2001-09-20 parser * src/classes/image.C: 20K preload on jpg measure [image::measure] * src/main/: pa_pool.C, pa_request.C: Pool::transcode defaults from $MAIN:DEFAULTS.content-type[$.charset[here]] * src/: classes/dnode.C, classes/dom.C, include/pa_config_includes.h, include/pa_globals.h, include/pa_pool.h, main/main.dsp, main/pa_globals.C, main/pa_pool.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, types/pa_vdnode.C, types/pa_vdnode.h, types/pa_vresponse.h: Pool::transcode 0 * src/classes/dom.C: dom. string save file moved output xml options to last param and made it optional * src/types/pa_vdnode.C: !$elementnode.attributes = hash of dnodes !$attributenode.specified = boolean true if the attribute received its value explicitly in the XML document, or if a value was assigned programatically with the setValue function. false if the attribute value came from the default value declared in the document's DTD. !$pinode.target = target of this processing instruction XML defines this as being the first token following the markup that begins the processing instruction. XPath: !^node.select[xpath/query/expression] = hash of 0->node0 1->node1 !^node.select-single[xpath/query/expression] = first node if any * src/types/: pa_value.h, pa_vbool.h, pa_vdate.h, pa_vdouble.h, pa_vhash.h, pa_vint.h, pa_vstring.h, pa_vtable.h, pa_vvoid.h: some 'const's added * src/types/: pa_vhash.h, pa_vtable.h: table/hash can be used in expression context now, there value = size and boolean value size!=0 * src/types/: pa_vhash.h, pa_vstring.h, pa_vtable.h: table/hash can be used in expression context now, there value = size and boolean value size!=0 * src/: classes/dnode.C, classes/dom.C, targets/cgi/parser3.dsp, types/pa_vstring.h: dnode .file .string .save moved back to dom due to strange xalan bug 2001-09-18 parser * src/: classes/dnode.C, classes/dom.C, classes/hash.C, classes/image.C, classes/op.C, classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_sql_driver_manager.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_common.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vtable.h: merged latest bugfixes from before_xml branch ^if(def $hash) now true only when ^hash:_count[]!=0 moved .string .save .file from dom to dnode * src/: classes/op.C, main/execute.C: operators self changed to root ^for variable context changed to self * src/types/: pa_vdnode.C, pa_vdom.h, pa_vhash.h, pa_vtable.h: dom, dnode 1 * src/: classes/dnode.C, classes/dnode.h, main/main.dsp, types/pa_vdnode.C, types/pa_vdnode.h: dom, dnode 0 * src/: classes/image.C, main/pa_string.C, main/pa_table.C: image: poly* fixed 2001-09-17 parser * src/: classes/dom.C, main/main.dsp, main/pa_globals.C, types/pa_vdom.h: started dnode+dom dnode DOM methods: $node.name $node.value ...others... ^node.xpath[/rates/USD] = hash $hash[ $.0[node0] $.1[node1] ] * src/: classes/image.C, types/pa_vimage.C: $image.line-style now applies to all linear primitives * src/: classes/classes.h, classes/dom.C, classes/hash.C, include/pa_stylesheet_connection.h, main/main.dsp, targets/cgi/pa_pool.C, types/pa_vdom.h, types/pa_vfile.h, types/pa_vimage.h: started dnode DOM: $node.name $node.value ...others... ^node.xpath[/rates/USD] = hash dom(dnode) * src/: classes/hash.C, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/execute.C, targets/cgi/parser3.C: expressions unary+ ^hash.count[] bugfix: in expression compound($aa.zz.xx) names now can have minus '-' in name after '.' 2001-09-15 parser * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: image: $line-width ^line(...)[**** style] * src/: classes/dom.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_vdom.h: fixed bug in isapi pool_storage - cleanups first, allocations second. apache wisely does just like that * src/targets/isapi/: parser3isapi.C, pool_storage.h: pool_storage rewritten using template, no bugs now * src/: include/pa_pool.h, main/pa_pool.C, targets/cgi/pa_pool.C, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h: poorly started isapi pool_storage, would rewrite using template now * src/: classes/dom.C, classes/image.C, include/pa_pool.h, include/pa_stylesheet_connection.h, main/main.dsp, targets/cgi/pa_pool.C, targets/isapi/pa_pool.C, targets/isapi/pool_storage.h, types/pa_vdom.C, types/pa_vdom.h: xalan objects freed up [introducing Pool::register_cleanup] * src/: doc/doxygen.cfg, include/pa_sapi.h, types/pa_vdom.h: comments 2001-09-14 parser * src/main/: pa_sql_driver_manager.C, pa_xslt_stylesheet_manager.C: z * src/: classes/dom.C, classes/file.C, classes/image.C, classes/mail.C, include/pa_common.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_common.C, main/pa_exec.C, main/pa_globals.C, main/pa_sql_driver_manager.C, main/pa_xslt_stylesheet_manager.C, main/untaint.C, types/pa_vfile.C: dom.xslt stylesheet compiled&cached 2001-09-13 parser * src/: classes/dom.C, classes/file.C, classes/image.C, types/pa_vfile.C, types/pa_vfile.h: ^dom.file[] charset * src/classes/dom.C: dom:file content-type(.method) * src/: include/pa_common.h, include/pa_globals.h, main/pa_common.C, main/pa_request.C: $MAIN:CLASS_PATH now can be string now more informative error messages * src/: include/pa_globals.h, include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: ParserRootConfig .../parser3.conf ParserSiteConfig .../parser3.conf cgi&isapi looks for {configure|c:\windows}/parser3.conf 2001-09-12 parser * src/: classes/op.C, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: ^connect[] ^connect[aaa] more precise error reporting: "connection string must start with protocol://" now * src/main/compile.tab.C: fixed - subname code parts actually [] braced * src/main/: compile.y, compile_tools.h: name.[part].xxx syntax lexer on LS_USER level did [] matching without setting nestage, introduced special LS_NAME_SQUARE_PART state 2001-09-11 parser * src/: classes/dom.C, include/pa_string.h, main/pa_globals.C, main/untaint.C: ^dom:set{xml} default language XML languages+=xml * src/: classes/dom.C, types/pa_vdom.h: ^dom:set[xml] * src/classes/dom.C: ^dom:save/string/file[output options] output options: $.method[xml|html|text] detection fixed * src/types/pa_vdom.h: messages * src/classes/dom.C: ^dom:save/string/file[output options] output options: $.method[xml|html|text] detection fixed 2001-09-10 parser * src/classes/dom.C: ^dom:save/string/file[output options] output options: $.method[xml|html|text] $.encoding[windows-1251|...] * src/classes/dom.C: ^dom.xslt[stylesheet filename][params hash added] * src/: classes/dom.C, main/main.dsp, types/pa_vdom.h: ^dom.xslt[stylesheet filename] 0 * src/: classes/dom.C, main/main.dsp, types/pa_vdom.h: ^dom.xslt[stylesheet filename] -1 doc is lying * src/classes/dom.C: ^dom.file[encoding] = file * src/classes/: dom.C: ^dom.string[encoding] 1 ^dom.save[encoding;filename] * src/classes/dom.C: ^dom.string[] 0 * src/classes/dom.C: ^dom.save[b.xml] 1:error handling * src/: classes/dom.C, main/main.dsp, types/pa_vform.C, types/pa_vform.h: ^dom.save[b.xml] 0 2001-09-08 parser * src/types/pa_vform.C: $form:tables.name.field 2001-09-07 parser * src/classes/table.C: table:empty removed, superceded by ^if(def $table)... * src/targets/cgi/parser3.C: z * src/main/pa_string.C: $a[] ^if($a){y;n} is 'n' now [conversion from '' to int/double is 0] * src/: classes/dom.C, types/pa_value.h, types/pa_vtable.h: (def $table) is false when table is empty * src/: main/pa_request.C, types/pa_vform.C, types/pa_vform.h: !$form:tables $atable[$form:tables.a] ^atable.menu{a=$atable.element}[,] * src/: targets/cgi/parser3.dsp, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h: !$form:fields * src/: classes/dom.C, classes/table.C, main/main.dsp, types/pa_vdom.h, types/pa_vform.C: merged with successful start of dom * src/: include/pa_hash.h, main/pa_hash.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h: z * src/: main/pa_exception.C, types/pa_vform.C: getting FIRST form element [not last] * src/: classes/dom.C, classes/table.C, main/main.dsp, types/pa_vdom.h: introducing dom. dom:load[a.xml] 2001-09-06 parser * src/types/pa_vform.C: ?a=1&a=2 would result in $form:a being a table with one column 'element' and two rows: 1 and 2 * src/types/pa_vform.C: ?a=1&a=2 would result in $form:a being a table with one column 'element' and two rows: 1 and 2 * src/: classes/void.C, main/pa_string.C, main/pa_table.C: fixed up bad int/double conversions, and now $form:nonexistent.int(88) would return 88 * src/: classes/hash.C, include/pa_globals.h, main/pa_globals.C, types/pa_vhash.h: now there's special hash key '_default' [instead of ^_default method] $hash[ $.a[1] $.b[2] $._default[xx] ] $hash.c * src/main/: compile.tab.C, compile.y: ^if(0){}{ ^if(1){}^; } bug fixed [thanks, fif], ^; were treated there non-literally * src/doc/doxygen.cfg: merged new default options from 1.2.10 doxygen * src/: classes/image.C, classes/op.C, classes/string.C, classes/table.C, doc/doxygen.cfg, targets/isapi/parser3isapi.C, types/pa_vtable.C: few #ifndef DOXYGEN 2001-09-05 parser * src/classes/: string.C, table.C: sql options can be void [same as image:html the other day] * src/targets/cgi/Makefile.am: .am undo * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, targets/cgi/parser3.C: #define STRINGIZE(name) #name does not macro expantion on param, simply qoutes whatever passed, undone * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, targets/cgi/Makefile.am, targets/cgi/parser3.C: #define STRINGIZE(name) #name invented * src/: classes/op.C, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: #define MAIN_SQL_NAME "SQL" #define MAIN_SQL_DRIVERS_NAME "drivers" moved to be availible to all users * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: SQL_DRIVER_CREATE_FUNC_NAME * src/classes/mail.C: MAIN:MAIL check fixed 2001-09-04 parser * src/classes/image.C: image.html now can accept void params * src/targets/isapi/parser3isapi.C: z * src/targets/cgi/parser3.C: full_file_spec bug * src/targets/cgi/parser3.C: getenvcheck * src/targets/cgi/parser3.C: zz * src/targets/cgi/parser3.C: zzz * src/classes/date.C: date * src/classes/date.C: date:sql-string is now without '' * src/: include/pa_config_auto.h.in, targets/cgi/Makefile.am, targets/cgi/parser3.C: configure --sysconfdir=sysadmin-controlled auto.p location for targets/cgi/parser3, default[/usr/local/etc] * src/include/pa_config_auto.h.in: makes 2001-09-03 parser * src/targets/cgi/parser3.C: /configure cgi SYSCONFDIR 2001-09-01 parser * src/classes/image.C: letter_spacing * src/classes/image.C: image: font params changed * src/classes/image.C: image: as_int as_string used * src/types/pa_vmethod_frame.h: $result[] now gets properly analized 2001-08-31 parser * src/targets/cgi/parser3.C: z * src/: include/pa_dir.h, targets/cgi/parser3.C: compiled under cygwin * src/classes/void.C: void:int/double += (default) * src/classes/image.C: image:font added space param image:font changed charwidth alg, added kerning const[for now] * src/classes/: string.C, table.C: string:int/double (defaults) 2001-08-29 parser * src/main/pa_exception.C: exception redundant debug info 2001-08-28 parser * src/classes/image.C: image error msgs * src/classes/image.C: image: gifsize little endian * src/doc/doxygen.cfg: doxygen conf removed some garbage from under doxygeneration * src/: classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: .am-s * src/: include/pa_dictionary.h, main/pa_dictionary.C, main/pa_sql_driver_manager.C: NO_STRING_ORIGIN check3 * src/main/compile.C: NO_STRING_ORIGIN check2 * src/classes/table.C: NO_STRING_ORIGIN check * src/include/pa_dictionary.h: gcc: ../include/pa_dictionary.h:19: storage class specifiers invalid in friend function declarations * src/: classes/op.C, main/compile.tab.C, main/pa_dir.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: strncpy forced with zero ending in case of limit * src/: classes/file.C, main/pa_common.C: file:move autocreate/remove dest/src dir * src/: classes/string.C, include/pa_dictionary.h, include/pa_string.h, main/pa_dictionary.C, main/pa_string.C, main/untaint.C: pa_directory speeded up. moved zero 'from' check to directory constructor. string:replace 2001-08-27 parser * src/classes/image.C: fixed jpgsize alg * src/classes/image.C: fixed jpgsize alg * src/main/pa_exception.C: z * src/main/pa_common.C: removed debug info from pa_common * src/: main/pa_request.C, targets/cgi/parser3.C: parser3 test.html [auto.p from current dir loading] * src/: main/pa_common.C, main/pa_exception.C, main/pa_sql_driver_manager.C, targets/cgi/Makefile.am: configure for solaris -lsocket 2001-08-24 parser * src/targets/cgi/parser3.C: not cgi extra \n 3 * src/targets/cgi/parser3.C: not cgi extra \n 2 * src/targets/cgi/parser3.C: not cgi extra \n * src/main/pa_sql_driver_manager.C: z * src/: include/pa_sql_connection.h, main/pa_sql_driver_manager.C: sql* removed services from disconnect - cross-request ideological probs. * src/sql/pa_sql_driver.h: sql* removed services from disconnect - cross-request ideological probs. oracle - fixed bug: cs allocated on request.pool and got freed before disconnect * src/classes/: file.C, form.C, mail.C, table.C: fiew non-pool mallocs fixed 2001-08-23 parser * src/classes/file.C: minor bug in file:save fixed * src/main/pa_sql_driver_manager.C: oracle: dlink 2001-08-22 parser * src/: classes/file.C, main/compile.tab.C, types/pa_vfile.C, types/pa_vfile.h: file:load|save[text|binary; * src/main/: compile.tab.C, compile.y: ^method[]^[^] literals [] 2001-08-21 parser * src/classes/: file.C, table.C: ^file:list 2001-08-20 parser * src/: main/compile.tab.C, main/compile.y, main/pa_sql_driver_manager.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h: $var(123) ^var.inc[] recousively caused problems: inc incremeted 123 literal!! fixed 2001-08-10 parser * src/main/: compile.tab.C, compile.y: [codes] name part syntax now * src/main/: compile.tab.C, compile.y: (codes) name part syntax added * src/main/: compile.tab.C, compile.y: (codes) name part syntax added * src/classes/table.C: table:sort restored [it was bad test :(] * src/types/: pa_value.h, pa_vstring.h: string now def only when ne '' * src/main/: pa_request.C: wanted to make const int MAX_EXECUTE_SECONDS=1; but couldnt, set_callback_and_alarm appeared to be not exported :( * src/main/pa_string.C: string.match hanged on. there were a hang check but it weren't wise enough @parse[dateString][tmp] $tmp[^dateString.match[(\d\d\d\d-)?(\d\d-)?][g]] $tmp.1 $tmp.2 #end @main[] ^parse[2001-02-03] * src/classes/: table.C: table:sort now default desc * src/: classes/table.C, include/pa_table.h, main/pa_table.C: table.sort now creates new sorted table 2001-08-09 parser * src/main/pa_string.C: $a[010] now ^if($a==10){true} were octal * src/classes/hash.C: hash:_default now [was hash:default] * src/classes/op.C: case without switch check added * src/types/pa_vcookie.C: cookie name&value origins added, more precise $ORIGINS(1) * src/main/Makefile.am: .am * src/classes/void.C: void: int double copy/paste from int: bug fixed * src/classes/void.C: void: int double copy/paste from int: bug fixed 2001-08-07 parser * src/: classes/double.C, classes/int.C, classes/string.C, classes/table.C, include/pa_globals.h, main/pa_globals.C: !^int/double:sql{query}[[$.limit(2) $.offset(4) $.default(0)]] string, table * src/: classes/math.C, main/pa_request.C: math:random fixed. win32 srand made working 2001-08-06 parser * src/: classes/mail.C, classes/op.C, include/pa_array.h, include/pa_globals.h, include/pa_hash.h, include/pa_request.h, main/compile.tab.C, main/compile.y, main/pa_array.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C: class_path * src/main/pa_exec.C: exec win32 real filename * src/classes/file.C: exec stderr out * src/classes/hash.C: hash:keys renamed to hash:_keys :( 2001-08-03 parser * src/: classes/table.C, types/pa_vtable.h: vtable.locks killed 2001-08-02 parser * src/: classes/string.C, classes/table.C, include/pa_array.h, main/execute.C, main/pa_exec.C: introducing Array_iter * src/main/execute.C: detected quick_get recursion bug. changed to get@execute, but needs array iterator, separate from array to avoid it & use caching * src/main/: pa_dictionary.C, pa_globals.C: memset dictionary minor bug fixed * src/: classes/classes.h, classes/op.C, include/pa_globals.h, main/execute.C, main/pa_globals.C: found another multithread bug in op.C (last, last global var killed) :) 2001-08-01 parser * src/: include/pa_dictionary.h, include/pa_globals.h, include/pa_string.h, main/main.dsp, main/pa_dictionary.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C: speeded up typo-html replacements. introducing Dictionary with first-char caching 2001-07-31 parser * src/types/Makefile.am: pa_vtable.C added to .am * src/main/compile.tab.C: added, so that could be compiled even on non-bison-enabled platforms 2001-07-28 parser * src/classes/table.C: table:hash always produces hash, when can't - empty * src/main/: compile.y, untaint.C: bug fix @ untaint when \r skipped \n 2001-07-27 parser * src/classes/: double.C, int.C, string.C: provided meaningful msg on int/double/string :sql without result and default 2001-07-26 parser * src/classes/op.C: fixed bad multithread bug with strangly global OP * src/main/compile.y: $man[$.age[zzz]] 0 * src/: include/pa_opcode.h, main/compile.y, main/execute.C: hash creation syntax problem persists. restored $: for a while. thinking of $man[$.age[zzz]] syntax now * src/: classes/double.C, classes/int.C, classes/string.C, include/pa_opcode.h, main/compile.C, main/compile.y, main/compile_tools.h, main/execute.C, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_wcontext.h, types/pa_wwrapper.h: fixing :: realization #1 * src/: include/pa_opcode.h, main/compile.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.h: introducing :: this is constructor call prefix. ordinary : remains for static accesses 2001-07-25 parser * src/types/pa_vtable.C: table: get_element order changeed. now: 1. fields 2. methods 3. columns * src/types/: pa_vdouble.h, pa_vint.h: odbc: no result queries; quote. optimized double&int tostring-s * src/main/: compile.C, compile.y, compile_tools.h: allowed whitespace before first method decl * src/classes/table.C: allowed nontable result in table:sql, results in empty table * src/main/: compile.C, compile.y, compile_tools.h: allowed empty lines before first method decl * src/: classes/table.C, main/main.dsp, types/pa_vtable.C, types/pa_vtable.h: ^table.record[] now $table.fields * src/main/compile.y: $var[] is now empty string, not void * src/main/: compile.y, execute.C: $var[] is now empty string, not void * src/: classes/string.C, include/pa_globals.h, main/execute.C, main/pa_globals.C: match replace code context moved to implicit $match context * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: with killed, code storage introduced with former 'with' syntax 2001-07-24 parser * src/: main/compile.C, main/execute.C, main/pa_string.C, types/pa_value.h: first get_element, next get operator * src/main/compile.y: removed @end handling * src/main/: compile.C, compile.y: @end handling method2 * src/: classes/file.C, include/pa_common.h, main/pa_common.C: file:move * src/main/pa_common.C: file_read close @ eof when imgsize bug fixed 2001-07-23 parser * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql odbc driver * src/classes/hash.C: changed sql driver query interface * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_sql_connection.h, sql/pa_sql_driver.h: changed sql driver query interface 2001-07-20 parser * src/types/pa_vrequest.C: X!$browser:type * src/: classes/file.C, classes/string.C, include/pa_string.h, main/execute.C, main/pa_string.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vclass.h, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vhash.h, types/pa_vmath.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h: only ^class:method dynamic calls allowed. ^BASE.method call disabled. BASE element globally removed 2001-07-18 parser * src/classes/file.C: file:exec/cgi msg * src/classes/file.C: $file:exit-code renamed to 'status' * src/: classes/file.C, main/pa_exec.C: file:exec * src/: Makefile.am, classes/Makefile.am, main/Makefile.am, targets/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: removed $id from *.in *.am * src/main/: pa_request.C, untaint.C: ORIGINS langs name abbrevations * src/: classes/date.C, classes/mail.C, classes/math.C, classes/string.C, classes/table.C, include/pa_globals.h, include/pa_string.h, main/execute.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vstring.C, types/pa_vstring.h: $ORIGINS(1) output tracing mode 2001-07-13 parser * src/: classes/double.C, classes/int.C, classes/string.C, include/pa_request.h, main/execute.C, main/pa_request.C: auto.p[@auto], /news/auto.p[no @auto], so that initializing second would not call first @auto * src/main/: execute.C, pa_request.C: order of MAIN parents was wrong, fixed 2001-07-12 parser * src/types/pa_value.h: pa_value.putelement modification of system classes prevented 2001-07-11 parser * src/: classes/string.C, doc/sources2html.cmd: lr split now yelds table $piece * src/: classes/file.C, include/pa_common.h, main/pa_common.C, types/pa_vstateless_class.h: $file created by file:state += .atime .mtime .ctime +found&fixed bug with exceptions on get_junction-created objects [they were on wrong pool] 2001-07-09 parser * src/main/untaint.C: qp wrong name * src/: classes/date.C, classes/string.C, classes/table.C, main/compile.y: date format 0 2001-07-07 parser * src/: classes/date.C, classes/table.C, include/pa_common.h, include/pa_string.h, main/pa_common.C, types/pa_vdate.h: date roll table calendar * src/: classes/Makefile.am, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, include/pa_request.h, main/main.dsp, types/pa_value.h, types/pa_vdate.h, types/pa_wcontext.C: date now set $fields roll string. todo: sql, calendar 2001-07-06 parser * src/: classes/math.C, include/pa_request.h, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_vmath.h: math 0 2001-07-03 parser * src/: classes/Makefile.am, classes/math.C, classes/op.C, classes/random.C, main/main.dsp: class random renamed to math, operators became methods * src/classes/op.C: pow sqrt * src/: classes/op.C, main/execute.C: sin asin cos acos tan atan 2001-07-02 parser * src/classes/table.C: ^table.columns column renamed from 'name' to 'column' * src/classes/hash.C: ^hash.keys[] * src/: classes/table.C, main/pa_table.C: ^table:columns[] * src/main/: compile.y, compile_tools.h: in expressions now allowed 'strings' 2001-06-29 parser * src/main/: execute.C: /0 %0 checkes ver 2 * src/main/execute.C: /0 %0 checke * src/classes/Makefile.am: nothing - void * src/classes/table.C: empty strings @ sql 2001-06-28 parser * src/: classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, main/compile.C, main/compile_tools.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, main/compile.y: */ static const char *RCSId="$Id: double.C,v 1.31 2001/06/28 07:41:59 parser Exp $"; * src/: classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, main/compile.C, main/compile.y, main/compile_tools.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: static char *RCSId="$Id: ChangeLog,v 1.92 2013/10/29 16:21:27 moko Exp $"; * src/main/: compile.y, compile_tools.h: $:name: == ${name}: $class:name: == ${class:name}: * src/classes/string.C: exactly one 2001-06-27 parser * src/: classes/nothing.C, classes/void.C, types/pa_vnothing.h, types/pa_vvoid.h: nothing renamed to void * src/classes/op.C: ^switch ^case * src/main/compile.y: nothing renamed to void * src/: classes/hash.C, classes/table.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_request.C, targets/cgi/pa_pool.C, types/pa_value.h, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_vtable.h: nothing renamed to void * src/main/compile.y: lexer: $zzzz^zzzz were name part 2001-05-28 parser * src/doc/html2chm.cmd: removed >a * src/: main/main.dsp, targets/isapi/parser3isapi.dsp: release project options [some bugs] * src/doc/sources2html.cmd: z * src/: classes/classes.C, main/compile.C, main/compile.y, main/execute.C: operators are not in root class again 2001-05-24 parser * src/targets/cgi/parser3.dsp: project file * src/: classes/op.C, main/pa_request.C, targets/cgi/parser3.C: ^log ^exp * src/: main/pa_request.C, targets/cgi/parser3.C: // no _ conversions in @exception[params] * src/main/pa_request.C: // no _ conversions in @exception[params] 2001-05-23 parser * src/main/pa_string.C: string cmp bug * src/classes/: mail.C, op.C: rem max 1000 * src/: classes/op.C, main/compile.y: allow one empty line before LS_DEF_NAME 2001-05-22 parser * src/classes/op.C: if params code-required 2001-05-21 parser * src/types/pa_vstring.C: eoleof * src/classes/Makefile.am: .AM * src/classes/nothing.C: resultless ^sql moved to nothing: * src/classes/: nothing.C, op.C: 'unknown' renamed to 'nothing' * src/: classes/double.C, classes/nothing.C, classes/string.C, classes/unknown.C, main/main.dsp, types/pa_vnothing.h, types/pa_vunknown.h, classes/hash.C, main/compile.y, main/execute.C, targets/cgi/pa_pool.C, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_vtable.h, classes/table.C, main/pa_request.C, types/pa_value.h: 'unknown' renamed to 'nothing' * src/types/: pa_vstring.C, pa_vstring.h: removed unnecessary vstring::set_string * src/classes/: double.C, int.C, string.C: int,double;sql * src/: classes/hash.C, classes/int.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_string.C, types/pa_vstring.C, types/pa_vstring.h: started int:sql * src/: classes/classes.C, classes/hash.C, classes/op.C, classes/table.C, main/compile.C, main/compile.y, main/execute.C: hash:sql moved to main trunc. operators.txt updated * src/classes/: hash.C, op.C, table.C: hash:sql * src/classes/op.C: z * src/: main/compile.C, classes/classes.C: 1 * src/: classes/classes.C, main/compile.C, main/compile.y, main/execute.C: 0 * src/main/execute.C: z * src/targets/cgi/parser3.C: z * src/targets/cgi/parser3.C: argv can be just "parser3". made site_auto_path "." in that case * src/targets/cgi/: parser3.C: z * src/main/pa_request.C: .am * src/: main/pa_request.C, targets/cgi/parser3.C: pcre_tables=pcre_default_tables; 2001-05-19 parser * src/main/pa_string.C: z * src/: include/pa_string.h, main/untaint.C, targets/cgi/pa_pool.C: introducing String::cstr_bufsize, returns just size+1 for as_is target. * src/: main/untaint.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: fixed bug in pre html untaint, wrong size used, 4* mem wasted * src/classes/string.C: root context in match replace body now unchanged * src/types/pa_value.h: parameter # 1 based * src/main/pa_common.C: common: actual filename '%s' * src/classes/string.C: z * src/classes/Makefile.am: classes/.am * src/classes/: Makefile.am: classes/.am * src/: classes/Makefile.am, main/pa_sql_driver_manager.C, targets/cgi/pa_pool.C: classes/.am 2001-05-18 parser * src/: include/pa_config_auto.h.in, targets/cgi/pa_pool.C: .am pa_threads.C ins * src/targets/cgi/Makefile.am: .am pa_threads.C added 2001-05-17 parser * src/: classes/string.C, include/pa_config_fixed.h, include/pa_config_includes.h, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dir.C, main/pa_hash.C, main/pa_pool.C, main/untaint.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vform.C: #include "pa_config_includes.h" removed from most .C * src/doc/html2chm.cmd: z * src/doc/: chm.cmd, doxygen.cmd, html2chm.cmd, sources2html.cmd, view.cmd, view_chm.cmd, view_html.cmd: doc cmds * src/main/pa_sql_driver_manager.C: moved expiration to get_connection_from_cache * src/main/pa_sql_driver_manager.C: cache expiration bf * src/: classes/classes.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: cache expiration[use SQL_Driver::disconnect] * src/main/pa_table.C: table.locate current restored on "not found" * src/: main/execute.C, types/pa_vmethod_frame.h: endless recursion line no * src/: include/pa_request.h, main/execute.C, main/pa_request.C: ANTI_ENDLESS_EXECUTE_RECOURSION * src/: classes/op.C, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: fixed problem at last: 2connections own 1driver and set_services fight for driver::fservices. before fix * src/: classes/op.C, include/pa_config_fixed.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: found problem at last: 2connections own 1driver and set_services fight for driver::fservices. before fix * src/: include/pa_config_fixed.h, include/pa_threads.h, targets/cgi/pa_threads.C, targets/cgi/parser3.dsp, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.dsp: added pa_threads.C * src/include/pa_threads.h: removed targets/parser * src/include/: pa_array.h, pa_common.h, pa_config_fixed.h, pa_config_includes.h, pa_exception.h, pa_exec.h, pa_globals.h, pa_hash.h, pa_opcode.h, pa_pool.h, pa_request.h, pa_sapi.h, pa_socks.h, pa_sql_connection.h, pa_stack.h, pa_string.h, pa_table.h, pa_threads.h: #include "pa_config_includes.h" in all headers * src/: classes/image.C, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, main/pa_string.C: wrong includes order prevented sqlmanager to see MULTYTHREAD define * src/: include/pa_config_fixed.h, include/pa_threads.h, main/pa_sql_driver_manager.C: SYNCHRONIZED moved closer to caches put/gets * src/: include/pa_hash.h, main/execute.C: removed /*SYNCHRONIZED*/ from hash.h * src/: classes/op.C, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: connection from cache ->set_services(&services); 2001-05-16 parser * src/targets/cgi/parser3.C: z * src/: include/pa_pool.h, targets/cgi/pa_pool.C: removed pool debug, #ifdefed some. would debug later, on more precise sample than stupid: @main[] $name[$z[]] ^for[i](0;10000-2){ $tail[9994] $name.$tail[$tail!] $name.$tail } ok3 * src/: include/pa_array.h, main/pa_array.C, targets/cgi/parser3.C: removed array debug. before vstring rebasing * src/: include/pa_array.h, include/pa_string.h, main/execute.C, main/pa_array.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: array debugged; adjusted * src/main/: pa_sql_driver_manager.C, pa_string.C: SQL_Driver_manager line no for connect/charset errors 2001-05-15 parser * src/: include/pa_array.h, include/pa_string.h, main/pa_array.C, main/pa_string.C: string+array made linear grows * src/: include/pa_string.h, main/pa_string.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: think that all must grow lineary, not exponentialy * src/: include/pa_pool.h, include/pa_string.h, main/pa_string.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: string fixed bug with fullchunk cmps * src/targets/cgi/: pa_pool.C, parser3.C: main loss here: 5673321/ 70041= 81 * src/: include/pa_string.h, targets/cgi/pa_pool.C, targets/cgi/parser3.C: detected huge mem allocation: size/times malloc 27809390/368771, calloc 3232/83. would test now * src/: classes/random.C, main/compile.y, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.h: numbered params had wrong name - for instance: bad error message in ^for[] bad body type. fixed 2001-05-14 parser * src/: classes/string.C, include/pa_string.h, main/pa_string.C, main/untaint.C: ^string.upper|lower[] 2001-05-11 parser * src/: classes/double.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/unknown.C, main/execute.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vunknown.h: op: MAX_LOOPS as_int * src/: main/main.dsp, targets/isapi/parser3isapi.dsp: fixed some .dsp for win32tools 2001-05-11 paf * src/: classes/classes.cmd, classes/gawk.exe, classes/ls.exe, main/bison.exe, targets/isapi/KILL.EXE, targets/isapi/PSTAT.EXE, targets/isapi/istart.cmd, targets/isapi/istop.cmd, targets/isapi/kill.pl: moved win32 helpers to /win32tools 2001-05-10 paf * src/include/: pa_common.h, pa_config_includes.h: inline undefed for C++, that's all * src/include/: pa_config_auto.h.in, pa_config_fixed.h, pa_config_includes.h: inline wonders * src/: classes/Makefile.am, classes/hash.C, doc/doxygen.cfg, doc/doxygen.cmd: hash.C added * src/: main/pa_request.C, types/pa_vrequest.C: op configured * src/main/compile.y: @end grammar: allowed zero strings in control menthod * src/types/: pa_value.h, pa_vclass.h, pa_vstateless_class.h, pa_vstateless_object.h: changed priority: field before method lookup in vclass & vobject * src/: doc/doxygen.cmd, main/compile.y, types/pa_vobject.h: grammar: priorities changes [lowerd && prior] vobject: now first fields, next methods 2001-05-08 paf * src/main/pa_table.C: table columnname2item on nameless ignored bark=false. fixed * src/: classes/table.C, types/pa_value.h, types/pa_vhash.h, types/pa_vmethod_frame.h: hash:default works at last! * src/: classes/mail.C, classes/table.C, doc/doxygen.cmd, main/main.dsp, types/pa_vhash.h, types/pa_vstateless_class.h: hash:default * src/classes/table.C: z * src/classes/table.C: table:hash always hash of hash now * src/classes/table.C: table:empty return bool now * src/: classes/table.C, doc/chm.cmd, include/pa_array.h, include/pa_table.h, main/pa_table.C, types/pa_value.h, types/pa_vtable.h: table:hash * src/classes/table.C: table:record have name * src/: classes/op.C, types/pa_vtable.h: allowed $table.2342734 returns vunknown * src/classes/: double.C, int.C, op.C, string.C: int,double,string:int[] double[] string:length[] results now have hames * src/: classes/op.C, classes/table.C, main/main.dsp, types/pa_vtable.h: removed table:find. table:locate and op:eval now return bool * src/: doc/chm.cmd, main/execute.C, types/pa_value.h: wrong pool in method checkparams again. fixed 2001-05-07 paf * src/doc/chm.cmd: cmd * src/: classes/image.C, classes/mail.C, classes/string.C, doc/chm.cmd, include/pa_table.h, main/pa_table.C, types/pa_value.h: method reported errors on wrong pool * src/main/execute.C: ^var[^class:var.method[]] is not constructor now * src/: doc/ClassExample2.dox, doc/aliased.dox, doc/chm.cmd, include/code.h, include/pa_opcode.h, main/compile.C, main/compile_tools.h, main/execute.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h, types/pa_wcontext.h, types/pa_wwrapper.h: pa_code.h * src/doc/: chm.cmd, doxygen.cmd, view.cmd: dox cmd * src/: classes/string.C, classes/table.C, doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, doc/aliased.dox, doc/class.dox, doc/compiler.dox, doc/doxygen.cfg, doc/doxygen.cmd, doc/executor.dox, doc/index.dox, doc/methoded.dox, doc/module.dox, doc/object.dox, doc/pooled.dox, doc/string.dox, doc/targets.dox, doc/value.dox, include/code.h, include/pa_hash.h, include/pa_string.h, main/pa_request.C, main/pa_sql_driver_manager.C, types/pa_vjunction.h, types/pa_vtable.h: dox, split by not clean parts also * src/: include/pa_table.h, main/pa_table.C, types/pa_value.h, types/pa_vtable.h: table: fields, then methods. so to enable 'dir' fields & co. more * src/types/: pa_value.h, pa_vtable.h: table: fields, then methods. so to enable 'dir' fields & co. * src/main/compile.y: grammar: @end 2001-05-04 paf * src/: doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, main/execute.C: dox: example1 updated * src/: classes/classes.h, classes/double.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, doc/doxygen.cfg, doc/index.dox, main/pa_string.C: removed m- method dox 2001-05-03 paf * src/: classes/classes.h, classes/double.C, doc/aliased.dox, doc/class.dox, doc/compiler.dox, doc/doxygen.cfg, doc/doxygen.txt, doc/executor.dox, doc/index.dox, doc/methoded.dox, doc/module.dox, doc/object.dox, doc/pooled.dox, doc/string.dox, doc/targets.dox, doc/value.dox, main/pa_request.C: dox splitted .dox files and added some * src/: classes/Makefile.am, doc/doxygen.txt: classes/am 2001-05-02 paf * src/classes/: image.C, table.C: table:dir result are not tainted by file_name language now 2001-04-28 paf * src/classes/classes.inc: removed classes.inc * src/: classes/classes.inc, main/Makefile.am: removed pa_methoded from .am * src/classes/classes.awk: skipped classes in .awk * src/: classes/Makefile.am, classes/classes.C, classes/classes.h, classes/classes.inc, classes/double.C, classes/file.C, classes/form.C, classes/int.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_methoded.h, main/main.dsp, main/pa_methoded.C, targets/cgi/parser3.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h: renamed pa_methoded back to classes/classes.h * src/: classes/Makefile.am, main/main.dsp: classes/Makefile.am * src/: classes/Makefile.am, classes/classes.awk, classes/classes.cmd, classes/classes.inc, classes/gawk.exe, classes/ls.exe, main/bison.exe: classes.inc autogenerator * src/: classes/classes.C, classes/classes.h, classes/double.C, classes/file.C, classes/form.C, classes/int.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_methoded.h, main/Makefile.am, main/main.dsp, main/pa_methoded.C, targets/cgi/parser3.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h: classes/classes renamet to include|main/pa_methoded * src/: include/pa_string.h, main/pa_globals.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: z * src/: classes/form.C, include/pa_globals.h, main/pa_globals.C: moved some configured data to request::classes_conf moved some string crations from globals to M... [works] * src/: classes/form.C, classes/mail.C, classes/op.C, include/pa_globals.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C: moved some configured data to request::classes_conf moved some string crations from globals to M... * src/: classes/form.C, include/pa_request.h, main/pa_request.C: about to move configured data to special request hash * src/: classes/classes.C, classes/classes.h, classes/file.C, classes/form.C, classes/mail.C, include/pa_request.h, main/pa_request.C: configure started * src/: main/execute.C, types/pa_wcontext.h: Methoded reorganized 2. todo: methoded-configure * src/: classes/_double.h, classes/_file.h, classes/_form.h, classes/_image.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/_unknown.h, classes/classes.inc, classes/double.C, classes/exec.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_globals.h, include/pa_request.h, main/compile.y, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h, types/pa_wcontext.h, classes/classes.C, classes/classes.h: Methoded reorganized. todo: methoded-configure * src/: classes/file.C, classes/table.C, main/compile.y, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vtable.h, types/pa_wcontext.h: removed ^a.menu{$name} ability. now $a{^menu{$name}} or ^a.menu{$a.name} * src/: classes/_string.h, classes/classes.C, classes/classes.h, classes/double.C, classes/exec.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_request.h, main/compile.y, main/execute.C, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h: beautifying just compiled. todo: debug, configure 2001-04-27 paf * src/: classes/file.C, classes/image.C, classes/table.C, main/execute.C, main/pa_request.C, types/pa_vstateless_class.h: beautifying -99 * src/: classes/_double.h, classes/_form.h, classes/_int.h, classes/_response.h, classes/_unknown.h, classes/classes.C, classes/classes.h, classes/double.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h: beautifying -100 * src/main/compile.y: serge@ found @CLASS bug. fixed * src/: classes/_file.h, classes/_image.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_table.h, classes/file.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vcookie.h, types/pa_venv.h, types/pa_vrequest.h: started beautifying 2001-04-26 paf * src/: main/pa_request.C, types/pa_vfile.h: code documentation ++ * src/: doc/doxygen.cfg, include/pa_socks.h, main/pa_socks.C: code documentation ++ * src/: classes/_exec.h, doc/doxygen.cfg, include/pa_config_fixed.h, include/pa_config_includes.h, targets/cgi/pa_pool.C: code documentation ++ * src/: classes/_image.h, classes/op.C, classes/random.C, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vstateless_class.C, types/pa_vstateless_object.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h, types/pa_wcontext.C, types/pa_wwrapper.h: code documentation ++ * src/: classes/image.C, classes/mail.C, classes/string.C, classes/table.C, doc/doxygen.cfg, doc/doxygen.txt, include/pa_array.h, include/pa_dir.h, include/pa_string.h, main/compile_tools.h, main/pa_common.C, sql/pa_sql_driver.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vhash.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_wcontext.h, types/pa_wwrapper.h: code documentation ++ * src/main/: pa_request.C, pa_string.C: z * src/: include/pa_common.h, include/pa_types.h, main/pa_sql_driver_manager.C: module [and, guess, isapi] connection caching fixed. request-pooled-url were stored into global connectioncache 2001-04-25 paf * src/: doc/doxygen.cfg, doc/doxygen.txt, targets/isapi/parser3isapi.C: started doc / [doxygen.txt] * src/: include/code.h, include/pa_common.h, main/compile.y, main/execute.C, main/pa_common.C: -d * src/: classes/file.C, main/pa_exec.C, targets/cgi/parser3.C: illegal call check a bit improved, but still under iis no mapping of dir with parser allowed! 2001-04-24 paf * src/targets/Makefile.am: apache module lib .am * src/main/pa_exec.C: windows32 buildCommand 2001-04-23 paf * src/targets/cgi/Makefile.am: win32 conditional * src/targets/cgi/Makefile.am: win32 conditional * src/targets/cgi/Makefile.am: liblink * src/: include/pa_array.h, main/pa_array.C, types/pa_vfile.h: vfile fields return type * src/types/pa_vfile.h: vfile fields return type * src/include/pa_config_auto.h.in: .h.in * src/: classes/Makefile, main/Makefile, targets/cgi/Makefile, types/Makefile: makefiles removed * src/: classes/Makefile, main/Makefile, main/pa_string.C, targets/cgi/Makefile, types/Makefile: configure.in + makefiles * src/main/pa_string.C: tested OK /// @test really @b test: s x m [tested: i & g ] * src/: classes/random.C, targets/cgi/parser3.C: redo failed /// @test noticed series in isapi, check how initialize_random_class is called! [must be called only once] * src/main/execute.C: operators first! so that ^table.menu{^rem{}} would not be 'unknown column' * src/: classes/table.C, types/pa_vform.C, types/pa_vtable.h: /// @test $a.menu{ $a[123] } and $a.menu{^table:set[]...} * src/: main/pa_request.C, targets/cgi/parser3.C: /// @test with commandline start "parser3 a.html" so that ^load[a.cfg] worked! [now doesnt] * src/targets/cgi/parser3.C: cgi cmdline ver * src/targets/cgi/parser3.C: cgi /// @test disable /cgi-bin/parser3/auto.p * src/main/untaint.C: untaint without charset * src/: include/pa_config_fixed.h, include/pa_config_includes.h, main/pa_common.C: common: file_write /// @test mkdirs file_delete rmdirs * src/main/untaint.C: mail header only once to =? * src/: classes/image.C, classes/mail.C, include/pa_globals.h, include/pa_string.h, main/pa_exec.C, main/pa_request.C, main/untaint.C: untaint - @test optimize whitespaces for all but 'html' * src/: classes/mail.C, include/pa_hash.h, include/pa_string.h, main/pa_common.C, main/pa_hash.C, main/pa_request.C, main/untaint.C: untaint - @test mail-header 2001-04-20 paf * src/: classes/string.C, classes/table.C, include/pa_globals.h, include/pa_request.h, include/pa_string.h, main/compile.y, main/pa_globals.C, main/pa_request.C, main/pa_string.C, targets/cgi/parser3.C: $MAIN:LOCALE * src/main/untaint.C: z * src/: main/untaint.C, targets/cgi/parser3.C: fixed header "a/a" 2001-04-19 paf * src/main/compile_tools.h: $a$b bugfix * src/targets/cgi/parser3.C: z * src/classes/file.C: z * src/: classes/file.C, include/pa_common.h, types/pa_vcookie.C: done: header to $fields. waits for header '\' tricks * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C, main/untaint.C, targets/isapi/parser3isapi.C, types/pa_vcookie.C: changed urlencode here and in untaint.C to HTTP standard's " and \" mech * src/: main/pa_request.C, targets/isapi/parser3isapi.C: fixed http://alx/~paf/ doesnt load /auto.p 2001-04-18 paf * src/main/pa_request.C: 1 * src/: main/Makefile.am, main/main.dsp, targets/cgi/Makefile.am: linux @alx 2001-04-17 paf * src/: classes/file.C, classes/image.C, doc/doxygen.cfg, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: SQL_Driver_services renamed. doxygen statics enabled * src/: Makefile.am, classes/Makefile.am, classes/_double.h, classes/_exec.h, classes/_file.h, classes/_form.h, classes/_image.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/_unknown.h, classes/file.C, classes/image.C, classes/mail.C, classes/op.C, classes/random.C, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_hash.h, include/pa_sql_driver_manager.h, include/pa_version.h, main/Makefile.am, main/compile.y, main/pa_common.C, main/pa_exec.C, main/pa_socks.C, main/pa_sql_driver_manager.C, sql/Makefile.am, sql/pa_sql_driver.h, targets/cgi/Makefile.am, targets/cgi/parser3.C, types/Makefile.am, types/pa_vcookie.C, types/pa_vform.C, types/pa_vimage.h: exec @jav * src/: include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, types/pa_vimage.h: sql driver interface now has initialize(client .so) 2001-04-16 paf * src/Makefile.am: compile2 cygwin * src/: include/pa_config_includes.h, main/pa_exec.C, main/pa_socks.C, targets/cgi/Makefile.am: compile1 cygwin * src/targets/cgi/Makefile.am: compile0 jav * src/: Makefile.am, classes/Makefile.am, classes/_double.h, classes/_exec.h, classes/_file.h, classes/_form.h, classes/_image.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/_unknown.h, classes/image.C, classes/mail.C, classes/op.C, classes/random.C, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_hash.h, include/pa_version.h, main/Makefile.am, main/compile.y, main/pa_common.C, main/pa_exec.C, sql/Makefile.am, targets/cgi/Makefile.am, targets/cgi/parser3.C, types/Makefile.am, types/pa_vcookie.C, types/pa_vform.C: compile-1 2001-04-15 paf * src/classes/op.C: z * src/classes/table.C: table:empty +=process * src/types/pa_value.h: MethodParams !junction * src/: classes/_string.h, classes/double.C, classes/file.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, main/pa_request.C: MethodParams everywhere * src/: classes/op.C, include/pa_request.h, types/pa_value.h, types/pa_vmethod_frame.h: MethodParams in op.C 2001-04-12 paf * src/: classes/image.C, types/pa_vimage.h: image:font :text * src/: classes/_unknown.h, classes/unknown.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, types/pa_vunknown.h: ^unknown:int[]=0 double[]=0 * src/: classes/image.C, main/pa_hash.C: hash bug fixed * src/classes/image.C: image:gif now does not have params * src/classes/image.C: image:line/fill/rectangle/bar/replace/polygon/polybar * src/: classes/image.C, classes/op.C, main/execute.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_wcontext.h: for var now written not to r.wcontext, but to r.root cleared "entered_object" state 2001-04-11 paf * src/classes/image.C: image:create image:load * src/: classes/image.C, main/main.dsp: gd with mem write + image just compiled * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: gd todo: gif without file * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: gd started porting to Pooled descendant * src/: classes/image.C, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_vcframe.h, types/pa_vcode_frame.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vmframe.h: libimaging dead end: pil parses header in .py * src/: classes/image.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, types/pa_vimage.C, types/pa_vimage.h: gd dead end. switching to python imaging lib * src/main/main.dsp: gd+smtp made separate libs * src/: include/pa_globals.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/untaint.C, types/pa_vfile.C, types/pa_vstring.C: fixed vstring:as_vfile length * src/: classes/mail.C, classes/op.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vstring.C, types/pa_vstring.h: forced UL_FILE_NAME of posted file name * src/: classes/image.C, main/pa_request.C, types/pa_vform.C: fixed post [broke when moved post read to core] 2001-04-10 paf * src/classes/image.C: image:html done * src/: classes/image.C, types/pa_vimage.C: jpg measure bugs fixed * src/classes/image.C: z * src/: classes/_image.h, classes/image.C, types/pa_vimage.C: image forgotten! * src/: classes/table.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_vimage.h: image:measure -90 * src/: classes/_double.h, classes/_file.h, classes/_form.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/file.C, classes/mail.C, include/pa_common.h, include/pa_globals.h, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_globals.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vresponse.h, types/pa_vstring.h: image:measure -100 just compiled * src/classes/mail.C: minor bug with unclear from/to * src/classes/mail.C: sendmail unix skipping defaults * src/: classes/mail.C, include/pa_common.h, main/pa_common.C: sendmail unix added defaults * src/classes/mail.C: unix sendmail compiled. todo:testing * src/: classes/mail.C, main/pa_globals.C: smtp some consts 2001-04-09 paf * src/: classes/file.C, include/pa_exec.h, include/pa_sapi.h, main/main.dsp, main/pa_exec.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: all targets exec * src/: include/pa_sapi.h, include/pa_string.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: sapi exec dead end. badly parsed args in apache:util.script * src/include/pa_string.h: written but not tested exec with env for unix * src/: classes/file.C, main/main.dsp, main/pa_request.C, targets/cgi/parser3.C: exec win32 env * src/: classes/file.C, include/pa_hash.h, main/pa_hash.C: exec env 0 * src/: classes/exec.C, classes/file.C, include/pa_globals.h, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vstring.C: exec4. todo env * src/: classes/exec.C, include/pa_common.h, main/pa_common.C, main/untaint.C: exec3. decided exec:cgi to move to file:cgi * src/: classes/_exec.h, main/execute.C, main/pa_globals.C, main/pa_request.C, types/pa_vcookie.C, types/pa_vfile.C: exec -2 * src/: classes/_exec.h, classes/exec.C, include/pa_common.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/pa_string.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, types/pa_vform.C, types/pa_vform.h: exec class just compiled. moved post read to request core * src/: classes/_op.h, include/pa_dir.h, include/pa_globals.h, include/pa_sapi.h, main/main.dsp, main/pa_dir.C, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp: problems with ^exec:cgi post data. they are already read by vform 2001-04-08 paf * src/: classes/file.C, classes/mail.C, classes/string.C, include/pa_request.h, include/pa_string.h, main/pa_request.C: uuencode. string<< 2001-04-07 paf * src/classes/mail.C: z * src/classes/mail.C: z * src/classes/mail.C: ^mail[$attach * src/classes/mail.C: ^attach dead end * src/: include/pa_socks.h, main/main.dsp, main/pa_socks.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C: mail:send 1 * src/: classes/mail.C, main/pa_request.C: z * src/: classes/mail.C, include/pa_globals.h, include/pa_request.h, main/main.dsp, main/pa_globals.C, main/pa_request.C: smtp just compiled * src/classes/mail.C: += * src/: classes/mail.C, include/pa_string.h: mail:send -1 text prepared * src/: classes/_mail.h, classes/mail.C, include/pa_common.h, include/pa_globals.h, include/pa_string.h, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/untaint.C, types/pa_vcookie.C: mail:send -10 just compiled 2001-04-06 paf * src/: classes/table.C, include/pa_globals.h, main/pa_globals.C, main/pa_string.C: table:dir 1 * src/: classes/table.C, include/pa_dir.h, main/execute.C, main/main.dsp, main/pa_dir.C: table:dir 0 [without regexp] * src/: classes/_op.h, classes/_root.h, classes/op.C, classes/root.C, include/pa_globals.h, include/pa_request.h, main/compile.C, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C: renamed 'root' to 'op' * src/classes/: _op.h, op.C: renamed from 'root' * src/types/pa_valiased.C: another root inherititance skipped * src/main/: compile.C, compile.y, execute.C: operators are now not root methods of parent class. just 'ROOT' class * src/: classes/random.C, classes/table.C, main/pa_globals.C: @office * src/: main/pa_request.C, sql/pa_sql_driver.h: mysql limit 2001-04-05 paf * src/: main/execute.C, main/pa_request.C, main/pa_string.C, types/pa_value.h, types/pa_vmframe.h, types/pa_wcontext.h: constructor flag dropped at get_method_frame and remembered into method_frame * src/: classes/file.C, classes/root.C, classes/string.C, classes/table.C, main/pa_request.C: junction to code&expression in errors * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, targets/isapi/parser3isapi.dsp: $LOCALE:ctype[Russian_Russia.1251] * src/: include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_hash.h, include/pa_string.h, main/pa_hash.C, main/pa_table.C: hash now not thread-safe. * src/: classes/table.C, include/pa_string.h, main/pa_string.C, main/untaint.C: z * src/: classes/random.C, classes/root.C, classes/table.C, include/pa_sql_connection.h, include/pa_string.h, main/execute.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/untaint.C, sql/pa_sql_driver.h, types/pa_vmframe.h, types/pa_wcontext.C, types/pa_wcontext.h: sql quote. string untaint UL_SQL * src/: classes/table.C, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql ping * src/classes/table.C: select * from hren error contains statement * src/: classes/table.C, include/pa_sql_connection.h, include/pa_types.h, main/pa_sql_driver_manager.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/parser3.dsp: mysql 0 * src/: classes/root.C, include/pa_sql_connection.h, include/pa_sql_driver.h, main/main.dsp, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql driver services for conv memory & error reporting 2001-04-04 paf * src/doc/doxygen.cfg: z * src/include/pa_sql_driver.h: mysql connect * src/include/pa_sql_driver.h: mysql info * src/: classes/root.C, include/pa_sql_driver.h, include/pa_sql_driver_manager.h, main/main.dsp, main/pa_sql_driver_manager.C: more manager&connection&driver * src/sql/Makefile.am: forgot to add mysql client * src/: include/pa_sql_driver.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: connect&sql -1000 just compiled [forgot to add libltdl, added] * src/: Makefile.am, classes/root.C, classes/string.C, classes/table.C, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, include/pa_table.h, main/main.dsp, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C: connect&sql -1000 just compiled * src/: classes/random.C, classes/root.C, classes/table.C, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, main/pa_request.C, types/pa_vclass.h: sql frame -10 2001-04-03 paf * src/types/pa_vform.C: z * src/: classes/string.C, types/pa_vform.C: string:match replace assigned lang * src/: classes/string.C, main/compile.y: grammar: fixed to allow {}[]< empty [] * src/: classes/file.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_common.C, main/pa_string.C, main/untaint.C: string:match replace 2. string.cstr(forced lang) * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string:match replace strange matches * src/classes/string.C: string:match replace 0 * src/: classes/string.C, main/pa_string.C: string:match replace prepared 2 * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string:match replace prepared * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string:match replace -11 * src/: classes/string.C, include/pa_globals.h, include/pa_string.h, include/pa_threads.h, main/pa_globals.C, main/pa_string.C, targets/isapi/parser3isapi.dsp: string:match 0 * src/: classes/string.C, include/pa_globals.h, include/pa_string.h, main/main.dsp, main/pa_globals.C, main/pa_string.C: string:match [search] -1 just compiled * src/types/pa_vstring.C: z * src/: classes/double.C, classes/file.C, classes/form.C, classes/int.C, classes/response.C, classes/root.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_string.C: string:match -10 [frame] * src/: classes/file.C, main/compile_tools.C, main/pa_common.C, main/pa_request.C: z * src/: main/pa_common.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h: todo/tests * src/include/pa_common.h: z * src/: include/pa_globals.h, include/pa_hash.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vfile.C: content-disposition * src/: include/pa_common.h, include/pa_globals.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h: main:post-process * src/: include/pa_common.h, include/pa_request.h, include/pa_sapi.h, main/main.dsp, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vstring.h: vfile in response:body * src/classes/table.C: table:append now uses string::split * src/classes/table.C: z * src/: classes/file.C, classes/root.C, classes/string.C, classes/table.C, doc/doxygen.cmd, doc/doxygen.txt, doc/generate.cmd, include/pa_array.h, include/pa_request.h, include/pa_string.h, main/execute.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vcookie.C: string::pos & cmp & piece bugs fixed. string::split new table:load separated from set table:set implemented with clean \n \t searches 2001-04-02 paf * src/: classes/table.C, include/pa_string.h, main/pa_string.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h: string::pos. about to use it in table:set/load * src/: classes/table.C, include/pa_array.h, include/pa_string.h, include/pa_table.h, main/execute.C, types/pa_value.h: table:join * src/classes/random.C: random:generate 1 * src/: classes/_random.h, classes/random.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, types/pa_value.h: random:generate 2001-03-30 paf * src/: classes/table.C, include/pa_string.h, main/pa_string.C: todo: table flip and append. string::pos * src/: classes/double.C, classes/file.C, classes/int.C, classes/response.C, classes/root.C, classes/string.C, classes/table.C, main/compile.y, main/execute.C, types/pa_value.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: static|dynamic|any method registration * src/: classes/file.C, classes/table.C, include/pa_table.h, main/pa_table.C, types/pa_vstring.h, types/pa_wwrapper.h: table:flip 2001-03-29 paf * src/classes/string.C: string:xsplit forgot that they must result in 1 row N column [not vice versa] * src/classes/string.C: z * src/classes/string.C: string: rsplit * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string: lsplit * src/: classes/string.C, include/pa_string.h, main/execute.C, main/pa_array.C, main/pa_string.C, types/pa_vtable.h: string: lsplit -1 * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: string: pos * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string: pos -1 * src/: classes/string.C, classes/table.C, include/pa_string.h, main/compile.y, main/pa_request.C, main/pa_string.C, main/untaint.C: string: left right mid * src/: classes/string.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/main.dsp, types/pa_value.h, types/pa_vstring.h, types/pa_vunknown.h: empty params allowed. [] and [;] are different now. * src/: include/pa_pool.h, include/pa_request.h, main/pa_request.C, main/untaint.C: pool.request undone * src/: include/pa_pool.h, include/pa_request.h, main/pa_request.C, main/untaint.C: pool.request 2001-03-28 paf * src/: classes/file.C, include/pa_globals.h, include/pa_request.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vrequest.C, types/pa_vunknown.h: $request:browser [.type .version]; unknown.get_double now = 0. * src/: classes/file.C, include/pa_globals.h, include/pa_request.h, include/pa_table.h, main/pa_globals.C, main/pa_request.C, main/pa_table.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: file:load autodetection of mime-type by user-file-name * src/: classes/file.C, main/execute.C, main/pa_common.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: file:load 1. tainted * src/: classes/file.C, include/pa_common.h, main/pa_common.C, types/pa_vfile.C, types/pa_vfile.h: started file:load. wrong write. must be self.set * src/: classes/file.C, classes/root.C, classes/table.C, include/pa_table.h, main/pa_table.C: table:locate1, file:test * src/: classes/table.C, include/pa_array.h, include/pa_hash.h, include/pa_table.h, main/pa_array.C, main/pa_table.C, types/pa_vtable.h: table:locate just compiled 2001-03-27 paf * src/main/: execute.C, pa_common.C: fixed r/w context of code-params2, fixed ntfs hardlink slow dir update * src/: main/execute.C, types/pa_value.h, types/pa_vmframe.h, types/pa_wcontext.h: fixed r/w context of code-params * src/: classes/table.C, main/execute.C: about to change junction rcontext!! * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, main/compile_tools.C, main/execute.C, main/pa_request.C, main/untaint.C, types/pa_value.h, types/pa_vbool.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vmframe.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h: sort 0 * src/types/: pa_valiased.C, pa_valiased.h, pa_vdouble.h, pa_vfile.h, pa_vint.h, pa_vresponse.h, pa_vstring.h, pa_vtable.h: renamed to are_static_calls_disabled * src/: classes/table.C, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vunknown.h: continue on sort * src/main/compile.y: fixed minor bug in @mn[][] ...^{ * src/: classes/table.C, include/pa_common.h, main/compile.y: started table:sort fixed minor bug in #...^{ * src/: classes/table.C, include/pa_common.h, main/compile.y, main/execute.C, main/pa_common.C, main/pa_table.C: table:save decided to have as it were. stepped back. grammar: added 'in' 'is' 'lt'&co follow-space check 2001-03-26 paf * src/: classes/file.C, classes/root.C, classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_table.h, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/pa_table.C: moved ::save to pa_table. disabled @auto invocation in ^process * src/main/compile.y: grammar: [] 0params [;] 2 params (was 0) * src/: classes/table.C, include/pa_array.h, include/pa_table.h, main/pa_array.C: table:record * src/: main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/pa_valiased.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h: z * src/: include/pa_pool.h, main/execute.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h: disabled $a(123) $b[$a.CLASS] ^b.inc[123] shit. allowed no checks in native method realisations on 'self' validity - they now can simply assume that 'self' is V{Proper} . 2001-03-25 paf * src/main/untaint.C: z * src/main/: pa_request.C, untaint.C: moved default typo-table to lowlevel - it initialization could be skipped if failed in @auto. so that exception report would use some table * src/main/pa_request.C: table empty lines ignored. system-default content type assigned in output:result [can fail in main:auto and skipped normal defaults extraction] * src/: include/pa_string.h, main/compile.y: #comment fixed minor bug * src/main/: pa_globals.C, untaint.C: html-typo - moved all processing to table [except preliminary \r\n \r \n replacements to "\n"] * src/: classes/table.C, main/untaint.C: html-typo - decided to move all the processing to table * src/: classes/table.C, include/pa_table.h, main/pa_globals.C, main/pa_table.C, main/untaint.C: returned table originating. useful for reporting typo table problems origin. think would be useful somewhere else * src/main/untaint.C: typo \r \r\n \n properly handled * src/: classes/table.C, include/pa_globals.h, include/pa_string.h, include/pa_table.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, types/pa_vcookie.h: typo & typo-default 2001-03-24 paf * src/main/pa_common.C: z * src/: include/pa_string.h, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C: html-typo 2 * src/: doc/doxygen.cfg, doc/doxygen.txt, doc/generate.cmd, doc/view.cmd, include/pa_array.h, include/pa_globals.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, main/execute.C, main/pa_array.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vtable.h: html-typo 0 html-typo 1. noticed double default content-type prob. run cgi.cmd tomorrow first html-typo sample. detected << problem: they become ltlt too fast * src/main/compile.y: z * src/main/: compile.y, compile_tools.h: #comment * src/: classes/file.C, classes/root.C, classes/table.C, include/pa_common.h, include/pa_request.h, main/compile.y, main/pa_common.C, main/pa_request.C, main/pa_string.C, targets/isapi/parser3isapi.C, types/pa_vfile.h: file_read stringified * src/types/pa_valiased.C: decided to String-ify file_read * src/targets/: cgi/parser3.C, isapi/nt_log_events.mc, isapi/parser3isapi.dsp: cgi: sapi::log * src/: include/pa_sapi.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/nt_log_events.mc, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: nt error log experiments failed - cgi under iis got no access to log. registereventsource simply failed with 5(illegal call) code, while worked OK as standalone executable. isapi: used HSE_APPEND_LOG_PARAMETER feature * src/: include/pa_common.h, include/pa_globals.h, main/pa_common.C, main/pa_globals.C, main/pa_request.C, targets/isapi/parser3isapi.C: fixed default content-type allocation storage * src/: include/pa_globals.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C: z * src/: include/pa_array.h, include/pa_hash.h, include/pa_request.h, main/compile.y, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_request.C, types/pa_vcookie.C: cyclic uses ignored. defaulted default content-type * src/main/: compile.y, execute.C, main.dsp: @CLASS equals @BASE. sanity * src/: main/pa_globals.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: thrown away freeze mech. no danger now for you can't do ^request:process[@new-method[] body] trick anymore. still remains $some_instance.process[@new-method[] possibility] but would leave it as a feature. see index for sample * src/: include/pa_common.h, main/pa_common.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: auto.p monkey every target * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/pool_storage.h, types/pa_vform.C, types/pa_vform.h: auto.p monkey 2001-03-23 paf * src/: include/pa_pool.h, main/pa_request.C, targets/cgi/pa_pool.C, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h: isapi: dumb pool storage * src/targets/isapi/pa_pool.C: decided to continue with extension * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: isapi: think it would be better to rewrite as filter then to deal with pool * src/: main/main.dsp, targets/isapi/parser3isapi.C: isapi: docroot now like in cgi, not from APPL_PHYSICAL_PATH * src/: classes/root.C, classes/table.C, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_string.h, include/pa_threads.h, include/pa_types.h, include/pa_version.h, main/compile.y, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vfile.C, types/pa_vform.C: cgi: reinvent document_root and request_uri under iis. autoconf updated. introducing ap_config_includes * src/targets/cgi/parser3.C: cgi: reinvent document_root under iis * src/targets/cgi/parser3.C: cgi: only one pool now * src/: include/pa_globals.h, include/pa_sapi.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vcookie.C, types/pa_venv.h, types/pa_vform.C: sapi made object * src/: include/pa_globals.h, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, types/pa_vcookie.C, types/pa_venv.h, types/pa_vform.C: all: sapi beauty * src/: main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: isapi minor env beauty * src/: main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: isapi document_root 0 2001-03-22 paf * src/targets/isapi/parser3isapi.C: isapi keep-alive * src/targets/: cgi/vform_fields_fill.C, cgi/vform_fields_fill.h, isapi/parser3isapi.C: z * src/: include/pa_pool.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: isapi 1 * src/targets/isapi/: KILL.EXE, PSTAT.EXE, istart.cmd, istop.cmd, kill.pl: isapi added utils * src/: include/pa_pool.h, main/pa_pool.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, types/pa_vform.C: isapi 0 * src/: include/pa_pool.h, targets/cgi/pa_pool.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.def, targets/isapi/parser3isapi.dsp: started isapi * src/: include/pa_globals.h, main/pa_common.C, main/pa_request.C: some comments * src/: include/pa_globals.h, include/pa_request.h, include/pa_types.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vcookie.C: config of auto.p path: parser_root_auto_path parser_site_auto_path * src/types/pa_vcookie.C: cookie attr decoded 2001-03-21 paf * src/targets/cgi/parser3.C: z * src/include/pa_globals.h: post. todo: config of auto.p path * src/: include/pa_globals.h, targets/cgi/parser3.C, types/pa_venv.h: in cookie & env. todo:post * src/: Makefile.am, classes/Makefile.am, classes/file.C, classes/root.C, classes/table.C, include/pa_array.h, include/pa_common.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/Makefile.am, main/compile.y, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/Makefile.am, targets/cgi/Makefile.am, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/Makefile.am, types/pa_vcookie.C, types/pa_vform.C, types/pa_vstring.h, types/pa_wwrapper.h: shifted apache branch on main trunc * src/: include/pa_common.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, main/main.dsp, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.dsp, types/pa_vcookie.C, types/pa_vform.C, types/pa_vstring.h: starting mod_parser3 * src/targets/cgi/parser3.C: starting mod_parser3 2001-03-20 paf * src/: main/pa_common.C, targets/cgi/Makefile.am, targets/cgi/parser3.C: automake compiled and works. todo:make win32 ifdefs work and add ifdef unistd * src/: classes/table.C, include/pa_common.h, include/pa_request.h, main/Makefile.am, main/pa_common.C, main/pa_request.C, main/pa_table.C, targets/cgi/Makefile.am, targets/cgi/parser3.C: z * src/: include/pa_request.h, main/Makefile.am, main/compile.y, main/execute.C, main/pa_common.C, types/Makefile.am: removing locking * src/: classes/Makefile.am, types/Makefile.am: z * src/: Makefile.am, classes/file.C, classes/root.C, classes/table.C, include/pa_array.h, include/pa_request.h, include/pa_string.h, main/Makefile.am, main/execute.C, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/Makefile.am, targets/cgi/Makefile.am, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_wwrapper.h: String::UL_ * src/: classes/table.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, types/pa_vfile.h: ^table:save * src/: classes/file.C, classes/table.C, include/pa_array.h, include/pa_common.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, main/pa_globals.C, main/untaint.C, types/pa_valiased.h, types/pa_value.h, types/pa_vform.h: z * src/include/pa_string.h: z * src/: classes/_request.h, classes/request.C, main/main.dsp, main/pa_globals.C, types/pa_value.h, types/pa_vform.h, types/pa_vrequest.C, types/pa_vrequest.h: VRequest moved to :Value * src/: classes/_request.h, classes/request.C, main/pa_globals.C, types/pa_vrequest.C, types/pa_vrequest.h: VRequest moved to :VStateless_object * src/: classes/_response.h, classes/response.C, main/pa_globals.C, types/pa_vform.h, types/pa_vresponse.h: VResponse moved to :VStateless_object * src/: main/main.dsp, targets/cgi/parser3.dsp, types/pa_valiased.C, types/pa_vform.h: commented VForm * src/: targets/cgi/pa_vform.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h: moved common get_element part from stateless object&class into VAliased * src/: classes/_env.h, classes/_table.h, classes/env.C, classes/table.C, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_venv.h: VEnv is now :Value * src/: classes/_cookie.h, classes/_table.h, classes/cookie.C, main/execute.C, main/main.dsp, main/pa_globals.C, types/pa_vcookie.C, types/pa_vcookie.h: VCookie is now :Value * src/types/: pa_vfile.C, pa_vfile.h, pa_vstateless_object.h: vfile doxx * src/: classes/_file.h, classes/file.C, include/pa_types.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_valiased.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h: \ to / and ^file:save 2001-03-19 paf * src/types/pa_vfile.C: z * src/: classes/file.C, classes/request.C, classes/table.C, include/pa_string.h, main/main.dsp, main/pa_pool.C, main/pa_request.C, main/untaint.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: file 1 * src/: classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_string.h, include/pa_table.h, main/main.dsp, main/pa_common.C, main/pa_globals.C, types/pa_value.h, types/pa_vcookie.h, types/pa_venv.h, types/pa_vform.C, types/pa_vform.h, types/pa_vrequest.h, types/pa_vtable.h, classes/_file.h, classes/file.C, types/pa_vfile.C, types/pa_vfile.h: file class just compiled * src/: classes/table.C, include/pa_pool.h, include/pa_request.h, include/pa_table.h, include/pa_types.h, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vclass.h, types/pa_vform.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h: ^table:set{default level: TABLE} * src/include/pa_pool.h: z * src/: include/pa_hash.h, include/pa_types.h, main/pa_common.C, main/pa_hash.C, main/pa_request.C, types/pa_vcookie.C: renamed Hash::Value to Val so to doxygen would finlly stop confusing those Value-s * src/: include/code.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_exception.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, types/pa_valiased.h, types/pa_value.h: z * src/types/: pa_valiased.h, pa_vbool.h: doc: Value and it's derivates somehow unlinked. don't know why yet * src/: include/code.h, include/pa_array.h, include/pa_pool.h, include/pa_string.h, include/pa_threads.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_exception.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, types/pa_value.h: auto @brief * src/: classes/root.C, classes/table.C, main/pa_exception.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vbool.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vform.h, types/pa_vint.h, types/pa_vrequest.h: doc: detected Value derivates prob * src/include/pa_globals.h: z * src/: classes/_request.h, classes/request.C, include/code.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/execute.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vform.C: doxygen include/, Value 2001-03-18 paf * src/: classes/cookie.C, types/pa_vcookie.C, types/pa_vcookie.h: cookie: allowed access to hash-assigned * src/targets/cgi/parser3.C: z * src/: classes/_cookie.h, classes/cookie.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_string.h, include/pa_types.h, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vunknown.h: cookie class * src/main/pa_request.C: zero length output allowed * src/: classes/response.C, main/pa_request.C, types/pa_value.h, types/pa_vhash.h, types/pa_vresponse.h: ^response:clear[] * src/: classes/root.C, main/pa_request.C: taint forgotten forced lang switch * src/: classes/root.C, include/pa_globals.h, include/pa_string.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, types/pa_value.h, types/pa_vhash.h: $defautl[$content-type[$value[text/html] $charset[windows-1251]] * src/main/execute.C: z * src/: classes/root.C, main/pa_request.C, main/untaint.C, targets/cgi/parser3.C: taint[uri * src/: classes/request.C, classes/response.C, classes/root.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_string.h, main/pa_common.C, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C: ^taint 0 * src/: classes/root.C, classes/string.C, include/pa_string.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, types/pa_vdouble.h, types/pa_vform.C, types/pa_vint.h, types/pa_vstateless_class.C: convinient string(pool, char *src, bool tainted) ctor * src/: include/pa_hash.h, include/pa_request.h, include/pa_string.h, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C: proper @exceptions params tainting * src/: include/pa_hash.h, main/pa_hash.C, targets/cgi/parser3.C: response fields to header * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C: z * src/: classes/_response.h, classes/response.C, include/pa_globals.h, include/pa_hash.h, include/pa_request.h, main/compile.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vhash.h, types/pa_vrequest.h, types/pa_vresponse.h: $response: 0 request::core exception rethrow 2001-03-16 paf * src/: main/execute.C, main/main.dsp, types/pa_value.h, types/pa_vrequest.h: native method' class call with less params then needed error reporting * src/: classes/_request.h, classes/request.C, include/pa_globals.h, include/pa_request.h, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vform.C, types/pa_vrequest.C, types/pa_vrequest.h: $request : query :uri * src/: include/pa_globals.h, main/execute.C, main/pa_globals.C, types/pa_value.h, types/pa_vcframe.h, types/pa_vmframe.h, types/pa_wcontext.h: $result * src/: main/execute.C, types/pa_vmframe.h: if(in "/news/") * src/: classes/double.C, include/code.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: () and {} param wcontext conflict fixed by OP_EXPR_CODE__STORE_PARAM * src/: include/code.h, include/pa_hash.h, include/pa_request.h, main/compile.y, main/execute.C, types/pa_value.h, types/pa_vhash.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_wcontext.C, types/pa_wcontext.h: see () and {} param wcontext conflict * src/: main/execute.C, types/pa_value.h, types/pa_vstateless_object.h, types/pa_vstring.h: disabled $string.field 2001-03-15 paf * src/main/pa_request.C: news sample * src/: main/compile.y, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vstring.h: @exception * src/main/: compile.y, execute.C: z * src/: main/compile.y, main/pa_request.C, targets/cgi/parser3.C, types/pa_vstring.h: pre-pre-pre-beta cgi under win32 apache pre pre pre works * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vform.C, types/pa_vform.h: vform fillfields just compiled 2001-03-14 paf * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C: z * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.dsp, types/pa_vform.C, types/pa_vform.h, types/pa_vstring.h: limits -1 * src/: include/pa_globals.h, include/pa_request.h, include/pa_types.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vform.C, types/pa_vform.h: request_info -1 * src/: include/pa_globals.h, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/cgi/vform_fields_fill.C, targets/cgi/vform_fields_fill.h: vform_fields_fill * src/targets/cgi/parser3.C: # if MSVC * src/: include/pa_common.h, include/pa_types.h, main/pa_request.C, targets/cgi/parser3.C: PATH_DELIMITER_CHAR * src/targets/cgi/parser3.C: z * src/: include/core.h, include/pa_globals.h, include/pa_pool.h, include/pa_string.h, include/pa_types.h, main/compile.y, main/core.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/pa_vform.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vform.h, types/pa_vunknown.h: global handler, exceptions in parser3 2001-03-13 paf * src/: classes/form.C, main/compile.y, main/core.C, types/pa_value.h, types/pa_vclass.h, types/pa_venv.h, types/pa_vform.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: form:fields removed. use $form.CLASS instead * src/: include/core.h, include/pa_common.h, include/pa_request.h, main/core.C, main/execute.C, main/main.dsp, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vform.h: started cgi target * src/: include/core.h, include/pa_common.h, include/pa_request.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C: before error show with parser * src/: classes/_form.h, classes/form.C, include/core.h, include/pa_request.h, main/core.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp: z * src/targets/cgi/: parser.dsp, parser3.dsp: z * src/targets/cgi/: Makefile.am, pa_pool.C, pa_vform.C, parser.dsp, parser3.C: renamed targets/ parser to cgi * src/: classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, include/pa_request.h, types/pa_vhash.h: z * src/: classes/_env.h, classes/env.C, classes/root.C, include/core.h, include/pa_pool.h, include/pa_request.h, main/compile.C, main/compile.y, main/core.C, main/main.dsp, main/pa_common.C, main/pa_request.C, types/pa_value.h, types/pa_venv.h, types/pa_vstateless_class.h: started $form: [historical moment :)] * src/: include/code.h, include/pa_string.h, main/compile.y, main/execute.C, main/pa_string.C: 'value is type' expr operator * src/types/pa_venv.h: $ENV 1 * src/main/execute.C: z * src/: main/execute.C, types/pa_value.h, types/pa_venv.h: for future methods of ENV constructor if * src/: include/pa_request.h, types/pa_venv.h: $ENV 0.1 stateless class * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/_table.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, include/pa_request.h, main/compile.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_valiased.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_venv.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_wcontext.h: $ENV: re 0, stateless classes * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/_table.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, include/pa_request.h, main/compile.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_valiased.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_venv.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_wcontext.h: $ENV: re 0, stateless classes * src/: include/pa_request.h, main/compile.C, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmframe.h: fixed yesterdays bad decision on execute_static_method * src/: classes/table.C, include/pa_types.h, main/pa_request.C: z * src/: classes/double.C, classes/int.C, classes/root.C, types/pa_vdouble.h, types/pa_vint.h: Int,Double dec mul div mod * src/main/pa_request.C: z * src/: classes/root.C, classes/table.C, include/pa_exception.h, include/pa_pool.h: skipped_restructure_exceptions_dead_end * src/: classes/root.C, classes/table.C, include/pa_exception.h, include/pa_pool.h, main/pa_request.C: restructure_exceptions_dead_end * src/: classes/root.C, main/compile.y: ^if required junctions. allowed ; inside {} to break params * src/classes/root.C: ^eval * src/: classes/_string.h, classes/double.C, classes/int.C, classes/string.C, main/execute.C, types/pa_wcontext.h: int doube string ^format * src/: main/execute.C, types/pa_wcontext.h: constructing flag not 'bad' but not 'enough' * src/: classes/double.C, classes/root.C, classes/table.C, include/pa_common.h, include/pa_types.h, main/compile.y, main/pa_common.C, main/pa_request.C, main/untaint.C, types/pa_vdouble.h, types/pa_vint.h, types/pa_vtable.h, types/pa_wwrapper.h: think constructing flag as is is bad * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, main/core.C, main/execute.C, types/pa_vint.h: ^for 2001-03-12 paf * src/classes/table.C: table ^empty * src/: classes/table.C, include/pa_table.h: table ^menu * src/: classes/root.C, classes/table.C, types/pa_vtable.h: table ^offset ^line ^count * src/classes/root.C: ^round() ^floor() ^ceiling() ^abs() ^sign() * src/classes/: root.C, table.C: ^use * src/: classes/root.C, classes/table.C, include/pa_request.h, main/compile.y, main/core.C, main/execute.C, types/pa_vclass.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: ^while. switched off wcontext.constructing after write(value) or auto-vhash-constructing * src/: classes/root.C, classes/table.C, include/pa_request.h, main/pa_request.C: fail_if_junction_ helper func * src/: classes/root.C, classes/table.C, include/pa_common.h, include/pa_request.h, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_request.C: ^process error point by actual method_name, not source. ^load * src/types/pa_vtable.h: table: no, better with string in cells... * src/: include/pa_array.h, include/pa_table.h, main/pa_table.C, classes/_table.h, classes/table.C, main/untaint.C: z * src/: classes/root.C, include/pa_common.h, include/pa_string.h, include/pa_table.h, main/core.C, main/execute.C, main/pa_common.C, main/pa_request.C, main/pa_table.C, types/pa_value.h: table:set 0 * src/: classes/root.C, include/core.h, include/pa_array.h, include/pa_request.h, include/pa_table.h, main/core.C, main/main.dsp, main/pa_request.C, main/pa_table.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vmframe.h, types/pa_vstring.h: freeze, ^table:create[] -1 * src/: classes/root.C, types/pa_value.h: z * src/: classes/root.C, main/execute.C, types/pa_vclass.h: used get_method in couple places optimizing them * src/classes/root.C: z * src/: classes/root.C, types/pa_vclass.h: process temp main zeroing * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/pa_common.h, include/pa_request.h, include/pa_string.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_common.C, main/pa_request.C, types/pa_value.h, types/pa_vmframe.h: ^process. actual names to store param and check_actual_numbered_params for better place diagnostics * src/: classes/root.C, main/execute.C, main/main.dsp: setname for method-junctions bug fixed * src/types/: pa_vdouble.h, pa_vint.h, pa_vobject.h, pa_vstateless_object.h, pa_vstring.h: stateless_object 2001-03-11 paf * src/: main/main.dsp, types/pa_value.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vobject.h, types/pa_vstring.h: VString VDouble VInt base now VObject_base - without fields * src/: classes/root.C, include/core.h, main/core.C: z * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/core.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/compile.C, main/core.C, main/pa_request.C: ^untaint 0 * src/: classes/double.C, classes/int.C, classes/root.C, include/pa_request.h, main/execute.C: intercept_string * src/: classes/double.C, classes/int.C, classes/root.C, types/pa_vclass.C, types/pa_vclass.h: add_native_method helper * src/: classes/double.C, classes/int.C, include/pa_request.h: ^inc-s(expr) * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, include/code.h, include/core.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_exception.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vcframe.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstring.h, types/pa_vunknown.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: headers updated * src/: main/pa_request.C, types/pa_vhash.h: z * src/: include/core.h, include/pa_request.h, main/core.C, main/main.dsp, main/pa_request.C: renamed AUTO: to MAIN: * src/: include/pa_valiased.h, include/pa_value.h, include/pa_vbool.h, include/pa_vcframe.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vint.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/compile.y, main/core.C, main/main.dsp, main/pa_cframe.C, main/pa_request.C, main/pa_value.C, main/pa_vclass.C, main/pa_wcontext.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vcframe.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstring.h, types/pa_vunknown.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: splitted types from include/ 2001-03-10 paf * src/: include/core.h, include/pa_request.h, main/core.C, main/pa_request.C: run+auto=run * src/: classes/root.C, include/pa_request.h: minor if junction bug * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, include/code.h, include/core.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_valiased.h, include/pa_value.h, include/pa_vbool.h, include/pa_vcframe.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vint.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/pa_array.C, main/pa_cframe.C, main/pa_common.C, main/pa_exception.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/pa_value.C, main/pa_vclass.C, main/pa_wcontext.C: sources header * src/main/pa_request.C: auto.. * src/: include/pa_request.h, main/compile.C, main/compile.y, main/pa_request.C: auto tree0 * src/: include/core.h, include/pa_request.h, main/compile.y, main/core.C, main/pa_request.C: names to core.C * src/: include/core.h, include/pa_common.h, include/pa_pool.h, include/pa_request.h, main/core.C, main/execute.C, main/pa_common.C, main/pa_request.C: root auto.p loaded * src/: include/code.h, include/pa_request.h, include/pa_vint.h, include/pa_vjunction.h, include/pa_vstring.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: optimized from OP_STRING+OP_WRITE to OP_STRING__WRITE * src/: include/pa_request.h, main/execute.C, main/pa_request.C: @auto[] realised. auto.p scan togo * src/: include/pa_request.h, main/execute.C: autocalc code-junctions result now have names * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/pa_request.h, include/pa_string.h, include/pa_wcontext.h, main/compile.y, main/execute.C, main/pa_string.C, main/pa_wcontext.C: tainting 0 * src/classes/env.C: env:file/line * src/: include/core.h, include/pa_array.h, include/pa_hash.h, include/pa_request.h, include/pa_value.h, include/pa_vcframe.h, include/pa_vdouble.h, include/pa_vint.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_cframe.C, main/pa_request.C, main/pa_wcontext.C: const fight finished * src/include/pa_vclass.h: const fight to go * src/: classes/_env.h, classes/env.C, classes/root.C, include/pa_request.h, include/pa_vclass.h, main/core.C, main/main.dsp: env0 * src/: classes/_double.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/pa_request.h, include/pa_string.h, include/pa_types.h, include/pa_vcframe.h, include/pa_wcontext.h, main/core.C, main/main.dsp, main/pa_cframe.C, main/pa_string.C, main/pa_vclass.C, main/pa_wcontext.C: ^lang prepare0 2001-03-09 paf * src/: include/pa_vmframe.h, main/compile.C, main/execute.C: expr construct proper naming * src/: classes/_double.h, classes/_int.h, classes/_string.h, classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/code.h, include/pa_value.h, include/pa_vbool.h, include/pa_vdouble.h, include/pa_vint.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, main/compile.y, main/compile_tools.C, main/core.C, main/execute.C, main/main.dsp: Int and Double classes with ^int[] and ^double[]. fixed expr type * src/: classes/root.C, include/pa_request.h, main/execute.C: ^string.length[] 2001-03-08 paf * src/include/pa_vmframe.h: fixed forgotten method_frame my check * src/: include/pa_vclass.h, include/pa_vstring.h, include/pa_wcontext.h, main/compile.y, main/core.C, main/execute.C, main/main.dsp: dead end: vstring can't be derivated from vobject * src/: include/pa_vclass.h, include/pa_vhash.h, include/pa_vobject.h, include/pa_vstring.h, main/main.dsp: z * src/include/: pa_vclass.h, pa_vhash.h, pa_vobject.h: removes some remained clone conseqs * src/main/pa_vclass.C: that were ok... [vclass were out of vcs] * src/main/pa_vclass.C: wow! vclass were out of vcs * src/: include/pa_bool.h, include/pa_double.h, include/pa_value.h, include/pa_vbool.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, main/compile.y, main/compile_tools.C, main/execute.C: withoud cloning. didn't need it actually, params got passed from out unnamed ewpool * src/: include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vobject.h, include/pa_vunknown.h, main/compile.y: cloning dead end * src/: include/pa_bool.h, include/pa_double.h, include/pa_valiased.h, include/pa_value.h, include/pa_vbool.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, main/compile.y, main/compile_tools.C, main/execute.C, main/main.dsp, main/pa_value.C: value.cloning so to give params proper names * src/main/pa_wcontext.C: z * src/: include/pa_vmframe.h, main/execute.C: added names to unknown values in get_element and unfilled params. removed wrong name change in get_element * src/main/execute.C: z * src/main/execute.C: fixed problems calling operators in constructors * src/: classes/root.C, include/pa_stack.h, main/execute.C: detected problems calling operators in constructors * src/: classes/root.C, include/pa_request.h, main/execute.C: autocalc def to string * src/: classes/root.C, include/pa_request.h, include/pa_value.h, include/pa_vbool.h, include/pa_wwrapper.h, main/execute.C: ^if 0 * src/classes/root.C: added root.c * src/: include/pa_request.h, include/pa_value.h, include/pa_vcframe.h, include/pa_vmframe.h, include/pa_wcontext.h, main/compile.C, main/compile.y, main/core.C, main/execute.C, main/pa_cframe.C, main/pa_wcontext.C: 'if' just compiled * src/: include/pa_vbool.h, include/pa_vdouble.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vstring.h, include/pa_wcontext.h, main/execute.C, main/pa_wcontext.C: z * src/: include/pa_value.h, include/pa_vmframe.h, main/compile.y, main/core.C, main/execute.C, main/main.dsp: z. detected probs with parameter names in operator methods * src/main/compile.y: minor renamings in .y * src/: include/pa_request.h, main/compile.C, main/compile.y, main/core.C, main/main.dsp: introducing ROOT_CLASS. it's default @BASE. changed 'RUN' assignment mech * src/main/execute.C: z * src/: include/code.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: made class: dynamic, not static. so to enable runtime ^use * src/main/compile.y: minor grammar bug with OP_CODE__STORE_PARAM * src/: include/code.h, main/compile.y, main/compile_tools.C, main/execute.C: joined 2 into one OP_CODE__STORE_PARAM * src/main/execute.C: root root in code-junction 2001-03-07 paf * src/include/: pa_value.h, pa_vclass.h, pa_vhash.h, pa_vmframe.h, pa_vobject.h, pa_wwrapper.h: const in Value.get_element * src/: include/pa_stack.h, include/pa_value.h, include/pa_vclass.h, include/pa_vhash.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_wwrapper.h, main/execute.C: fixed rwcontext of {} params up * src/main/: compile.y, compile_tools.h: ^func(params) * src/main/compile.y: .y priorities syntax shaped up a bit * src/: include/pa_hash.h, include/pa_value.h, include/pa_vhash.h, include/pa_vunknown.h, main/compile.y, main/execute.C, main/pa_hash.C: expr def in -f * src/main/: compile.y, execute.C: expr calls * src/main/: compile.y, execute.C, pa_string.C: bug in string.cmp fixed * src/main/compile.y: expr quoted code * src/main/: compile.y, execute.C: expr whitespace solved. added "" support0 * src/main/compile.y: expr string comparisons 0 * src/: include/pa_string.h, main/compile.y, main/execute.C, main/pa_string.C: just compiled lt&co * src/main/execute.C: ^var.menu{$field} problem detected. that $field not a $var.field 2001-03-06 paf * src/main/compile.y: .y expr visible-shorter * src/: include/code.h, main/compile.y, main/execute.C: 1 problems with skipping whitespace in yylex fixed 2 xors: # bitwise ## logical * src/: include/pa_vstring.h, main/compile.y: problems with skipping whitespace in yylex * src/include/pa_vbool.h: forgot this * src/: include/code.h, main/compile.y, main/execute.C: without string ops in expressions 0 * src/: include/pa_value.h, include/pa_vdouble.h, include/pa_vstring.h, include/pa_vunknown.h, main/compile.y, main/execute.C, main/main.dsp: !~ * src/: include/pa_vcframe.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: +-*/ * src/: include/pa_vdouble.h, main/compile.y, main/compile_tools.C, main/compile_tools.h: grammar-1.1 $a(z) $a=0 * src/: include/pa_value.h, include/pa_vdouble.h, main/compile.y, main/execute.C: expr grammar-1 2*2=4.000000 :) * src/main/compile.y: expr grammar-1 * src/main/compile.y: expr lexx1 * src/main/: compile.y, execute.C, main.dsp: z * src/: include/code.h, include/pa_valiased.h, include/pa_value.h, include/pa_vdouble.h, include/pa_vstring.h, main/compile.y, main/execute.C: expr lex0 exec-1 * src/: include/code.h, main/compile.y, main/compile_tools.h: g 2001-02-26 paf * src/main/compile.y: max_string in yyerror bug fix 2001-02-25 paf * src/: include/pa_value.h, include/pa_vmframe.h, include/pa_wcontext.h, main/execute.C: VAliased3 * src/include/: pa_value.h, pa_vmframe.h: VAliased2 * src/main/execute.C: VAliased1 * src/: include/pa_request.h, include/pa_value.h, include/pa_vmframe.h, include/pa_wcontext.h, main/execute.C: VAliased0 * src/: include/pa_pool.h, include/pa_request.h, include/pa_value.h, include/pa_vclass.h, include/pa_vmframe.h, include/pa_vobject.h, main/core.C, main/execute.C, main/main.dsp: VAliased just compiled * src/: include/pa_pool.h, include/pa_value.h, include/pa_vclass.h, include/pa_vobject.h, main/execute.C: alias dead end * src/: include/pa_value.h, include/pa_vclass.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/execute.C, main/main.dsp: no not get fields into interm VFielded class. fields & staticfields 1 * src/: include/pa_vcframe.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/core.C, main/execute.C, main/main.dsp: would now get fields into interm VFielded class * src/: include/pa_hash.h, include/pa_value.h, include/pa_vclass.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_wcontext.h, main/compile.y, main/core.C, main/execute.C, main/main.dsp, main/pa_hash.C, main/pa_value.C, main/pa_wcontext.C: virtuals2 * src/main/compile.y: : 1 * src/main/compile.y: rethought to $class:static.field.subfield * src/: include/pa_vclass.h, main/compile.y, main/execute.C: $class:element * src/: include/pa_value.h, include/pa_vmframe.h, include/pa_wwrapper.h, main/compile.y, main/execute.C, main/pa_wcontext.C: before execute class calls rewrite * src/: include/pa_request.h, main/compile.C, main/core.C: default name RUN, also alias * src/main/compile.y: escaping bug * src/: include/pa_request.h, include/pa_value.h, include/pa_vobject.h, main/compile.y, main/compile_tools.h, main/core.C, main/execute.C, main/pa_common.C: vobject1 * src/: include/code.h, include/pa_value.h, include/pa_vclass.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_wwrapper.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: ^class:method() just compiled 2001-02-24 paf * src/main/main.dsp: no bison -d * src/main/: compile.y, compile_tools.h: use0 line no on 'undef class' err msg wrong * src/main/compile.y: z * src/main/: compile.y, core.C: yylex need some @special lines adj * src/: include/pa_request.h, include/pa_vclass.h, main/compile.C, main/compile.y, main/compile_tools.h, main/core.C: modules0 * src/: include/pa_vclass.h, main/core.C: z * src/: include/pa_value.h, include/pa_vclass.h, include/pa_vobject.h, main/main.dsp: vobject00 * src/main/pa_array.C: minor bug in expanding very small arrays. 60% from 1 were 0 * src/: include/pa_value.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/execute.C, main/pa_value.C: it works as bad as you've named it: wcontext.value() was not a perfect idea * src/main/execute.C: codeframe1 * src/: include/pa_value.h, include/pa_vcframe.h, include/pa_vclass.h, include/pa_vframe.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/execute.C, main/main.dsp, main/pa_cframe.C, main/pa_wcontext.C: codeframe just compiled * src/: include/pa_vframe.h, main/compile.y: found junction ideology @: ^x{$a()) must construct current wcontext element, so smart wcontext handling needed * src/main/compile.y: fixed grammar bugs in constructor/params klinch * src/main/: compile.y, execute.C: fixed empty constructor optimized empty case. failed on calls - produced empty string param * src/main/compile.y: fixed last \n macrotemplate strip bug * src/: include/code.h, include/pa_request.h, include/pa_value.h, include/pa_vclass.h, include/pa_vframe.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C: code junctions0. something wrong with last \n macrotemplate strip * src/: include/pa_value.h, main/compile.C, main/core.C, main/pa_value.C: minor error reporting format beautifyings * src/: include/pa_value.h, include/pa_vclass.h, include/pa_vframe.h, main/core.C, main/execute.C, main/pa_value.C: get_method RIP. junctions everywhere. call with junctions0 2001-02-23 paf * src/include/: pa_value.h, pa_vclass.h, pa_vframe.h, pa_wwrapper.h: lara came, can't work, sorry :( * src/main/: compile.y, execute.C, main.dsp: rethought some. before junction * src/: include/pa_vframe.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/core.C, main/execute.C, main/main.dsp, main/pa_value.C: call0 * src/: include/pa_hash.h, include/pa_value.h, include/pa_wcontext.h, main/core.C, main/execute.C, main/main.dsp, main/pa_hash.C: started call. store param, vframe done * src/include/pa_wcontext.h: z * src/main/: compile.y, compile_tools.C, compile_tools.h: fixed wrong grammar in complex constructor case * src/main/: compile.y, execute.C: empty constructor bug fixed * src/main/execute.C: with result rwpool * src/: include/pa_value.h, main/core.C, main/execute.C, main/main.dsp: value named * src/: include/pa_value.h, include/pa_vstring.h, main/execute.C: strign 2 value in 2 places in execute * src/: include/pa_value.h, include/pa_wcontext.h, main/compile.y, main/execute.C, main/main.dsp, main/pa_array.C: auto VHash on wcontext.put_element when wcontext fvalue==0 2001-02-22 paf * src/: include/pa_hash.h, include/pa_value.h, include/pa_vclass.h, include/pa_vhash.h, include/pa_vstring.h, include/pa_wcontext.h, main/execute.C, main/main.dsp: auto VHash in pa.th.cre.at.e * src/: include/pa_wcontext.h, main/compile.y, main/execute.C: erroreos checkout * src/: include/pa_request.h, main/compile.y: $self.put(val) * src/: include/pa_array.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_array.C: $self.get * src/main/: compile.C, compile.y, compile_tools.C: z * src/main/compile.y: $: wasn't finished - $:sdf(sdf) troubled a bit. finished now. * src/main/compile.y: $: finished * src/main/: compile.C, compile.y, execute.C: started : with $a.$:f * src/: include/code.h, main/compile_tools.C, main/compile_tools.h, main/execute.C: OP_STRING better then some xxx _VALUE * src/: include/code.h, include/pa_vstring.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: string to vstring it .y all * src/: include/pa_request.h, include/pa_stack.h, include/pa_wcontext.h, main/execute.C: z about to vstring it .y all * src/main/: compile.C, core.C, execute.C, pa_string.C: more precise parse error line:col * src/: include/pa_pool.h, include/pa_vclass.h, main/core.C, main/pa_hash.C, main/pa_pool.C: TRY... * src/: include/pa_exception.h, include/pa_pool.h, include/pa_request.h, include/pa_value.h, include/pa_wcontext.h, main/compile.C, main/compile.y, main/compile_tools.C, main/core.C, main/pa_array.C, main/pa_exception.C, main/pa_hash.C, main/pa_pool.C, main/pa_string.C, main/pa_table.C: removed exception from request * src/: include/pa_vstring.h, main/compile.C, main/core.C: added some forgotten * src/: include/code.h, include/pa_value.h, include/pa_vclass.h, include/pa_wcontext.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp: iiieeyys! get/put simple vars to VClass works0 * src/: include/pa_array.h, include/pa_wcontext.h, main/pa_string.C: in process, but found that exceptions are too global * src/: include/code.h, include/pa_string.h, include/pa_value.h, include/pa_vclass.h, include/pa_wcontext.h, main/compile.y, main/execute.C, main/pa_string.C: write_value write_string 0 it seems wcontext must write strings regardles of fvalue!=0 2001-02-21 paf * src/main/execute.C: tired :) * src/main/: compile.C, compile.y, execute.C: store0 * src/: include/compile.h, include/execute.h, include/pa_array.h, include/pa_request.h, include/pa_stack.h, include/pa_vclass.h, include/pa_wcontext.h, main/compile.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_request.C: get put -1 [just compiled] * src/: include/core.h, include/pa_context.h, include/pa_request.h, include/pa_vclass.h, include/pa_wcontext.h, main/core.C, main/main.dsp, main/pa_request.C: request core methods0 * src/: include/compile.h, include/pa_array.h, main/compile.C, main/compile.y, main/execute.C: MAIN_METHOD_NAME ready to write execute * src/: include/pa_exception.h, include/pa_value.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h: .y methods and one_big_piece. now compile returns array * src/main/compile.y: more straightforward yylex[end] * src/: include/pa_string.h, include/pa_types.h, main/pa_string.C: string.operator==(char*) * src/: include/execute.h, include/pa_array.h, include/pa_value.h, main/execute.C, main/pa_array.C: after array.const get wonders * src/include/: compile.h, pa_context.h, pa_hash.h, pa_request.h, pa_string.h, pa_value.h: struck with const array.gets * src/main/: execute.C: z * src/main/: compile.y, execute.C: z * src/main/: compile.C, compile.y, compile_tools.h: error processing in eval & yyerror so it wouldn't cause memleaks. * src/main/: compile.C, compile.y: failed to add absolute precies parse error positions. leaving RIGHTMOST position as @file[line:col] * src/: include/compile.h, main/compile.C, main/compile.y, main/compile_tools.h: line numbers needed. would add them to .y now internally. externally it's not as precise as needed * src/: include/code.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp: .y to c++ hierarchy output fix. compiler works ok 2001-02-20 paf * src/main/: compile.C, compile.y, compile_tools.C, compile_tools.h, execute.C, main.dsp: nestage probs, eof yylex not perfect * src/: include/code.h, include/compile.h, include/execute.h, include/pa_array.h, include/pa_common.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_string.C, main/pa_table.C: bison[yacc] first time compiled. execute=dump for now * src/main/core.C: core rewrite using yacc investigations now will be compile[yacc]/execute[opcodes] 2001-02-15 paf * src/: include/pa_value.h, main/core.C: maybe a-la yacc those ifs rewrite as turing machine? for it seems it would be it's too many ifs with this syntax now 2001-02-14 paf * src/main/core.C: get_params 1 * src/main/core.C: get_params figured ^menu[UNEVALUATED unthinked :( ] * src/main/core.C: varios breaks * src/main/core.C: get names 3 * src/main/core.C: get names 2 * src/main/core.C: get names 1 * src/: include/pa_string.h, main/core.C, main/pa_string.C: get names 0 * src/: include/pa_value.h, main/core.C, main/pa_string.C: process text repassing2 operator static vars * src/: include/pa_context.h, include/pa_string.h, main/core.C, main/pa_string.C: process text repassing * src/: include/pa_context.h, include/pa_value.h, main/core.C: module:calls changes 2001-02-13 paf * src/: include/pa_context.h, include/pa_value.h, main/core.C: ^class:calls[] started * src/: include/pa_value.h, main/core.C: z * src/main/core.C: operators : and self. prefixes * src/main/core.C: z * src/: include/pa_string.h, main/pa_string.C: String_iterator tested * src/: include/pa_string.h, main/pa_string.C: String_iterator optimized * src/main/pa_string.C: String_iterator::skip_to optimized a bit. would change privates to better support optimization * src/: include/pa_string.h, main/pa_string.C: String_iterator::skip_to todo:optimize 2001-02-12 paf * src/: include/pa_string.h, main/core.C, main/pa_string.C: started String_iterator * src/: include/pa_context.h, include/pa_value.h, main/core.C: some comments * src/: include/pa_context.h, include/pa_value.h, main/core.C: get self/methodref joined 2001-02-11 paf * src/: include/pa_context.h, include/pa_value.h, main/core.C, main/main.dsp: core started. core.C, context&value .h * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/main.dsp, main/pa_array.C, main/pa_hash.C, main/pa_pool.C, main/pa_string.C: :pooled 2001-01-30 paf * src/: Makefile.am, main/Makefile.am, targets/Makefile.am: .am comments * src/: include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_pool.C: moved pa_pool.C to be target specific * src/: include/pa_exception.h, include/pa_pool.h, include/pa_table.h, main/pa_exception.C, main/pa_table.C: minor * to & changes * src/: include/pa_exception.h, include/pa_pool.h, include/pa_request.h, include/pa_table.h, main/pa_array.C, main/pa_exception.C, main/pa_pool.C, main/pa_table.C: error re-associated. that's much better even removed 'die' necessety * src/: include/pa_error.h, include/pa_exception.h, include/pa_pool.h, include/pa_request.h, main/main.dsp, main/pa_error.C, main/pa_exception.C, main/pa_pool.C, targets/Makefile.am: lowered targets/parser into subdir, added parser_Pool(Pool) failed to add. would think.. * src/: include/pa_error.h, include/pa_hash.h, include/pa_string.h, include/pa_table.h, main/pa_error.C, main/pa_hash.C, main/pa_string.C, main/pa_table.C: Table more like C++ style hence lots of 'const' * src/: include/pa_error.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, main/pa_error.C, main/pa_table.C: Error fixed 2001-01-29 paf * src/: include/pa_array.h, include/pa_common.h, include/pa_error.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, main/Makefile.am, main/pa_array.C, main/pa_common.C, main/pa_error.C, main/pa_hash.C, main/pa_table.C: added forgotten * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/Makefile.am, main/main.dsp, main/pa_array.C, main/pa_hash.C, main/pa_string.C, main/pa_table.C: Request Error Table * src/: include/pa_pool.h, main/pa_array.C: tested - decision "no templates" * src/: include/pa_array.h, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_array.C: templates failed no template specializations [VC6], no library auto instantation [VC6, GNU c++ 2.95.2-6 from latest cygwin] * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/main.dsp, main/pa_array.C, main/pa_string.C, main/pa_table.C: Table started would test template Array now * src/: include/pa_pool.h, include/pa_string.h, main/pa_string.C: String originating * src/: include/pa_hash.h, include/pa_pool.h, include/pa_threads.h, main/pa_hash.C: made local Hash-es not thread safe=quicker by SYNCHRONIZED(thread_safe) * src/include/: pa_array.h, pa_hash.h, pa_string.h: moved .h public parts to top * src/: include/pa_hash.h, include/pa_threads.h, main/pa_hash.C, main/pa_threads.C: decided on one global_mutex, like PHP as I can see: needed only in global Hash now, made Hash:: put/get SYNCHRONIZED * src/: include/pa_hash.h, include/pa_threads.h, main/main.dsp, main/pa_threads.C: added pa_threads Mutex * src/include/pa_hash.h: some comments * src/: main/pa_array.C, include/pa_array.h, include/pa_pool.h: Array& operator += (Array& src) * src/main/pa_array.C: expand not convinient, would rewrite * src/: include/pa_array.h, main/pa_array.C: Array::operator += (Array& src) rethought, would change now 2001-01-27 paf * src/: include/pa_array.h, main/pa_array.C: array [] with chunk caching * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_array.C, main/pa_string.C: array cache rethought to chunk caching * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/main.dsp, main/pa_array.C, main/pa_hash.C, main/pa_string.C: Array 0 * src/main/pa_string.C: String::operator == * src/main/pa_hash.C: String(&String) * src/main/pa_hash.C: added pa_hash.C [forgotten] * src/: include/pa_hash.h, include/pa_string.h, include/pa_types.h, main/main.dsp, main/pa_string.C: uint, and added pa_types & pa_hash[forgotten] 2001-01-26 paf * src/: include/pa_pool.h, include/pa_string.h, main/pa_string.C: removed templates [vc++ suxx] * src/: include/pa_pool.h, include/pa_string.h, main/main.dsp, main/pa_pool.C, main/pa_string.C: templates in VC++ suxx. * src/include/: pa_pool.h, pa_string.h: pa_pool split * src/main/: main.dsp, pa_string.C: $Id: ChangeLog,v 1.92 2013/10/29 16:21:27 moko Exp $ check * src/: main/pa_pool.C, main/pa_string.C, include/pa_pool.h: $Id: ChangeLog,v 1.92 2013/10/29 16:21:27 moko Exp $ check * src/: include/pa_pool.h, main/pa_string.C: String prealloc & dynamic row_count * src/: Makefile.am, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_pool.C, main/pa_string.C, targets/Makefile.am: Initial revision * src/: Makefile.am, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_pool.C, main/pa_string.C, targets/Makefile.am: creating parser3 module parser-3.4.3/src/000755 000000 000000 00000000000 12234223575 013710 5ustar00rootwheel000000 000000 parser-3.4.3/etc/000755 000000 000000 00000000000 12234223575 013674 5ustar00rootwheel000000 000000 parser-3.4.3/README000644 000000 000000 00000000564 12232042163 013774 0ustar00rootwheel000000 000000 Parser3 website is http://www.parser.ru/ Read the documentation here at http://www.parser.ru/docs/ Check the ChangeLog to keep track of progresses. Check the INSTALL to find out how to compile and install Parser3. SQL drivers are in separate modules. Report bugs to mailbox@parser.ru or on http://www.parser.ru/forum/ $Id: README,v 1.5 2013/10/23 21:49:39 moko Exp $ parser-3.4.3/configure.in000644 000000 000000 00000030654 12234222474 015437 0ustar00rootwheel000000 000000 dnl Autoconf initialisation AC_PREREQ(2.59) AC_INIT(parser, 3.4.3) AC_CONFIG_SRCDIR(README) dnl Automake Initialisation AM_INIT_AUTOMAKE dnl Expand srcdir P3S=`cd $srcdir/src ; pwd` AC_SUBST(P3S) dnl Parser version update AC_CANONICAL_HOST AC_DEFINE_UNQUOTED(PARSER_VERSION,"$VERSION (compiled on $host)",parser version) AC_SUBST(host_os) case $host_os in *cygwin* ) AC_DEFINE(CYGWIN,,using cygwin building environment);; esac dnl Checks for programs AC_PROG_INSTALL AC_PROG_AWK AC_PROG_YACC if test "$YACC" != "bison -y"; then AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON) else AC_MSG_CHECKING(bison version) oldIFS=$IFS; IFS=. set `bison -V | sed -e 's/^GNU Bison version //' -e 's/^bison (GNU Bison) //' -e 's/$/./'` IFS=$oldIFS if test "$1" = "1" -a "$2" -lt "25"; then AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).) fi AC_MSG_RESULT($1.$2 (ok)) fi AC_PROG_CXX AC_PROG_CC dnl most tests should be compiled with C compiler [especially qsort test] AC_LANG_C dnl Dll extension AC_MSG_CHECKING(for dynamic-link library extension) case "$host_os" in *cygwin* ) dll_extension=dll;; * ) dll_extension=so esac AC_MSG_RESULT($dll_extension) AC_SUBST(dll_extension) dnl Misc arguments AC_ARG_WITH(build-warnings, [ --with-build-warnings to enable build-time compiler warnings if gcc is used], AC_MSG_WARN(enabling compiler warnings) CXXFLAGS="$CXXFLAGS -W -Wall -Wstrict-prototypes -Wmissing-prototypes" ) AC_ARG_WITH(assertions, [ --with-assertions to enable assertions], AC_MSG_WARN(enabling assertions) , AC_DEFINE(NDEBUG,,assertions disabled) ) AC_ARG_WITH(sjlj-exceptions,[ --with-sjlj-exceptions enable simple 'throw' from dynamic library], AC_DEFINE(PA_WITH_SJLJ_EXCEPTIONS,,one can throw from dynamic library) ) dnl Safe mode argument AC_ARG_ENABLE(safe-mode, [ --disable-safe-mode to enable reading and executing files belonging to group+user other then effective], [ SAFE_MODE=$enableval ] ) if test "$SAFE_MODE" = "no"; then AC_MSG_WARN(enabling reading of files belonging to group+user other then effective) else AC_DEFINE(PA_SAFE_MODE,,disabled reading of files belonging to group+user other then effective) fi dnl Disable execs argument AC_ARG_ENABLE(execs, [ --disable-execs to disable any execs (file::exec, file::cgi, unix mail:send)], [ if test "$enableval" = "no"; then AC_MSG_WARN(disabling file execs) AC_DEFINE(NO_PA_EXECS,,pa_exec disabled) fi ] ) dnl String stream argument AC_ARG_ENABLE(stringstream, [ --disable-stringstream to disable stringstream usage. when disabled table.save use more memory but it's safer on freebsd 4.x], [ if test "$enableval" = "no"; then AC_MSG_WARN(disabling stringstream usage) AC_DEFINE(NO_STRINGSTREAM,,stringstream disabled) fi ] ) dnl GC argument AC_ARG_WITH(gc,[ --with-gc[=D] D is the directory where Boehm garbage collecting library is installed],[ GC=$withval GC_LIBS="$GC/libgc.la" if test -f $GC_LIBS; then GC_OK="yes" else GC_LIBS="-L$GC -lgc" fi if test "$GC" = "yes"; then GC="" GC_LIBS="-lgc" AC_MSG_WARN([--with-gc value was not specified, hoping linker would find it]) fi ],[ GC_LIBS="-lgc" AC_MSG_WARN([--with-gc was not specified, hoping linker would find it]) ]) if test -z "$GC_OK"; then AC_MSG_CHECKING(for libgc) SAVE_LIBS=$LIBS LIBS="$LIBS $GC_LIBS" AC_TRY_LINK([ extern int GC_dont_gc; ],[ GC_dont_gc=0; ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$GC"; then AC_MSG_ERROR(please specify path to libgc: --with-gc=D) else AC_MSG_ERROR($GC does not seem to be valid libgc installation directory) fi ) LIBS=$SAVE_LIBS fi AC_SUBST(GC_LIBS) dnl PCRE argument AC_ARG_WITH(pcre,[ --with-pcre=D D is the directory where PCRE library is installed],[ PCRE=$withval PCRE_INCLUDES="-I$PCRE/include" PCRE_LIBS="$PCRE/lib/libpcre.la" if test -f $PCRE/include/pcre.h -a -f $PCRE_LIBS; then PCRE_OK="yes" else PCRE_LIBS="-L$PCRE -lpcre" fi if test "$PCRE" = "yes"; then PCRE="" PCRE_LIBS="-lpcre" PCRE_INCLUDES="" AC_MSG_WARN([--with-pcre value was not specified, hoping linker would find it]) fi ],[ PCRE_LIBS="-lpcre" PCRE_INCLUDES="" AC_MSG_WARN([--with-pcre was not specified, hoping linker would find it]) ]) if test -z "$PCRE_OK"; then AC_MSG_CHECKING(for prce) SAVE_LIBS=$LIBS LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES" AC_TRY_LINK([ #include ],[ const char *v=pcre_version(); ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$PCRE"; then AC_MSG_ERROR(please specify path to PCRE: --with-pcre=D) else AC_MSG_ERROR($PCRE does not seem to be valid PCRE installation directory) fi ) LIBS=$SAVE_LIBS fi AC_SUBST(PCRE_INCLUDES) AC_SUBST(PCRE_LIBS) dnl XML/XSLT argument AC_ARG_WITH(xml,[ --with-xml=D D is the directory where Gnome XML libraries are installed],[ XML=$withval XML_LIBS="-lxml2 -lxslt -lexslt" if test -z "$XML" -o "$XML" = "yes"; then XML="" XML_INCLUDES="-I/usr/include/libxml2" AC_MSG_WARN([--with-xml value was not specified, hoping linker would find it]) else XML_INCLUDES="-I$XML/include -I$XML/include/libxml2" if test -f $XML/include/libxslt/xslt.h -a -f $XML/lib/libxml2.la \ -a -f $XML/lib/libxslt.la -a -f $XML/lib/libexslt.la; then XML_LIBS="$XML/lib/libxml2.la $XML/lib/libxslt.la $XML/lib/libexslt.la" XML_OK="yes" fi fi if test -z "$XML_OK"; then AC_MSG_CHECKING(for xml) SAVE_LIBS=$LIBS LIBS="$LIBS $XML_LIBS $XML_INCLUDES" AC_TRY_LINK([ #include ],[ const char *v=xsltEngineVersion; ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$XML"; then AC_MSG_ERROR(please specify path to Gnome XML libraries: --with-xml=D) else AC_MSG_ERROR($XML does not seem to be valid Gnome XML installation directory) fi ) LIBS=$SAVE_LIBS fi AC_DEFINE(XML,,xml-abled parser) ]) AC_SUBST(XML_INCLUDES) AC_SUBST(XML_LIBS) dnl Mail receive argument AC_ARG_WITH(mailreceive,[ --with-mailreceive=D is the directory where Gnome MIME library is installed],[ MIME=$withval GLIB="glib-2.0" GMIME="gmime-2.4" if test -z "$MIME" -o "$MIME" = "yes"; then MIME="" MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null` MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null` AC_MSG_WARN([--with-mailreceive value was not specified, hoping linker would find Gnome MIME library]) else MIME_INCLUDES="-I$MIME/include/$GMIME" MIME_LIBS="-l$GMIME" if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then MIME_LIBS="$MIME/lib/lib$GMIME.la" if test -f $MIME/lib/lib$GLIB.la; then MIME_INCLUDES="$MIME_INCLUDES -I$MIME/include/$GLIB -I$MIME/lib/$GLIB/include" else GLIB_INCLUDES=`pkg-config --cflags $GLIB 2>/dev/null` MIME_INCLUDES="$MIME_INCLUDES $GLIB_INCLUDES" fi MIME_OK="yes" fi fi if test -z "$MIME_OK"; then AC_MSG_CHECKING(for mime) SAVE_LIBS=$LIBS LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES" AC_TRY_LINK([ #include ],[ guint v=gmime_major_version; ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$MIME"; then AC_MSG_ERROR(please specify path to Gnome MIME library: --with-mailreceive=D) else AC_MSG_ERROR($MIME does not seem to be valid Gnome MIME installation directory) fi ) LIBS=$SAVE_LIBS fi AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received) ]) AC_SUBST(MIME_INCLUDES) AC_SUBST(MIME_LIBS) dnl Sendmail argument AC_ARG_WITH(sendmail,[ \"--with-sendmail=COMMAND\" forces this command to send mail. example: \"--with-sendmail=/usr/sbin/sendmail -t\" (makes parser ignore user-defined sendmail commands)], AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands) ) dnl Apache module argument AC_ARG_WITH(apache,[ --with-apache=FILE FILE is the full path for APXS builds apache DSO module using apxs],[ APXS=$withval if test -z "$APXS" -o "$APXS" = "yes"; then APXS=`which apxs 2>/dev/null` if test -z "$APXS"; then APXS=`which apxs2 2>/dev/null` fi fi APACHE=`$APXS -q TARGET 2>/dev/null` if test -z "$APACHE"; then AC_MSG_ERROR($APXS does not seem to be valid apache apxs utility path) fi APACHE_MAIN_INC=`$APXS -q INCLUDEDIR` APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null` APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC" APACHE_CFLAGS=`$APXS -q CFLAGS` ]) AC_SUBST(APACHE) AC_SUBST(APACHE_INC) AC_SUBST(APACHE_CFLAGS) AM_CONDITIONAL(COMPILE_APACHE_MODULE, test -n "$APACHE") dnl Enable building of the convenience library LT_CONFIG_LTDL_DIR(src/lib/ltdl) LT_INIT(dlopen win32-dll no-pic) LTDL_INIT dnl Checks for typedefs, structures, and compiler characteristics AC_C_BIGENDIAN( AC_DEFINE(PA_BIG_ENDIAN,,compile for sparc processor) , AC_DEFINE(PA_LITTLE_ENDIAN,,compile for intel processor or compatible) , AC_MSG_ERROR(word endianness not determined for some obscure reason) ) AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_STRUCT_DIRENT_D_TYPE dnl Checks for C header files AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h strings.h inttypes.h stdint.h unistd.h) AC_CHECK_HEADERS(assert.h limits.h ctype.h math.h process.h stdarg.h setjmp.h signal.h) AC_CHECK_HEADERS(errno.h dirent.h fcntl.h io.h sys/file.h sys/locking.h sys/select.h sys/resource.h sys/wait.h) AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h netdb.h) dnl Checks for libraries case "$host" in *-freebsd4*) AC_DEFINE(FREEBSD4,,FreeBSD4X target platform) ;; *-sunos5.6* | *-solaris2.6*) AC_CHECK_LIB(xnet, main) ;; *-sunos5* | *-solaris2*) AC_CHECK_LIB(socket, main) AC_CHECK_LIB(nsl, main) ;; *-nec-sysv4*) AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(socket, socket) ;; *-cygwin*) AC_DEFINE(WIN32,,Windows32 target platform) ;; esac AC_CHECK_LIB(m, sin) AC_CHECK_LIB(crypt, crypt) dnl Checks for functions AC_CHECK_FUNCS(flock _locking fcntl lockf ftruncate fchmod) AC_CHECK_FUNCS(getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv) dnl on some linux[seen on 2.4] it's a macro PA_CHECK_SIGSETJMP dnl see comment above AC_LANG_PUSH(C++) PA_CHECK_MATH_FUNCS_ONE_ARG(trunc round sign) AC_LANG_POP dnl We require qsort(3) AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.])) dnl For correct mail receiving we need to know local offset from GMT dnl it be timezone+(daylight?60*60*sign(timezone):0) dnl or it can be tm.tm_gmtoff or it can be tm.tm_tzadj AC_MSG_CHECKING(for timezone variable) AC_TRY_COMPILE([#include ], [time_t test=timezone;], AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for daylight variable) AC_TRY_COMPILE([#include ], [int test=daylight;], AC_DEFINE(HAVE_DAYLIGHT) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for tm_gmtoff in struct tm) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff=0;], AC_DEFINE(HAVE_TM_GMTOFF) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for tm_tzadj in struct tm) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj=0;], AC_DEFINE(HAVE_TM_TZADJ) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) dnl Output header and makefiles AH_TEMPLATE([HAVE_DAYLIGHT],[Define if you have daylight external variable in ]) AH_TEMPLATE([HAVE_TIMEZONE],[Define if you have timezone external variable in ]) AH_TEMPLATE([HAVE_TM_GMTOFF],[Define if you have tm_gmtoff member of tm structure in ]) AH_TEMPLATE([HAVE_TM_TZADJ],[Define if you have tm_tzadj member of tm structure in ]) AM_CONFIG_HEADER(src/include/pa_config_auto.h) AC_OUTPUT( Makefile src/Makefile src/types/Makefile src/classes/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/lib/Makefile src/lib/gd/Makefile src/lib/smtp/Makefile src/lib/gc/Makefile src/lib/gc/include/Makefile src/lib/pcre/Makefile src/lib/cord/Makefile src/lib/cord/include/Makefile src/lib/cord/include/private/Makefile src/lib/md5/Makefile src/lib/sdbm/Makefile src/lib/sdbm/pa-include/Makefile src/lib/json/Makefile src/lib/memcached/Makefile src/lib/curl/Makefile src/targets/Makefile src/targets/cgi/Makefile src/targets/apache/Makefile src/targets/isapi/Makefile etc/Makefile etc/parser3.charsets/Makefile bin/Makefile bin/auto.p.dist) parser-3.4.3/parser3.sln000644 000000 000000 00000025123 12174045136 015217 0ustar00rootwheel000000 000000 Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApacheModuleParser3", "src\targets\apache\ApacheModuleParser3.vcproj", "{61FD304C-2949-4400-845F-0B27CD088547}" ProjectSection(ProjectDependencies) = postProject {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} = {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} {09C0531B-9B8F-443A-A16B-BD9134712613} = {09C0531B-9B8F-443A-A16B-BD9134712613} {21593B27-7994-49DC-A4A7-993DD8849862} = {21593B27-7994-49DC-A4A7-993DD8849862} {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} = {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} {EB565D67-9950-4F5E-926F-63DAC8F7F314} = {EB565D67-9950-4F5E-926F-63DAC8F7F314} {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} = {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} {B95DF5BC-85D8-4B4C-AF72-113B99592D38} = {B95DF5BC-85D8-4B4C-AF72-113B99592D38} {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} = {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} = {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} = {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} = {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} = {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} = {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApacheModuleParser3Core", "src\targets\apache\ApacheModuleParser3Core.vcproj", "{CB915CEB-DC1A-40F6-9CA9-3B5212C0497D}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "classes", "src\classes\classes.vcproj", "{B79D9D3D-DFD7-4D48-91AA-484378D5E76C}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cord", "src\lib\cord\cord.vcproj", "{74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnu", "gnu.vcproj", "{02438934-FA19-49DC-B5D1-2E9BA1CD0159}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ltdl", "src\lib\ltdl\ltdl.vcproj", "{EB565D67-9950-4F5E-926F-63DAC8F7F314}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "main", "src\main\main.vcproj", "{650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "md5", "src\lib\md5\md5.vcproj", "{2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parser3", "src\targets\cgi\parser3.vcproj", "{33B3FF55-1BB6-4F22-A448-04065AC10AFB}" ProjectSection(ProjectDependencies) = postProject {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} = {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} {09C0531B-9B8F-443A-A16B-BD9134712613} = {09C0531B-9B8F-443A-A16B-BD9134712613} {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} = {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} {21593B27-7994-49DC-A4A7-993DD8849862} = {21593B27-7994-49DC-A4A7-993DD8849862} {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} = {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} {EB565D67-9950-4F5E-926F-63DAC8F7F314} = {EB565D67-9950-4F5E-926F-63DAC8F7F314} {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} = {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} {B95DF5BC-85D8-4B4C-AF72-113B99592D38} = {B95DF5BC-85D8-4B4C-AF72-113B99592D38} {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} = {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} = {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} = {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parser3isapi", "src\targets\isapi\parser3isapi.vcproj", "{2E7BF3D9-C58C-4808-B786-494E7C5F9FE2}" ProjectSection(ProjectDependencies) = postProject {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} = {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} {09C0531B-9B8F-443A-A16B-BD9134712613} = {09C0531B-9B8F-443A-A16B-BD9134712613} {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} = {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} {21593B27-7994-49DC-A4A7-993DD8849862} = {21593B27-7994-49DC-A4A7-993DD8849862} {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} = {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} {EB565D67-9950-4F5E-926F-63DAC8F7F314} = {EB565D67-9950-4F5E-926F-63DAC8F7F314} {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} = {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} {B95DF5BC-85D8-4B4C-AF72-113B99592D38} = {B95DF5BC-85D8-4B4C-AF72-113B99592D38} {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} = {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} = {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} = {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types", "src\types\types.vcproj", "{09C0531B-9B8F-443A-A16B-BD9134712613}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdbm", "src\lib\sdbm\sdbm.vcproj", "{AE697E13-B86D-4408-B76D-EC54D2BEEFE0}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gd", "src\lib\gd\gd.vcproj", "{B95DF5BC-85D8-4B4C-AF72-113B99592D38}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smtp", "src\lib\smtp\smtp.vcproj", "{9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "src\lib\json\json.vcproj", "{21593B27-7994-49DC-A4A7-993DD8849862}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcached", "src\lib\memcached\memcached.vcproj", "{71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {61FD304C-2949-4400-845F-0B27CD088547}.Debug.ActiveCfg = Debug|Win32 {61FD304C-2949-4400-845F-0B27CD088547}.Release.ActiveCfg = Release|Win32 {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D}.Debug.ActiveCfg = Debug|Win32 {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D}.Release.ActiveCfg = Release|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Debug.ActiveCfg = Debug|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Debug.Build.0 = Debug|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Release.ActiveCfg = Release|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Release.Build.0 = Release|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Debug.ActiveCfg = Debug|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Debug.Build.0 = Debug|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Release.ActiveCfg = Release|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Release.Build.0 = Release|Win32 {02438934-FA19-49DC-B5D1-2E9BA1CD0159}.Debug.ActiveCfg = Debug|Win32 {02438934-FA19-49DC-B5D1-2E9BA1CD0159}.Release.ActiveCfg = Release|Win32 {02438934-FA19-49DC-B5D1-2E9BA1CD0159}.Release.Build.0 = Release|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Debug.ActiveCfg = Debug|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Debug.Build.0 = Debug|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Release.ActiveCfg = Release|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Release.Build.0 = Release|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Debug.ActiveCfg = Debug|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Debug.Build.0 = Debug|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Release.ActiveCfg = Release|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Release.Build.0 = Release|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Debug.ActiveCfg = Debug|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Debug.Build.0 = Debug|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Release.ActiveCfg = Release|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Release.Build.0 = Release|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Debug.ActiveCfg = Debug|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Debug.Build.0 = Debug|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Release.ActiveCfg = Release|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Release.Build.0 = Release|Win32 {2E7BF3D9-C58C-4808-B786-494E7C5F9FE2}.Debug.ActiveCfg = Debug|Win32 {2E7BF3D9-C58C-4808-B786-494E7C5F9FE2}.Release.ActiveCfg = Release|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Debug.ActiveCfg = Debug|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Debug.Build.0 = Debug|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Release.ActiveCfg = Release|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Release.Build.0 = Release|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Debug.ActiveCfg = Debug|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Debug.Build.0 = Debug|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Release.ActiveCfg = Release|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Release.Build.0 = Release|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Debug.ActiveCfg = Debug|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Debug.Build.0 = Debug|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Release.ActiveCfg = Release|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Release.Build.0 = Release|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Debug.ActiveCfg = Debug|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Debug.Build.0 = Debug|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Release.ActiveCfg = Release|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Release.Build.0 = Release|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Debug.ActiveCfg = Debug|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Debug.Build.0 = Debug|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Release.ActiveCfg = Release|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Release.Build.0 = Release|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Debug.ActiveCfg = Debug|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Debug.Build.0 = Debug|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Release.ActiveCfg = Release|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal parser-3.4.3/Makefile.am000644 000000 000000 00000000603 12234222474 015151 0ustar00rootwheel000000 000000 SUBDIRS = src etc bin ACLOCAL_AMFLAGS = -I src/lib/ltdl/m4 EXTRA_DIST = operators.txt parser3.sln gnu.vcproj buildall acsite.m4 commit: # trick to make 'make' happy at check out time # and avoid redundant remaking: aclocal+autoconf+automake cvs commit -m "no message" -f configure.in acsite.m4 aclocal.m4 Makefile.am Makefile.in configure src/include/pa_config_auto.h.in parser-3.4.3/acsite.m4000644 000000 000000 00000001705 12234222474 014633 0ustar00rootwheel000000 000000 # paf@design.ru # included in configure.in AC_DEFUN([PA_CHECK_MATH_FUNC_ONE_ARG],[ AC_MSG_CHECKING(for (maybe built-in) math function $1) AC_TRY_COMPILE([ #ifdef HAVE_MATH_H # include #endif ],[ double result=$1(1.6); ], [AC_MSG_RESULT(yes) $2], [AC_MSG_RESULT(no) $3]) ] ) AC_DEFUN([PA_CHECK_MATH_FUNCS_ONE_ARG],[ AC_FOREACH([AC_Func], [$1], [AH_TEMPLATE(AS_TR_CPP([HAVE_]AC_Func), [Define to 1 if you have the `]AC_Func[' (maybe built-in) math function function.])])dnl for pa_func in $1 do PA_CHECK_MATH_FUNC_ONE_ARG($pa_func, [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$pa_func]) $2)], [$3])dnl done ]) AC_DEFUN([PA_CHECK_SIGSETJMP],[ pa_func=sigsetjmp AC_MSG_CHECKING(for (maybe built-in) function $pa_func) AC_TRY_COMPILE([ #ifdef HAVE_SETJMP_H # include #endif ],[ $pa_func(0,0); ], [AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$pa_func])) ], [AC_MSG_RESULT(no) ]) ] ) parser-3.4.3/COPYING000644 000000 000000 00000043110 07430727316 014157 0ustar00rootwheel000000 000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 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. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, 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 or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's 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 give any other recipients of the Program a copy of this License along with the Program. 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 Program or any portion of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, 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 Program, 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 Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) 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; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, 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 executable. However, as a special exception, the source code 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. If distribution of executable or 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 counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program 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. 5. 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 Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program 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 to this License. 7. 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 Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program 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 Program. 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. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program 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. 9. The Free Software Foundation may publish revised and/or new versions of the 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 Program 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 Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, 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 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 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 Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. 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 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 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, 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. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. parser-3.4.3/ltmain.sh000644 000000 000000 00001051522 11764645505 014757 0ustar00rootwheel000000 000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # 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+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 parser-3.4.3/INSTALL000644 000000 000000 00000011130 12003146746 014144 0ustar00rootwheel000000 000000 $Id: INSTALL,v 1.57 2012/07/23 04:07:02 moko Exp $ 1.What is the process to compile Parser3? Just start ./buildall script and you would get $HOME/parser3install/bin/parser3 binary. NOTE: In case you do not need XML support, use ./buildall --without-xml NOTE: If case you need apache parser module (DSO), use ./buildall --with-apache NOTE: If you have gc, prce, libxml and libxslt installed, you can use ./configure --with-xml NOTE: In case you later would experience problems with gcc runtime exception handling (most notable when reporting sql-related problems), pass this to buildall script: --with-sjlj-exceptions (HPUX is reported to have such problems) NOTE: On some systems there are no "make" and you should run 'gmake', change buildall script accordingly then. 2.What is the process to install Parser3? Copy files from $HOME/parser3install directory into your cgi-bin directory. Then install Parser3 to handle documents, step-by-step instrunctions: http://www.parser.ru/en/docs/lang/install4apachecgi.htm" in English http://www.parser.ru/docs/lang/install4apachecgi.htm" in Russian Directory layout: bin/ parser3 -- CGI and command line Parser3 interpreter auto.p.dist -- configuration file sample, copy it to auto.p and adjust to your needs share/ charsets/ parser3.charsets/ -- charset definition files koi8-r.cfg -- cyrillic charset [KOI8-R encoding] windows-1251.cfg -- cyrillic charset [windows-1251 encoding] ... 3.I have heard about $mail:receive experimental support, how do I use it? Just start ./buildall --with-mailreceive. If you have glib and gmime installed, you can run ./configure --with-mailreceive. 4.Security issues You can disable any exec operations by setting --disable-execs option. file::exec, file::cgi and mail:send (unix version) methods would be disabled. You can enable reading and executing files, not belonging to group+user other then effective by setting --disable-safe-mode option. You can disable user-configured sendmail commands by forcing it, setting "--with=sendmail=COMMAND" option. 5.Since Parser 3.4.0 the several optimisations were implemented. If you experience problems you can try to disable them by commenting corresponding defines and recompiling parser3. src/include/pa_opcode.h #define OPTIMIZE_BYTECODE_GET_CLASS -- $a: #define OPTIMIZE_BYTECODE_GET_ELEMENT -- $a ^a #define OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT -- $a.b ^a.b #define OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT -- $a.$b ^a.$b #define OPTIMIZE_BYTECODE_GET_SELF_ELEMENT -- $self.a ^self.a #define OPTIMIZE_BYTECODE_CONSTRUCT -- $a(expr), $a[value] $.a(expr), $.a[value] $self.a(expr), $self.a[value] #define OPTIMIZE_BYTECODE_CUT_REM_OPERATOR -- cut rem operator with any number of params during compilation #define OPTIMIZE_BYTECODE_STRING_POOL -- simplifying string's bytecode into expression src/include/pa_string.h #define HASH_CODE_CACHING -- calculated hash codes are cached and used for sequential hash lookups src/include/pa_memory.h #define USE_DESTRUCTORS -- destructors are used to decrease memory consumption during code processing and make ^memory:compact[] calls non-essential. src/types/pa_method.h #define OPTIMIZE_CALL -- allows faster operators execution by eliminating method frame with local variables creation and extra write context switches. #define OPTIMIZE_RESULT -- parser methods are marked when the $result variable was used. This allows write operations and context switching optimization. src/types/pa_wwrapper.h #define OPTIMIZE_SINGLE_STRING_WRITE -- reuse original VString in single string assignments. src/lib/cord/include/cord.h #define CORD_CAT_OPTIMIZATION -- CORD library never modifies source concatenations. But in parser write operations it is safe to modify them and save some memory. #define CORD_CHARS_CACHE -- language cords with same language and length are cached and reused. src/include/pa_string.h #define STRING_LENGTH_CACHING -- cache String::Body.length() for char* strings src/include/pa_hash.h #define HASH_ORDER -- hash keys are iterated in the order of insertion parser-3.4.3/install-sh000755 000000 000000 00000033256 11764645505 015146 0ustar00rootwheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false 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: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/missing000755 000000 000000 00000026233 11764645505 014536 0ustar00rootwheel000000 000000 #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # 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 ;; -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' autom4te touch the output file, or create a stub one 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] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) 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*) 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*) 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*) 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*) 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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 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 test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -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 test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) 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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) 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." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/config.sub000644 000000 000000 00000105052 11764645505 015114 0ustar00rootwheel000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-10-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: parser-3.4.3/bin/000755 000000 000000 00000000000 12234223576 013672 5ustar00rootwheel000000 000000 parser-3.4.3/operators.txt000644 000000 000000 00000163123 12172775534 015716 0ustar00rootwheel000000 000000 !ñäåëàíî Xíå ñäåëàíî, âèäèìî, íå áóäåò ñäåëàíî áåç çíà÷êà - áóäåò ñäåëàíî îïåðàòîðû !^eval(âûðàæåíèå)[ôîðìàò] âûðàæåíèå, êðîìå îáû÷íûõ ôóíêöèé:: !äîïóñòèìû #êîììåíòàðèè ðàáîòàþò äî êîíöà ñòðîêè èëè çàêðûâàþùåéñÿ êðóãëîé ñêîáêè âíóòðè êîììåíòàðèÿ äîïóñòèìû âëîæåííûå êðóãëûå ñêîáêè !èç íåî÷åâèäíûõ îïåðàòîðîâ: !| ïîáèòíûé xor !|| ëîãè÷åñêèé xor ~ ïîáèòíîå îòðèöàíèå \ öåëî÷èñëåííîå äåëåíèå 10\3=3 !def äëÿ ïðîâåðêè defined, ïóñòàÿ ñòðîêà íå defined ïóñòàÿ òàáëèöà íå defined ïóñòîé hash íå defined ^if(method $hash.delete){yes} !eq ne lt gt le ge äëÿ ñðàâíåíèÿ ñòðîê, !in "/dir/" äëÿ ïðîâåðêè ["âíóòðè íå äîïóñòèìû, åñëè íàäî ñðàâíèòü ñî ñëîæíûì, ïóñòü ýòî áóäåò ïåðåìåííàÿ]. !is 'type' äëÿ ïðîâåðêè òèïà ëåâîãî îïåðàíäà, ñêàæåì, ìîæíî ïðîâåðèòü, "íå hash ëè ïàðàìåòð ìåòîäà?" !-f äëÿ ïðîâåðêè ñóùåñòâîâàíèÿ ôàéëà íà äèñêå, !-d äëÿ ïðîâåðêè ñóùåñòâîâàíèÿ êàòàëîãà íà äèñêå, !ñòðîêà â êàâû÷êàõ|àïîñòðîôàõ - ñòðîêà, áåç êàâû÷åê|àïîñòðîôîâ ñòðîêà äî áëèæàéøåãî whitespace !÷èñëîâîé ëèòåðàë áûâàåò 0xABC !ïðèîðèòåòû: /* logical */ %left "!||" %left "||" %left "&&" %left '<' '>' "<=" ">=" "lt" "gt" "le" "ge" %left "==" "!=" "eq" "ne" %left "is" "def" "in" "-f" "-d" %left '!' óñëîâèå ? êîãäàÄà: êîãäàÍåò /* bitwise */ %left '!|' %left '|' %left '&' %left '~' /* numerical */ %left '-' '+' %left '*' '/' '%' '\\' %left NEG /* negation: unary - */ !ëèòåðàëû true false !^if(óñëîâèå){êîãäà äà}{êîãäà íåò} !^if(óñëîâèå1){äà}[(óñëîâèå2){äà}[(óñëîâèå2){äà}[...]]]{íåò} -- êîëè÷åñòâî äîï. óñëîâèé íå îãðàíè÷åíî (â îáùåì elseif ýòî :) !^switch[çíà÷åíèå]{^case[âàðèàíò1[;âàðèàíò2...]]{äåéñòâèå}^case[DEFAULT]{äåéñòâèå ïî óìîë÷àíèþ}} !^while(óñëîâèå){òåëî}[[ðàçäåëèòåëü]|{ðàçäåëèòåëü êîòîðûé âûïîëíÿåòñÿ ïåðåä íåïóñòûì î÷åðåäíûì íå ïåðâûì òåëîì}] !^for[i](0;4){òåëî}[[ðàçäåëèòåëü]|{ðàçäåëèòåëü êîòîðûé âûïîëíÿåòñÿ ïåðåä íåïóñòûì î÷åðåäíûì íå ïåðâûì òåëîì}] !^use[ìîäóëü] !^try{ ... !^throw[sql.connect[;âàñÿ[;áîëâàí]]] // áûë ^error[òåêñò] !^throw[ $.type[sql.connect] $.source[âàñÿ] $.comment[áîëâàí] ] ... }{ ^if($exception.type eq "sql"){ $exception.handled(1|true) ^rem{ôëàã, ÷òî exception îáðàáîòàí} .... } ^switch[$exception.type]{ ^case[sql;mail]{ $exception.handled(1) êîä, îáðàáàòûâàþùèé sql îøèáêó $exception.type = sql.connect $exception.file $exception.lineno $exception.colno [åñëè íå çàïðåùåíû ïðè êîìïèëÿöèè] $exception.source = âàñÿ $exception.comment = áîëâàí } ^case[DEFAULT]{ êîä, îáðàáàòûâàþùèé äðóãóþ îøèáêó ^throw[$exception] << re-throw // DON'T! It's default behaviour! } } } ^exit[] + - ïðåêðàùÿåò îáðàáîòêó çàïðîñà. óäîáíî ñäåëàòü ïîñëå âûñòàâëåíèÿ 401 îøèáêè ^return[ðåçóëüòàò] + - îòâàëèâàåò èç âûïîëíåíèÿ ìåòîäà, âûäàâàÿ íåñòàíäàðòíûé ðåçóëüòàò !^break[] + - îáðûâàåò öèêë !^continue[] + - îáðûâàåò èòåðàöèþ öèêëà !^untaint[[as-is|file-spec|http-header|mail-header|uri|sql|js|xml|html|optimized-html|regex|parser-code]]{êîä} default as-is !^taint[[lang]][êîä] default "just tainted, language unknown" !^process[[$caller.CLASS|$object|$ÊËÀÑÑ:CLASS]]{ñòðîêà, êîòîðàÿ áóäåò process-ed, êàê êîä}[ $.main[âî ÷òî ïåðåèìåíîâàòü @main] $.file[èìÿ ôàéëà èç êîòîðîãî, ÿêîáû, äàííûé òåêñò] $.lineno(íîìåð ñòðîêè â ôàéëå, îòêóäà äàííûé òåêñò. ìîæíî îòðèöàòåëüíûé) ] !^process..[ïóòü][âî ÷òî ïåðåèìåíîâàòü @main] ïî óìîë÷àíèþ, ìåòîäû êîìïèëèðóþòñÿ â $self [â ñëó÷àå îïåðàòîðà, $self=$MAIN:CLASS] !^connect[protocol://ñòðîêà ñîåäèíåíèÿ]]{êîä ñ ^sql[...]-ÿìè} !mysql://user:pass@{host[:port]|[/unix/socket]}/database? ClientCharset=parser-charset << charset in which parser thinks client works charset=cp1251_koi8& timeout=3& compress=0& named_pipe=1& multi_statements=1& allow execute more then one query in one parser :sql{} request autocommit=1 autocommit åñëè âûñòàâèòü â 0, áóäåò äåëàòü commit/rollback !pgsql://user:pass@{host[:port]|[local]}/database? client_encoding=win,[to-find-out] &datestyle=ISO,SQL,Postgres,European,NonEuropean=US,German,DEFAULT=ISO &ClientCharset=parser-charset << charset in which parser thinks client works !oracle://user:pass@service? NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251& NLS_LANGUAGE language-dependent conventions NLS_TERRITORY territory-dependent conventions NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS NLS_DATE_LANGUAGE language for day and month names NLS_NUMERIC_CHARACTERS decimal character and group separator NLS_CURRENCY local currency symbol NLS_ISO_CURRENCY ISO currency symbol NLS_SORT sort sequence ORA_ENCRYPT_LOGIN=TRUE ClientCharset=parser-charset << charset in which parser thinks client works !odbc://DSN=dsn^;UID=user^;PWD=password^;ClientCharset=parser-charset ClientCharset << charset in which parser thinks client works !sqlite://DBfile? ClientCharset=parser-charset& << charset in which parser thinks client works autocommit=1 äëÿ ðàáîòû connect íóæíî, ÷òîáû çàðàíåå(ðåêîìåíäóåòñÿ â ñèñòåìíîì êîíôèãóðàöèîííîì auto.p) áûëà îïðåäåëåíà òàáëèöà #sql drivers $SQL[ $.drivers[^table::create{protocol driver client mysql /www/parser3/libparser3mysql.so /usr/local/lib/mysql/libmysqlclient.so pgsql /www/parser3/libparser3pgsql.so /usr/local/pgsql/lib/libpq.so oracle /www/parser3/libparser3oracle.so /u01/app/oracle/product/8.1.5/lib/libclntsh.so?ORACLE_HOME=/u01/app/oracle/product/8.1.5&ORA_NLS33=/u01/app/oracle/product/8.1.5/ocommon/nls/admin/data sqlite /www/parser3/libparser3sqlite.so /usr/local/sqlite/lib/sqlite3.so odbc c:\drives\y\parser3project\odbc\debug\parser3odbc.dll }] ] !â òàáëèöå ó oracle â ñòîëáöå êëèåíòñêîé áèáëèîòåêè äîïóñòèìî çàäàòü environment ïàðàìåòðû èíèöèàëèçàöèè(åñëè îíè íå çàäàíû èíà÷å çàðàíåå), äîïóñòèìû èìåíà, íà÷èíàþùèåñÿ íà NLS_ ORA_ è ORACLE_, èëè îêàí÷èâàþùèåñÿ íà + ïîä win32 íåîáõîäèì PATH+=^;C:\Oracle\Ora81\bin ê ñâåäåíèþ: ORA_NLS33 íóæåí äëÿ ñ÷èòûâàíèÿ ôàéëèêà ñ êëèåíòñêîé êîäèðîâêîé(çàäàâàåìîé NLS_LANG) åñëè êîäèðîâêà íå ïî-óìîë÷àíèþ, îáÿçàòåëüíî óêàçàòü â .drivers, èíà÷å áóäåò ñîîáùåíèå ïðî íåïðàâèëüíûé NLS ïàðàìåòð (èìåþò â âèäó, ÷òî íå íàøëè êîäèðîâêó èç NLS_LANG) ORACLE_HOME íóæåí äëÿ ñ÷èòûâàíèÿ òåêñòîâ ñîîáùåíèé îá îøèáêàõ, ìîæíî óêàçûâàòü è â ñòðîêå ñîåäèíåíèÿ, íî ãëîáàëåí, è ëó÷øå âûíåñòè çà ñêîáêè, â îòëè÷èå îò êëèåíòñêîé êîäèðîâêè NLS_LANG, è ïðî÷åãî. ÂÍÈÌÀÍÈÅ: ïðè ðàáîòå ñ áîëüøèìè òåêñòîâûìè áëîêàìè â oracle&pgsql[à ëó÷øå âñåãäà], ñòàâèòü òàêîé ïðåôèêñ ïåðåä îòêðûâàþùèì àïîñòðîôîì, âïðèòûê, âåçäå áåç ïðîáëåëîâ /**èìÿ_ïîëÿ**/'literal' !^rem{} !^cache[ôàéë](ñåêóíä){êîä}[{catch êîä}] !îòíîñèòåëüíîå çàäàíèå âðåìåíè !ñêýøèðîâàòü ñòðîêó, êîòîðàÿ ïîëó÷àåòñÿ ïðè âûïîëíåíèè êîäà íà 'ñåêóíä' ñåêóíä !åñëè 0ñåêóíä, çíà÷èò íå êýøèðîâàòü, à ñòàðûé òàêîé ñòåðåòü !â catch êîäå $exception.handled[cache] ^rem{ôëàã, ÷òî exception îáðàáîòàí} !^cache[ôàéë][expires date]{êîä}[{catch êîä}] !àáñîëþòíîå çàäàíèå âðåìåíè !^cache[ôàéë] óäàëèòü ôàéë [íå ðóãàåò, åñëè åãî íåò] !^cache(ñåêóíä) !^cache[expires date] !ñèãíàëèçèðóåò âûøåñòîÿùåìó ^cache "óìåíüøè äî ñòîëüêèõ-òî 'ñåêóíä'/'expires'" !â ïðåäåëå: ^cache(0) îòìåíèòü êýøèðîâàíèå !^cache[] âûäà¸ò òåêóùóþ expires date X^cache[read] ñèãíàëèçèðóåò âûøåñòîÿùåìó ^cache "âçÿòü ñêýøèðîâàííîå íàñèëüíî, èãíîðèðóÿ expires", âûäà¸ò bool "ïîëó÷èëîñü/íåò" !^sleep(seconds) Xåñòü ãëîáàëüíûé ôëàæîê â ñâîéñòâàõ/êîìàíäíîé ñòðîêå "íå îïòèìèçèðîâàòü" !è åñòü èñêëþ÷åíèå: ^untaint[html]{êîä} íå îïòèìèçèðóåòñÿ Xáåçîòíîñòèòåëüíî ôëàæêà !ó âñåõ ìåòîäîâ åñòü ëîêàëüíàÿ ïåðåìåííàÿ $result, åñëè â íå¸ ÷òî ïîëîæèòü, !òî _ýòî_ áóäåò ðåçóëüòàòîì ìàêðîñà, à íå åãî òåëî !ó âñåõ ìåòîäîâ åñòü ëîêàëüíàÿ ïåðåìåííàÿ $caller, â íåé ëåæèò ðîäèòåëüñêèé stack frame, !åñëè òóäà çàïèñàòü !use(^use èëè @USE) èùåò ôàéë... !1. ...åñëè ïóòü íà÷èíàåòñÿ ñ /, òî ñ÷èòàåòñÿ, ÷òî ýòî ïóòü îò êîðíÿ âåá ïðîñòðàíñòâà !åñòü ãëîáàëüíàÿ ñòðîêà/òàáëèöà $MAIN:CLASS_PATH ñ ïóò¸ì/ïóòÿìè ê êàòàëîãó ñ êëàññàìè. !êîðåíü ïóòÿ/ïóòåé ñ÷èòàåòñÿ îò êîðíÿ âåá ïðîñòðàíñòâà. !2. ...îòíîñèòåëüíî ñòðî÷êè èç table $MAIN:CLASS_PATH, ñíèçó ââåðõ çàäàâàéòå å¸ â êîíôèãóðàöèîííîì auto.p âàøåãî ñàéòà !ãëîáàëüíàÿ òàáëè÷êà $CHARSETS[$.íàçâàíèå[èìÿ ôàéëà]] !çàäà¸ò êàêèå áóêâû ñ÷èòàþòñÿ êàêèìè(whitespace, letter, etc), à òàêæå èõ unicode !ôîðìàò: tab delimited ôàéë, ñ çàãîëîâêîì: ! char white-space digit hex-digit letter word lowercase unicode1 unicode2 ! A x x x a 0x0041 0xFF21 ! ãäå char è lowercase ìîãóò áûòü áóêâàìè, à ìîãóò áûòü è 0xÊÎÄÀÌÈ ! åñëè ñèìâîë èìååò åäèíñòâåííîå unicode ïðåäñòàâëåíèå, ðàâíîå ñàìîìó ñèìâîëó, ! ìîæíî íå óêàçûâàòü unicode !âñåãäà åñòü êîäèðîâêà UTF-8, !îíà ÿâëÿåòñÿ êîäèðîâêîé ïî-óìîë÷àíèþ äëÿ request è response !ÂÍÈÌÀÍÈÅ: èìÿ êîäèðîâêè case sensitive ñèíòàêñèñ !$èìÿ[íîâîå çíà÷åíèå] !$èìÿ(ìàòåìàòè÷åñêîå âûðàæåíèå íîâîãî çíà÷åíèÿ) !$èìÿ{êîä íîâîãî çíà÷åíèÿ} !$èìÿ whitespace èëè ${èìÿ}íåâàæíî ïîäñòàíîâêà çíà÷åíèÿ !^èìÿ ïàðàìåòðû âûçîâ !$èìÿ.CLASS êëàññ çíà÷åíèÿ !$èìÿ.CLASS_NAME èìÿ êëàññà !$èìÿ[$.key[] () {}] êîíñòðóêòîð ýëåìåíòà ïåðåìåííîé-õýøà $èìÿ.key !^method[$.key[] () {}] êîíñòðóêòîð ýëåìåíòà ïàðàìåòðà-õåøà $parameter.key $CLASS.èìÿ îáðàùåíèå ê ïåðåìåííîé êëàññà èìÿ çàêàí÷èâàåòñÿ ïåðåä: ïðîáåë tab linefeed ; ] } ) " < > + * / % & | = ! ' , ? {óòî÷íèòü} ò.å. ìîæíî $èìÿ,aaaa íî åñëè íóæíî ïîñëå èìåíè áóêâó, ñêàæåì -, òî ${èìÿ}- â âûðàæåíèÿõ + è - ÿâëÿþòñÿ äîïîëíèòåëüíûìè êîíöàìè èìåíè !ìîæíî îáðàùàòüñÿ ê ñîñòàâíûì îáúåêòàì òàê: $name.subname !ãäå subname áûâàåò: ! ñòðîêà ! $ïåðåìåííàÿ ! ñòðîêà$ïåðåìåííàÿ ! [êîä, âû÷èñëÿþùèé ñòðîêó] íàïðèìåð: $õýø[$.âîçðàñò(88)] $äîñòàòü[$.ïîëå[âîçðàñò]] ^õýø.[$äîñòàòü.ïîëå].format{%05d} ïàðàìåòðû:=îäèí èëè ìíîãî ïàðàìåòðîâ ïàðàìåòð:= !(ìàòåìàòè÷åñêîå âûðàæåíèå) âû÷èñëÿåòñÿ ìíîãî ðàç âíóòðè âûçîâà, | ![êîä] âû÷èñëÿåòñÿ îäèí ðàç ïåðåä âûçîâîì, | !{êîä} âû÷èñëÿåòñÿ 0 èëè ìíîãî ðàç âíóòðè âûçîâà, !âåçäå äîïóñòèìû ; âíóòðè - äåëàåò ìíîãî ïàðàìåòðîâ â îäíèõ ñêîáêàõ !void !^èìÿ.length[] 0 !^èìÿ.pos[...] -1 !^èìÿ.left(n) íè÷åãî íå âûäà¸ò !^èìÿ.right(n) íè÷åãî íå âûäà¸ò !^èìÿ.mid(p[;n]) íè÷åãî íå âûäà¸ò !^èìÿ.int[] (default) 0 èëè default !^èìÿ.double[] (default) 0 èëè default !^èìÿ.bool[] (default) false èëè default !^void:sql{çàïðîñ áåç ðåçóëüòàòà}{$.bind[ñì. table::sql]} !int,double !^èìÿ.int[] öåëî÷èñëåííîå çíà÷åíèå !^èìÿ.double[]+ double çíà÷åíèå !^èìÿ.bool[] + .bool(true|false) bool çíà÷åíèå !^èìÿ.inc(íà ñêîëüêî +) !^èìÿ.dec(íà ñêîëüêî -) !^èìÿ.mul(íà ñêîëüêî *) !^èìÿ.div(íà ñêîëüêî /) !^èìÿ.mod(íà ñêîëüêî %) !^èìÿ.format[ôîðìàò] !^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0} $.bind[ñì. table::sql]]] çàïðîñ, ðåçóëüòàò êîòîðîãî äîëæåí áûòü îäèí ñòîëáåö/îäíà ñòðîêà !string !â âûðàæåíèè !def çíà÷åíèå ðàâíî "íå ïóñòà?" !ëîãè÷åñêîå/÷èñëîâîå çíà÷åíèå ðàâíî ïîïûòêå ïðåîáðàçîâûâàíèÿ ê double, ïóñòàÿ ñòðîêà òèõî ïðåîáðàçóåòñÿ ê 0 ïðèìåð: ^if(def $form:name) íå ïóñòà? ^if($user.isAlive) èñòèíà? [àâòîïðåîáðàçîâàíèå ê ÷èñëó, íå íîëü?] !^string:sql{query}[[$.limit(1) $.offset(4) $.default{n/a} $.bind[ñì. table::sql]]] ðåçóëüòàò çàïðîñà äîëæåí áûòü îäèí ñòîëáåö/îäíà ñòðîêà !^ñòðîêà.int[] .int(default) öåëî÷èñëåííîå çíà÷åíèå ñòðîêè. åñëè ëîìàåòñÿ ïðåîáðàçîâàíèå, áåð¸òñÿ default !^ñòðîêà.double[]+ .double(default) double çíà÷åíèå ñòðîêè !^ñòðîêà.bool[] + .bool(default) bool çíà÷åíèå ñòðîêè åñëè ëîìàåòñÿ ïðåîáðàçîâàíèå, áåð¸òñÿ default !^ñòðîêà.format[ôîðìàò] %d %.2f %02d... !^ñòðîêà.match[øàáëîí-ñòðîêà|øàáëîí-regex][[îïöèè ïîèñêà]] $prematch $match $postmatch $1 $2... îïöèè ïîèñêà= i CASELESS x whitespace in regex ignored s singleline = $ ñ÷èòàåòñÿ êîíöîì âñåãî òåêñòà m multiline = $ ñ÷èòàåòñÿ êîíöîì ñòðîêè[\n], íå êîíöîì âñåãî òåêñòà g íàéòè âñå âõîæäåíèÿ, à íå îäíî ' ñîçäàâàòü ñòîëáöû prematch, match, postmatch n âåðíóòü öèñëî ñ êîëè÷åñòâîì íàéäåííûõ ñîâïàäåíèé, à íå òàáëèöó ñ ðåçóëüòàòàìè U èíâåðòèðîâàòü ñìûñë ìîäèôèêàòîðà '?' !^ñòðîêà.match[øàáëîí-ñòðîêà|øàáëîí-regex][îïöèè ïîèñêà]{çàìåíà} îïöèè ïîèñêà+= g çàìåíèòü âñå âõîæäåíèÿ, à íå îäíî !^ñòðîêà.split[ðàçäåëèòåëü][[lrhv]][[íàçâàíèå ñòîëáöà äëÿ âåðòèêàëüíîãî ðàçáèåíèÿ]] l ñëåâà íàïðàâî [default] r ñïðàâà íàëåâî h nameless òàáëèöà ñ êëþ÷àìè 0, 1, 2, ... v òàáëèöà èç 1 ñòîëáöà 'piece' èëè êàê ïåðåäàäóò [default] !^ñòðîêà.{l|r}split[ðàçäåëèòåëü] òàáëèöà èç ñòîëáöà $piece îñòàâëåí äëÿ ñîâìåñòèìîñòè !^ñòðîêà.upper|lower[] X^ñòðîêà.truncate(ïðåäåë òåðïåíüÿ) ñòèëü :( !^ñòðîêà.length[] !^ñòðîêà.mid(P[;N]) áåç N - "äî êîíöà ñòðîêè" !^ñòðîêà.left(N) !^ñòðîêà.right(N) !^ñòðîêà.pos[ïîäñòðîêà] !^ñòðîêà.pos[ïîäñòðîêà](ïîçèöèÿ, ñ êîòîðîé èùåì) <0 = íå íàéäåíî !^ñòðîêà.replace[$òàáëèöà_ïîäñòàíîâîê_ñòðîêà_íà_ñòðîêó] !^ñòðîêà.replace[$÷òî;$íà-÷òî] !^ñòðîêà.save[[append;]ïóòü] !^ñòðîêà.save[ïóòü[;$.charset[â êàêîé êîäèðîâêå ñîõðàíÿåì] $.append(true)]] !^ñòðîêà.normalize[] âûäàåò äðóãóþ ñòðîêó, â êîòîðîé ôðàãìåíòû íà îäíîì ÿçûêå îáúåäèíåíû ïîëåçíî äåëàòü ïåðåä ñëîæíûìè match îïåðàöèÿìè, åñëè âû çíàåòå, ÷òî âõîäíàÿ ñòðîêà ñîñòîèò èç áîëüøîãî ÷èñëà ôðàãìåíòîâ !^ñòðîêà.trim[start|both|end|left|right[;chars]] âûêèäûâàåò chars èç íà÷àëà/êîíöà/è íà÷àëà è êîíöà default 'chars' -- whitespace chars !^ñòðîêà.append[string] !^ñòðîêà.base64[] encode !^string:base64[encoded[;$.strict(true)]] decode !table â âûðàæåíèè ëîãè÷åñêîå çíà÷åíèå ðàâíî "íå ïóñòà?" ÷èñëîâîå çíà÷åíèå ðàâíî count[] !^table::create[[nameless]]{äàííûå}[[$.separator[^#09]]] ñòàðîå èìÿ "set" !^table::create[table][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] êëîíèðóåò òàáëèöó reverse << ñçàäó íà ïåð¸ä (ðàáîòàåò ïîêà òîëüêî â locate, â table::create ÍÅ ðàáîòàåò) !^table::load[[nameless;]ïóòü[;îïöèè]] !åñëè íå nameless, íàçâàíèÿ êîëîíîê áåðóòñÿ èç ïåðâîé ñòðîêè !ïóñòûå ñòðîêè, è ñòðîêè â ïåðâîé êîëîíêå ñîäåðæàùèå '#', èãíîðèðóþòñÿ !$.separator[^#09] !$.encloser["] ïî-óìîë÷àíèþ, íåò. !^table::sql{query}[[$.limit(2) $.offset(4) $.bind[hash] todo:$.default{ ^table::create[...] }]] bind ïðèâÿçûâàåò ïåðåìåííûå â çàïðîñå ê èõ çíà÷åíèÿì ïîêà ðåàëèçîâàí òîëüêî äëÿ oracle â çàïðîñå íàäî íàïèñàòü ":èìÿ" â ïàðàìåòðå bind ïåðåäàòü hash, èç êîòîðîãî âîçüì¸òñÿ(èëè êóäà çàïèøåòñÿ) çíà÷åíèå !^òàáëèöà.save[[nameless|append;]ïóòü[;îïöèè, ñì. load]] !$òàáëèöà.ïîëå !$òàáëèöà.fields èç named òàáëèöû âûäà¸ò òåêóùóþ çàïèñü êàê Hash !^òàáëèöà.menu{òåëî}[[ðàçäåëèòåëü]] !^òàáëèöà.offset[] ïå÷àòàåò offset !^òàáëèöà.offset[[whence]](5) ñäâèãàåò !whence=cur|set !áåç whence - ýòî cur !^òàáëèöà.count[], ^òàáëèöà.count[rows] - êîëè÷åñòâî ñòðîê â òàáëèöå !^òàáëèöà.count[columns] - äëÿ named òàáëèöû êîëè÷åñòâî ñòîëáöîâ (ñîêðàùåíèå îò $c[^òàáëèöà.columns[]]^c.count[]) !^òàáëèöà.count[cells] - êîëè÷åñòâî ÿ÷ååê â òåêóùåé ñòðîêå òàáëèöû !^òàáëèöà.line[] 1-based offset !^òàáëèöà.sort{{êëþ÷åäåëàòåëü ñòðîêà}|(êëþ÷åäåëàòåëü ÷èñëî)}[{desc|asc}] default=asc !^òàáëèöà.append{äàííûå} X^òàáëèöà.insert{äàííûå}[(n)] äîáàâèòü çàïèñü íà òåêóùóþ ïîçèöèþ [äîáàâèòü çàïèñü íà ïîçèöèþ n] X^òàáëèöà.remove(position[;count]) - ñòèðàåò çàïèñü èç òåêóùåé ïîçèöèè [ñòèðàåò çàïèñü èç êîíêðåòíîé ïîçèöèè] [ñòèðàåò count çàïèñåé] !^òàáëèöà.join[òàáëèöà][$.limit(1) $.offset(5) $.offset[cur]] - äîáàâëÿåò çàïèñè èç òàáëèöû. òàáëèöû äîëæíû èìåòü îäèíàêîâóþ ñòðóêòóðó. !^òàáëèöà.flip[] âûäà¸ò òðàíñïîíèðîâàííóþ, íàäî êóäà-òî ñëîæèòü, ïîòîì ïîëüçîâàòü !^òàáëèöà.locate[ïîëå;çíà÷åíèå][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] ïåðåäâèãàåò òåêóùóþ ñòðîêó, åñëè íàéä¸ò. âûäà¸ò bool !^òàáëèöà.locate(ëîãè÷åñêîå âûðàæåíèå)[[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] ïåðåäâèãàåò òåêóùóþ ñòðîêó, åñëè íàéä¸ò. âûäà¸ò bool !^òàáëèöà.hash{[ïîëå]|{êîä}|(âûðàæåíèå)}[[ïîëå çíà÷åíèé|table ïîëÿ çíà÷åíèé]][[$.distinct(1) $.distinct[tables]]] çíà÷åíèåì $hash.êëþ÷ áóäåò hash â êîòîðîì ïîëÿ çíà÷åíèé áóäóò êëþ÷àìè ïîëÿ çíà÷åíèé ìîãóò áûòü íå óêàçàíû, òîãäà èìè áóäóò âñå ñòîëáöû, âêëþ÷àÿ êëþ÷åâîé åñëè distinct ñîäåðæèò true, òî íå áóäåò îøèáêè ïðè ïîâòîðÿþùèõñÿ êëþ÷àõ åñëè distinct ñîäåðæèò tables, òî áóäåò ñîçäàí hash èç òàáëèö, ñîäåðæàùèõ ñòðîêè ñ êëþ÷îì !^òàáëèöà.columns[[íàçâàíèå ñòîëáöà]]+ òàáëèöà èç îäíîãî ñòîëáöà 'column' èëè êàê ïåðåäàäóò !$îòîáðàííîå[^òàáëèöà.select(âûðàæåíèå)] = òàáëèöà èç òåõ æå ñòîëáöîâ è ñòðîê, ó êîòîðûõ óñëîâèå ñîâïàëî $adults[^man.select($man.age>=18)] ^òàáëèöà.color[öâåò1;öâåò2] !hash !â âûðàæåíèè !ëîãè÷åñêîå çíà÷åíèå ðàâíî "íå ïóñòà?" !÷èñëîâîå çíà÷åíèå ðàâíî _count[] !$õåø.êëþ÷ !_default - ñïåöèàëüíûé êëþ÷, åñëè çàäàí, òî ïðè îáðàùåíèè ïî êëþ÷ó, êîòîðîìó íåò ñîîòâåòñòâèÿ, âûäà¸òñÿ _default çíà÷åíèå !$õåø.fields âûäàåò $hash. ÷òîáû êëàññ hash áûë ÷óòü áîëüøå ïîõîæ íà êëàññ table !^hash::create[[!copy_from_hash|copy_from_hashfile]] ñîçäà¸ò íîâûé hash, êîïèþ ñòàðîãî !^õåø.add[ñëàãàåìîå] ïåðåçàïèñûâàåò îäíîèì¸ííûå !^õåø.sub[âû÷èòàåìîå] !^õåø.union[b] = îáúåäèíåíèå îäíîèì¸ííûå îñòàþòñÿ !^õåø.intersection[b] = ïåðåñå÷åíèå çíà÷åíèÿ õåø !^õåø.intersects[b] = bool !^hash::sql{çàïðîñ}[[$.distinct(1) $.limit(2) $.offset(4) todo:$.default{$.field[]...}]] ïîëó÷àåòñÿ hash(êëþ÷è=çíà÷åíèÿ ïåðâàÿ êîëîíêà îòâåòà) of hash(êëþ÷è=íàçâàíèÿ îñòàëüíûõ êîëîíêîê îòâåòà) !^õåø._keys[[íàçâàíèå êîëîíêè ñ êëþ÷àìè]]+ òàáëèöà èç îäíîãî ñòîëáöà $key èëè êàê ïåðåäàäóò !^õåø._count[] !^õåø.foreach[key;value]{òåëî}[[ðàçäåëèòåëü]|{ðàçäåëèòåëü êîòîðûé âûïîëíÿåòñÿ ïåðåä íåïóñòûì î÷åðåäíûì íå ïåðâûì òåëîì}] !^õåø.delete[êëþ÷] óäàëèòü êëþ÷ !^õåø.contain[êëþ÷] - ñóùåñòâóåò ëè â õåøå êëþ÷ (bool) !^õýø._at[first|last] !^õýø._at([-]N) äîñòóï ê çàäàííûì ýëåìåíòàì óïîðÿäî÷åííîãî õåøà !hashfile !^hashfile::open[filename] !^õåøôàéë.clear[] çàáûòü âñ¸ !$õåøôàéë.êëþ÷[çíà÷åíèå] ïîëîæèòü çíà÷åíèå !$õåøôàéë.êëþ÷[$.value[çíà÷åíèå] $.expires[ÇÍÀ×ÅÍÈÅ]} ïîëîæèòü çíà÷åíèå äî expires çíà÷åíèå ïîëÿ expires ìîæåò áûòü date, èëè ÷èñëî äíåé(0äíåé=íà âå÷íî) !$õåøôàéë.êëþ÷ äîñòàòü !^õåøôàéë.delete[êëþ÷] óäàëèòü êëþ÷ !^õåøôàéë.delete[] óäàëèòü ôàéëû, ñîäåðæàùèå äàííûå !^õåøôàéë.hash[] ïðåîáðàçîâàòü â îáû÷íûé hash ïîïóòíî ñòèðàåò óñòàðåâøèå ïàðû !^õåøôàéë.foreach[key;value]{òåëî}[[ðàçäåëèòåëü]|{ðàçäåëèòåëü êîòîðûé âûïîëíÿåòñÿ ïåðåä íåïóñòûì î÷åðåäíûì íå ïåðâûì òåëîì}] !^õåøôàéë.release[] çàïèñàòü äàííûå è ñíÿòü áëîêèðîâêè. ïðè ïîâòîðíîì îáðàùåíèè ê ýëåìåíòàì îòêðîåòñÿ àâòîìàòè÷åñêè. !^õåøôàéë.cleanup[] ïðîáåæàòüñÿ ïî âñåì ýëåìåíòàì è óäàëèòü óñòàðåâøèå. ïðèìåð: $sessions[^hashfile::open[/db/sessions]] $sid[^math:uuid[]] $sessions.$sid[$.value[$uid] $.expires(1)] $uid[$sessions.$sid] !form [áåð¸òñÿ ïåðâûé ýëåìåíò èç îäíîèì¸ííûõ èç GET, ïîòîì ïåðâûé èç POST] !$form:ïîëå = string/file !$form:nameless = ïîëå ñî çíà÷åíèåì ïîëÿ áåç èìåíè "?value&...", "...&value&...", "...&value" !$form:qtail = ñòðîêà ñî çíà÷åíèåì òåêñòà ïîñëå âòîðîãî "?xxxxx", åñëè òàì íå áûëî ',' [imap] !$form:fields = hash ñî âñåìè ïîëÿìè ôîðìû !$form:tables.ïîëå = table ñ îäíèì ñòîëáöîì "field" ñî çíà÷åíèÿìè "ïîëÿ" !$form:files.ïîëå = hash ñî çíà÷åíèÿìè ïîëåé òèïà ôàéë, êëþ÷è - 0, 1, ..., çíà÷åíèå - ôàéë !$form:imap = õýø ñ êëþ÷àìè 'x' è 'y' ñî çíà÷åíèåì ?1,2 ïðèïèñêè ïðè èñïîëüçîâàíèè server-site image map !env !$env:ïåðåìåííàÿ !$env:PARSER òî æå ñàìîå, ÷òî ïîêàçûâàåòñÿ ïðè çàïóñêå parser.cgi !cookie !$cookie:èìÿ ñ÷èòàòü ñòàðîå èëè ñâåæåçàäàííîå !$cookie:èìÿ[çíà÷åíèå] íà 90 äíåé !$cookie:èìÿ[$.value[çíà÷åíèå] $.expires[ÇÍÀ×ÅÍÈÅ] $.secure(true)] !çíà÷åíèå ïîëÿ expires ìîæåò áûòü 'session', date, èëè ÷èñëî äíåé(0äíåé=session) ! åñëè äàòà, îíà áóäåò ïðåîáðàçîâàíà ê ôîðìàòó "Sun, 25-Aug-2002 12:03:45 GMT" ! ìîæíî óñòàíàâëèâàòü bool ñâîéñòâà, íàïðèìåð $.secure(true), $.httponly(true) !$cookie:fields = hash ñî âñåìè cookies !request !$request:query !$request:body unprocessed POST request body !$request:uri !$request:document-root êàòàëîã, îòíîñèòåëüíî êîòîðîãî ñ÷èòàþòñÿ ïóòè â parser, ïî-óìîë÷àíèþ = $env:DOCUMENT_ROOT ìîæíî èçìåíèòü, åñëè íà hosting ÷òî-òî íåóäîáíî íàñòðîåíî !$request:argv = hash ñ ïàðàìåòðàìè êîììàíäíîé ñòðîêè. êëþ÷è 0, 1, ... [0 -- èìÿ îáðàáàòûâàåìîãî ôàéëà]. X!$request:browser ýòî hash, ïîëÿ: !$type = ie/nn è !$version = íîìåð, ñêàæåì 5.5 X$request:user X$request:password !$request:charset Êîäèðîâêà èñõîäíîãî äîêóìåíòà !èñïîëüçóåòñÿ ïðè upper/lower è match[][i] ÏÐÅÄÓÏÐÅÆÄÅÍÈÅ: êëàññ form ïîëó÷àåò ñâîè ïîëÿ ïîñëå îáðàáîòêè âñåõ auto êëàññà MAIN ïîýòîìó íåîáõîäèìî çàäàòü $request/response:charset â îäíîì èç íèõ. íå ïîñëå. !response !$response:ïîëå[çíà÷åíèå] è ìîæíî ñ÷èòàòü ñòàðîå -- $response:ïîëå !çíà÷åíèå ìîæåò áûòü string à ìîæåò áûòü hash: ! $value[abc] field: {abc}<<÷àñòü ! $attribute[zzz] field: abc; {attribute=zzz}<<÷àñòü !çíà÷åíèå ïîëÿ èëè àòðèáóòà ìîæåò áûòü string èëè date ! åñëè äàòà, îíà áóäåò ïðåîáðàçîâàíà ê ôîðìàòó "Sun, 25-Aug-2002 12:03:45 GMT" !$response:headers íàêîïëåííûå ïîëÿ !$response:body[DATA] çàìåùàåò ñòàíäàðòíûé îòâåò !$response:download[DATA] çàìåùàåò ñòàíäàðòíûé îòâåò, âûñòàâëÿåò ôëàã, çàñòàâëÿþùèé browser ïðåäëîæèòü download !$response:status !^response:clear[] çàáûòü âñå çàäàííûå response ïîëÿ !$response:charset êîäèðîâêà êëèåíòà ò.å. òà, 1) èç êîòîðîé áóäóò ïåðåêîäèðîâàíû $form:ïîëÿ ïîñëå çàáèðàíèÿ èç browser'à 2) â êîòîðóþ äîêóìåíò áóäåò ïåðåêîäèðîâàí ïåðåä îòäàâàíèåì â browser 3) â êîòîðóþ áóäåò ïåðåêîäèðîâàí òåêñò ÿçûêà uri íå äîáàâëÿåò ê content-type íè÷åãî, åñëè õî÷åòñÿ, ýòî íàäî ñäåëàòü âðó÷íóþ ÏÐÅÄÓÏÐÅÆÄÅÍÈÅ: êëàññ form ïîëó÷àåò ñâîè ïîëÿ ïîñëå îáðàáîòêè âñåõ auto êëàññà MAIN ïîýòîìó íåîáõîäèìî çàäàòü $request/response:charset â îäíîì èç íèõ. íå ïîñëå. !regex !â âûðàæåíèè !ëîãè÷åñêîå çíà÷åíèå âñåãäà ðàâíî true !÷èñëîâîå çíà÷åíèå ðàâíî êîëè÷åñòâó áàéò ñêîìïèëèðîâàííîãî øàáëîíà. !^regex::create[øàáëîí-ñòðîêà][[îïöèè ïîèñêà]] !^øàáëîí.size[] êîëè÷åñòâî áàéò ñêîìïèëèðîâàííîãî øàáëîíà åñëè çíà÷åíèå î÷åíü áîëüøîå -- ñòîèò ïî÷èòàòü äîêóìåíòàöèþ ïî pcre è, âîçìîæíî, ïåðåïèñàòü øàáëîí. !^øàáëîí.study_size[] ðàçìåð study-ñòðóêòóðû. åñëè==0 -- øàáëîí íå ìîæåò áûòü "èçó÷åí" ^øàáëîí.save[filespec] ^øàáëîí.load[filespec] !reflection !^reflection:create[êëàññ;êîíñòðóêòîð[;ïàðà;[ìåò[;ðû]]]] âûçûâàåò óêàçàííûé êîíñòðóêòîð êëàññà (íå áîëåå 100 ïàðàìåòðîâ) !^reflection:classes[] õåø ñî âñåìè êëàññàìè. êëþ÷ -- èìÿ êëàññà, çíà÷åíèå áûâàåò methoded (êëàññ ñ ìåòîäàìè) èëè void !^reflection:class[îáúåêò] êëàññ ïåðåäàííîãî îáúåêòà !^reflection:class_name[îáúåêò] èìÿ êëàññà ïåðåäàííîãî îáúåêòà !^reflection:base[îáúåêò] ðîäèòåëüñêèé êëàññ ïåðåäàííîãî îáúåêòà !^reflection:base_name[îáúåêò] èìÿ ðîäèòåëüñêîãî êëàññà ïåðåäàííîãî îáúåêòà !^reflection:methods[êëàññ] õåø ñî ñïèñêîì ìåòîäîâ óêàçàííîãî êëàññà, çíà÷åíèÿ -- ñòðîêè 'native' èëè 'parser' !^reflection:method[êëàññ èëè îáúåêò;èìÿ ìåòîäà] âîçâðàùàåò junction-method êëàññà èëè îáúåêòà !^reflection:fields[êëàññ èëè îáúåêò] õåø ñî ñïèñêîì ñòàòè÷åñêèõ ïîëåé óêàçàííîãî êëàññà èëè äèíàìè÷åñêèõ ïîëåé óêàçàííîãî îáúåêòà !^reflection:field[êëàññ èëè îáúåêò;èìÿ ïîëÿ] âîçâðàùàåò çíà÷åíèå óêàçàííîãî ïîëÿ êëàññà èëè îáúåêòà. getter-û èãíîðèðóþòñÿ. !^reflection:uid[êëàññ èëè îáúåêò] âîçâðàùàåò èäåíòèôèêàòîð îáúåêòà èëè êëàññà !^reflection:method_info[êëàññ;ìåòîä] õåø ñ ïàðàìåòðàìè óêàçàííîãî ìåòîäà êëàññà $.inherited[êëàññ] èìÿ êëàññà, ãäå ìåòîä áûë îïðåäåë¸í (âîçâðàùàåòñÿ òîëüêî åñëè ìåòîä áûë îïðåäåë¸í â ïðåäêå) $.overridden[êëàññ] èìÿ êëàññà, ãäå ìåòîä áûë îïðåäåë¸í (âîçâðàùàåòñÿ òîëüêî åñëè ìåòîä áûë îïðåäåë¸í â ïðåäêå) äëÿ native êëàññîâ âîçâðàùàåòñÿ õåø: .min_params(ìèíèìàëüíî íåîáõîäèìîå ÷èñëî ïàðàìåòðîâ) .max_params(ìàêñèìàëüíî âîçìîæíîå ÷èñëî ïàðàìåòðîâ) .call_type[dynamic|static|any] äëÿ parser êëàññîâ âîçâðàùàåòñÿ õåø: êëþ÷ -- íîìåð ïàðàìåòðà (0, 1, ...), çíà÷åíèå - èìÿ ïàðàìåòðà !^reflection:dynamical[[object or class, caller if absent]] âîçâðàùàåò true, åñëè ìåòîä áûë âûçâàí èç äèíàìè÷åñêîãî êîíòåêñòà ïðè ïåðåäà÷å ïàðàìåòðà âîçâðàùàåò true, åñëè ïåðåäàí äèíàìè÷åñêèé îáúåêò, false åñëè êëàññ !^reflection:delete[êëàññ èëè îáúåêò;èìÿ ïåðåìåííîé] óäàëÿåò ïåðåìåííóþ ñ óêàçàííûì èìåíåì â óêàçàííîì êëàññå èëè îáúåêòå !mail !$mail.received=MESSAGE: .from .reply-to .subject .date êëàññà date .message-id .raw[ .ÑÛÐÎÅ_ÏÎËÜÇÎÂÀÒÅËÜÑÊÎÅ-ÏÎËÅ-ÇÀÃÎËÎÂÊÀ ] $.{text|html|file#}[ << íóìåðóåòñÿ êàê è â mail:send (text, text2, ...) (file, file2, ...) $.content-type[ $.value[{text|...|x-unknown}/{plain|html|...|x-unknown}] [$.charset[windows-1251]] << â êàêîì ïðèøëî, ñåé÷àñ óæå ïåðåêîäèðîâàíî $.ÏÎËÜÇÎÂÀÒÅËÜÑÊÈÉ-ÏÀÐÀÌÅÒÐ-ÇÀÃÎËÎÂÊÀ ] $.description $.content-id $.content-md5 $.content-location .raw[ .ÑÛÐÎÅ_ÏÎËÜÇÎÂÀÒÅËÜÑÊÎÅ-ÏÎËÅ-ÇÀÃÎËÎÂÊÀ ] $.value[ñòðîêà|FILE] ] $.message#[MESSAGE] (message, message2, ...) !^mail:send[ $.options[-odd] unix: ñòðîêà, êîòîðàÿ áóäåò äîáàâëåíà ê êîìàíäå çàïóñêà sendmail -odd îçíà÷àåò "áûñòðî ïîñòàâü â î÷åðåäü áåç ïðîâåðêè email" win32: èãíîðèðóåòñÿ $.charset[êîäèðîâêà çàãîëîâêà è òåêñòîâûõ áëîêîâ] $.any-header-field $.text[string] $.text[ $.any-header-field $.value[string] ] $.html{string} $.html[ $.any-header-field $.value{string} ] $.file#[FILE] $.file#[ $.any-header-field $value[FILE] ] ] !åñëè charset óêàçàí, ïèñüìî ïåðåêîäèðóåòñÿ â ýòîò charset !content-type.charset íå âëèÿåò íà ïåðåêîäèðîâàíèå !ïîñëå èìåíè ÷àñòè ìîæåò èäòè # ÷èñëî ^mail:send[ # ïî-óìîë÷àíèþ, ñîâïàäàåò ñ source encoding. # çàäà¸ò êîäèðîâêó body $.charset[windows-1251] # íåò óìîë÷àíèÿ $.content-type[$.value[text/plain] $.charset[windows-1251]] $.from["âàñÿ" ] $.to["ïåòÿ" ] $.subject[ïîéä¸ì ïèâêà] $.body[ ñëîâà ] ] !:send[$.header-field[] $.charset[êîäèðîâêà ïèñüìà] $.body[êîãäà body íå ñòðîêà, à hash, îòñûëàåòñÿ multipart ïèñüìî]] !åñëè charset óêàçàí, ïèñüìî ïåðåêîäèðóåòñÿ â ýòîò charset !content-type.charset íå âëèÿåò íà ïåðåêîäèðîâàíèå !ïîñëå èìåíè ÷àñòè ìîæåò èäòè öåëîå ÷èñëî, ÷àñòè ïîéäóò â ïîðÿäêå ÷èñåë. !åñëè body óêàçàí ñòðîêîé, òî ýòî òåêñò ïèñüìà, íèêàêèõ âëîæåíèé. !åñëè body óêàçàí hash, òî ýòî ÷àñòè, áóäóò ñîáðàíû òåêñòîâûå áëîêè, çàòåì âëîæåíèÿ !ýòî ñòàðûé ôîðìàò, ïîääåðæèâàåòñÿ äëÿ îáðàòíîé ñîâìåñòèìîñòè !åñëè èìÿ ÷àñòè íà÷èíàåòñÿ ñî ñëîâà text, òî ýòî òåêñòîâûé áëîê. !åñëè èìÿ ÷àñòè íà÷èíàåòñÿ ñî ñëîâà file, òî ýòî âëîæåíèå, ôîðìàò çàäàíèÿ:: !$file[$.format[!uue|!base64] $.value[DATA] $.name[user-file-name]] !âàæíî: ïðè multipart íå óêàçûâàòü content-type ^mail:send[ # ïî-óìîë÷àíèþ, ñîâïàäàåò ñ source encoding. # çàäà¸ò êîäèðîâêó body $.charset[windows-1251] # íåò óìîë÷àíèÿ $.content-type[$.value[text/plain] $.charset[windows-1251]] $.from["âàñÿ" ] $.to["ïåòÿ" ] $.subject[ïîéä¸ì ïèâêà] $.body[ ñëîâà ] ] ^mail:send[ $.from["âàñÿ" ] $.to["ïåòÿ" ] $.subject[ïîéä¸ì ïèâêà] $.body[ $.text[ # çàäà¸ò êîäèðîâêó body $.charset[windows-1251] # íåò óìîë÷àíèÿ $.content-type[$.value[text/plain] $.charset[windows-1251]] $.body[ñëîâà] ] #äëÿ óäîáñòâà ñêðèïòîâàíèÿ ìîæíî óêàçàòü òîëüêî îäíó ÷àñòü, ïðè ýòîì íå áóäåò multipart $.file[ $.value[^file::load[my beloved.doc]] $.name[ìîé ëþáèìûé.doc] $.format[base64] ] $.file2[ $.value[^file::load[my beloved.doc]] $.name[ìîé ëþáèìûé.doc] ] ] ] !äëÿ îòïðàâêè ïîä unix èñïîëüçóåòñÿ ïðîãðàììà ñ ïàðàìåòðàìè, çàäàâàåìàÿ $MAIL.sendmail[êîìàíäà] åñëè íå áóäåò çàäàíà, ïðîâåðÿåòñÿ, äîñòóïíà ëè /usr/sbin/sendmail èëè /usr/lib/sendmail è, åñëè äîñòóïíà, òî çàïóñêàåòñÿ ñ ïàðàìåòðîì "-t". ïîä win32 èñïîëüçóåòñÿ SMTP ïðîòîêîë, ñåðâåð çàäà¸òñÿ $MAIL.SMTP[smtp.domain.ru] !image !$êàðòèíêà[^image::measure[DATA]] ñìîòðèò íà .ext case insensitive, óìååò ìåðèòü ïîêà òîëüêî .gif è .jpg .jpeg !$êàðòèíêà.exif << hash ïîñëå measure jpeg ñ exif èíôîðìàöèåé !$image.exif.DateTime & co [ïîëíûé ñïèñîê ñì. http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html] !÷èñëà òèïà int/double, !äàòû òèïà date !ïåðå÷èñëåíèÿ â âèäå hash ñ êëþ÷àìè 0..count-1 !$êàðòèíêà.src .width .height !$êàðòèíêà.line-width ÷èñëî=øèðèíà ëèíèé !$êàðòèíêà.line-style ñòðîêà=ñòèëü ëèíèé '*** * '='*** * *** * *** * ' !^êàðòèíêà.html[[hash]] = !^image::load[ôîí.gif] òîëüêî gif ïîêà !^image::create(ðàçìåð X;ðàçìåð Y[;öâåò ôîíà default áåëûé]]) !^êàðòèíêà.line(x0;y0;x1;y1;0xffFFff) !^êàðòèíêà.fill(x;y;0xffFFff) !^êàðòèíêà.rectangle(x0;y0;x1;y1;0xffFFff) !^êàðòèíêà.bar(x0;y0;x1;y1;0xffFFff) !^êàðòèíêà.replace(hex-öâåò1;hex-öâåò2)[table x:y âåðøèíû_ìíîãîóãîëüíèêà] !^êàðòèíêà.polyline+(öâåò)[table x:y òî÷êè] !^êàðòèíêà.polygon(öâåò)[table x:y âåðøèíû_ìíîãîóãîëüíèêà] !^êàðòèíêà.polybar(öâåò)[table x;y âåðøèíû_ìíîãîóãîëüíèêà] !^êàðòèíêà.font[íàáîð_áóêâ;èìÿ_ôàéëà_øðèôòà.gif][(øèðèíà_ïðîáåëà[;øèðèíà_ñèìâîëà])] âûñîòà ñèìâîëà = âûñîòà êàðòèíêè/êîëè÷åñòâî áóêâ â íàáîðå åñëè óêàçàíà øèðèíà_ñèìâîëà, òî monospaced, åñëè 0, òî øèðèíà_ñèìâîëà = øèðèíå gif !^êàðòèíêà.font[íàáîð_áóêâ;èìÿ_ôàéëà_øðèôòà.gif; $.space(øèðèíà_ïðîáåëà) // ïî óìîë÷àíèþ = øèðèíå gif $.width(øèðèíà_ñèìâîëà) // ñì. âûøå, ïî óìîë÷àíèþ proportional $.spacing(ðàññòîÿíèå ìåæäó áóêâàìè) // ïî óìîë÷àíèþ = 1 ] !^êàðòèíêà.text(x;y)[òåêñò_íàäïèñè] AS_IS !^êàðòèíêà.length[òåêñò_íàäïèñè] AS_IS !^êàðòèíêà.gif[âîçìîæíî, èìÿ ôàéëà] -- êîäèðóåò â FILE ñ content-type=image/gif èìÿ ôàéëà áóäåò èñïîëüçîâàíî ïðè $response:download !^êàðòèíêà.arc(center x;center y;width;height;start in degrees;end in degrees;color) !^êàðòèíêà.sector(center x;center y;width;height;start in degrees;end in degrees;color) !^êàðòèíêà.circle(center x;center y;r;color) !^êàðòèíêà.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]]) ïðè çàäàííûõ dest_w/dest_h äåëàåò èçìåíåíèå ðàçìåðà êóñî÷êà ïðè óìåíüøåíèè äåëàåò resample ãîäèòñÿ òîëüêî äëÿ óìåíüøåíèÿ ïðîñòîé[ìàëîöâåòíîé] äðåáåäåíè âðîäå ãðàôèêîâ/pie, äëÿ thumbnais íå ãîäèòñÿ. ïðè íå óêàçàííîì dest_h ñîõðàíÿåò aspect ratio tolerance - íåêîå ÷èñëî[êâàäðàò ðàññòîÿíèÿ â RGB ïðîñòðàíñòâå äî èñêîìîãî öâåòà], îïðåäåëÿþùåå ïðîæîðëèâîñòü âûäåëÿëêè öâåòîâ èç ïàëèòðû [default=150] ìåíüøå - òî÷íåå ïðèáëèæàåò öâåòà, íî îíè áûñòðî êîí÷àþòñÿ áîëüøå - íåòî÷íî ïðèáëèæàåò öâåò, íî áÎëüøåé ÷àñòè õâàòèò !^êàðòèíêà.pixel(x;y)[(color)] óçíàòü èëè çàäàòü öâåò ïèêñåëà !file !$ôàéë_èç_post.name !$ôàéë_èç_post.size !$ôàéëtèç_post.text !^ôàéë.save[text|binary;èìÿ ôàéëà[;$.charset[â êàêîé êîäèðîâêå ñîõðàíÿåì]]] !^file:delete[èìÿ ôàéëà] !^file:find[èìÿ ôàéëà][{êîãäà íå íàøëè}] !^file:list[ïóòü[;øàáëîí-ñòðîêà|øàáëîí-regex]] = table ñ êîëîíêàìè name dir !^file:list[ïóòü;$.filter[øàáëîí-ñòðîêà|øàáëîí-regex] $.stat(true)] = table ñ êîëîíêàìè name dir size [mca]date !^file::load[text|binary;!big.zip[;!domain_press_release_2001_03_01.zip][;îïöèè]] !^file::create[text|binary;èìÿ;data] !^file::create[text|binary;èìÿ;data[;$.charset[êîäèðîâêà áóêâ â ñîçäàâàåìîì ôàéëå] $.content-type[...]]] !^file::create[string-or-file-content[;$.name[èìÿ] $.mode[text|binary] $.content-type[...] $.charset[...]]] !$ôàéë_êîòîðûé_áûë_loaded.size !$ôàéë_êîòîðûé_áûë_loaded_èëè_created.mode = text/binary !^file::stat[èìÿ ôàéëà] !$ôàéë_êîòîðûé_áûë_stated_èëè_loaded.size !.adate !.mdate !.cdate !^file::cgi[[text|binary;]èìÿ ôàéëà[;env hash +options[;1cmd[;2line[;3ar[;4g[;5s]]]]]]] âîçâðàù¸ííûé çàãîëîâîê ðàññûïàåòñÿ íà $ïîëÿ $status $stderr !^file::exec[[text|binary;]èìÿ ôàéëà[;env hash[;1cmd[;2line[;3ar[;4g[;5s;...under unix max 50 args]]]]]]] options: $.stdin[òåêñò] åñëè òåêñò ïóñò, îòêëþ÷àåòñÿ àâòîìàòè÷åñêîå ïåðåñîâûâàíèå äàííûõ HTTP-POST !^file:move[ñòàðîå èìÿ ôàéëà;íîâîå èìÿ ôàéëà] ìîæíî ïåðåèìåíîâûâàòü è äâèãàòü êàòàëîãè[win32: íî íå ÷åðåç ãðàíèöó äèñêîâ] êàòàëîãè äëÿ dest ñîçäàþòñÿ ñ ïðàâàìè 775 êàòàëîã ñòàðîãî ôàéëà ñòèðàåòñÿ, åñëè ïîñëå move îí îñòà¸òñÿ ïóñò !^file:copy[èìÿ ôàéëà;èìÿ êîïèè ôàéëà] ìîæíî êîïèðîâàòü òîëüêî ôàéëû !^file:lock[èìÿ ôàéëà]{êîä} ôàéë ïðè íåîáõîäèìîñòè ñîçäà¸òñÿ áëîêèðóåòñÿ âûïîëíÿåòñÿ êîä ðàçáëîêèðóåòñÿ Xchmod[...] ÍÅÒ È ÍÅ ÁÓÄÅÒ, ×ÒÎÁÛ ÍÅ ÌÎÃËÈ ÑÄÅËÀÒÜ executable è çàïóñòèòü, äàæå åñëè ftp çàïðåùàåò chmod. !^file:dirname[/a/some.tar.gz]=/a (ðàáîòàåò àíàëîãè÷íî êîììàíäå *nix) !^file:dirname[/a/b/]=/a (ðàáîòàåò àíàëîãè÷íî êîììàíäå *nix) !^file:basename[/a/some.tar.gz]=some.tar.gz (ðàáîòàåò àíàëîãè÷íî êîììàíäå *nix) !^file:basename[/a/b/]=b (ðàáîòàåò àíàëîãè÷íî êîììàíäå *nix) !^file:justname[/a/some.tar.gz]=some.tar !^file:justext[/a/some.tar.gz]=gz !/some/page.html: ^file:fullpath[a.gif] => /some/a.gif !^ôàéë.sql-string[] âíóòðè ^connect äàñò ïðàâèëüíî escaped ñòðîêó, êîòîðóþ ìîæíî â çàïðîñ îòäàòü X^file::sql[[èìÿ_ôàéëà_äëÿ_download]]{query} !^file::sql{query}[[ $.name[èìÿ_ôàéëà_äëÿ_download] $.content-type[ïîëüçîâàòåëüñêèé content-type] ]] ðåçóëüòàò çàïðîñà äîëæåí áûòü "îäíà ñòðîêà". êîëîíêè: ïåðâàÿ êîëîíêà - äàííûå åñëè åñòü âòîðàÿ - ýòî èìÿ ôàéëà åñëè åñòü òðåòüÿ - ýòî content-type !^ôàéë.base64[] encode !^file:base64[èìÿ ôàéëà] encode !^file::base64[encoded string] !^file::base64[mode;èìÿ ôàéëà;encoded string[;$.content-type[...]]] decode !^file:crc32[èìÿ ôàéëà] âû÷èñëÿåò crc32 ôàéëà ñ óêàçàííûì èìåíåì !^ôàéë.crc32[] âû÷èñëÿåò crc32 îáúåêòà !^ôàéë.md5[] !^file:md5[èìÿ ôàéëà] âûäàåò digest ôàéëà, äëèíîé 16 áàéò â âèäå ñòðîêè, ãäå áàéòû digest âûäàíû â hex âèäå, âïðèòûê, â íèæíåì ðåãèñòðå !math !$math:PI !^math:round floor ceiling !^math:trunc frac !^math:abs sign !^math:exp log !^math:sin asin cos acos tan atan !^math:degrees radians !^math:pow sqrt !^math:random(øèðèíà äèàïàçîíà) !^math:uuid[] 22C0983C-E26E-4169-BD07-77ECE9405BA5 win32: ïîëüçóåòñÿ cryptapi unix: ïîëüçóåòñÿ /dev/urandom, åñëè íåò, /dev/random, åñëè íåò, rand [íà solaris /dev/random ìîæíî äîáàâèòü] !^math:uid64[] BA39BAB6340BE370 !^math:md5[string] âûäàåò digest ñòðîêè, äëèíîé 16 áàéò â âèäå ñòðîêè, ãäå áàéòû digest âûäàíû â hex âèäå, âïðèòûê, â íèæíåì ðåãèñòðå !^math:crypt[password;salt] salt prefix $apr1$ âûçûâàåò âñòðîåííûé MD5 àëãîðèòì, åñëè íåò òåëà salt, îíî ñîçäà¸òñÿ ñëó÷àéíûì $1$ âûçûâàåò MD5 àëãîðèòì ôóíêöèè OS 'crypt', åñëè ïîääåðæèâàåòñÿ [çàâåäîìî íåò íà solaris]. äðóãèå salt ÷èòàéòå äîêóìåíòàöèþ ïî ôóíêöèè OS 'crypt'. !^math:crc32[string] âû÷èñëÿåò crc32 ñòðîêè !^math:sha1[string] !^math:convert[number](base-from;base-to) ïðåîáðàçóåò ñòðîêó ñ ÷èñëîì èç îäíîé ñèñòåìû èñ÷èñëåíèÿ â äðóãóþ !inet !^inet:ntoa(long) !^inet:aton[IP] !json !^json:parse[-json-ñòðîêà-[; $.depth(ìàêñèìàëüíàÿ ãëóáèíà, default == 19) $.double(false) îòêëþ÷èòü âñòðîåííûé ïàðñèíã ÷èñåë ñ ïëàâàþùåé òî÷êîé (ïî óìîë÷àíèþ âêëþ÷åí) â ýòîì ñëó÷àå îíè ïîïàäóò â ðåçóëüòèðóþùèé îáúåêò êàê ñòðîêè $.distinct[first|last|all] êàê áóäåò ïðîèñõîäèòü ðàçáîð äóáëèðóþùèõñÿ êëþ÷åé ó îáúåêòîâ first -- áóäåò îñòàâëåí ïåðâûé âñòðåòèâøèéñÿ ýëåìåíò last -- áóäåò îñòàâëåí ïîñëåäíèé âñòðåòèâøèéñÿ ýëåìåíò all -- áóäóò îñòàâëåíû âñå ýëåìåíòû. ïðè ýòîì ýëåìåíòû, íà÷èíàÿ ñî 2 ïîëó÷àò ÷èñëîâûå ñóôôèêñû (key_2 èòä) ïî óìîë÷àíèþ äóáëèðóþùèåñÿ êëþ÷è ïðèâåäóò ê exception $.object[method-junction] ïîëüçîâàòåëüñêèé ìåòîä[êëþ÷;îáúåêò], êîòîðîìó áóäóò ïåðåäàâàòüñÿ âñå ðàçîáðàííûå îáúåêòû è êëþ÷è îáúåêòà, ìåòîä âîçâðàùàåò íîâûé îáúåêò $.array[method-junction] ïîëüçîâàòåëüñêèé ìåòîä, êîòîðîìó áóäóò ïåðåäàâàòüñÿ ìàññèâû ]] ïàðñèò json-ñòðîêó â õýø !^json:string[system or user object[; $.skip-unknown(false) îòêëþ÷èòü exception è âûäàâàòü 'null' ïðè ñåðèàëèçàöèè îáúåêòîâ ñ òèïàìè îòëè÷íûõ îò void, bool, string, int, double, date, table, hash è file $.indent(true) ôîðìàòèðîâàòü ðåçóëüòèðóþùóþ ñòðîêó òàáóëÿöèÿìè ïî ãëóáèíå âëîæåííîñòè $.date[sql-string|gmt-string|unix-timestamp] ôîðìàò âûâîäà äàòû, ïî óìîë÷àíèþ -- sql-string $.table[object|array|compact] ôîðìàò âûâîäà òàáëèöû, ïî óìîë÷àíèþ -- object object: [{"c1":"v11","c2":"v12",...},{"c1":"v21","c2":"v22",...},...] array: [["c1","c2",...] || null (for nameless),["v11","v12",...],...] compact: ["v11" || ["v11","v12",...],...] $.file[text|base64|stat] âûâåñòè òåëî ôàéëà â óêàçàííîì âèäå (ïî óìîë÷àíèå òåëî ôàéëà íå ïîïàäàåò â output) $.xdoc[hash] ïàðàìåòðû ïðåîáðàçîâàíèÿ xdoc â ñòðîêó (êàê â ^xdoc.string[]) $.òèï[method-junction] ëþáîé òèï ìîæíî âûâåñòè ñ ïîìîùüþ ïîëüçîâàòåëüñêîãî ìåòîäà, êîòîðûé äîëæåí ïðèíèìàòü 3 ïàðàìåòðà: êëþ÷, îáúåêò äàííîãî òèïà è îïöèè âûçîâà ^json:string[] ]] ñåðèàëèçóåò ñèñòåìíûé èëè ïîëüçîâàòåëüñêèé îáúåêò â json-ñòðîêó !date !âðåìÿ òèïà time ìîæíî èñïîëüçîâàòü â âûðàæåíèÿõ, ïîäñòàâëÿåò êîëè÷åñòâî äíåé ñ epoch [1 ÿíâàðÿ 1970 (UTC)], äðîáíîå !âñ¸ ïðîèñõîäèò â localtime, !âðåìåííàÿ çîíà çàäà¸òñÿ âíå parser ñðåäñòâàìè OS $date:UTC-offset ñêîëüêî äíåé íàäî ïðèáàâèòü,÷òîáû ïîïàñòü â local âðåìÿ $date:TZ íàø ÷àñîâîé ïîÿñ, äðîáíîå, â ÷àñàõ (ãäå-òî åñòü ñ òî÷íîñòüþ äî ïîëó÷àñà) !^date::now[] !^date::now(ñìåùåíèå â äíÿõ) âûäà¸ò ñåé÷àñ+ñìåùåíèå !^date::today[] äàòà íà 00:00:00 òåêóùåãî äíÿ !^date::create(äíåé ñ epoch) // ñòàðîå èìÿ set !^date::create(year;month[;day[;hour[;minute[;second]]]]) // ñòàðîå èìÿ set !^date::create[äàòà â ôîðìàòå %Y-%m-%d %H:%M:%S] äëÿ óäîáíîãî ñîçäàíèÿ ïî çíà÷åíèþ èç áàçû ôîðìàò1: %Y[-%m[-%d[ %H[:%M[:%S]]]]] ôîðìàò2: %H:%M[:%S] !^date::unix-timestamp() !^äàòà.unix-timestamp[] !$äàòà.year month day hour minute second weekday yearday(0...) daylightsaving TZ weekyear read-only TZ="" << ëîêàëüíàÿ çîíà !^äàòà.roll[year|month|day](+-ñìåùåíèå) ñäâèãàåò äàòó !^äàòà.roll[TZ;Íîâàÿ çîíà] ãîâîðèò, ÷òî äàòà â òàêîì-òî ÷àñîâîì ïîÿñå: âëèÿåò íà .hour & Co !^äàòà.sql-string[[datetime|date|time]] datetime èëè áåç ïàðàìåòðà -- %Y-%m-%d %H:%M:%S date -- %Y-%m-%d time -- %H:%M:%S where published='^äàòà.sql-string[]' !^date:calendar[rus|eng](ãîä;ìåñÿö) âûäà¸ò íåèìåíîâàííóþ òàáëèöó ñòîëáöû: 0..6, week, year !^date:calendar[rus|eng](ãîä;ìåñÿö;äåíü) âûäà¸ò èìåííîâàííóþ òàáëèöó ñòîëáöû: year, month, day, weekday !^date:last-day(ãîä;ìåñÿö) âåðí¸ò ïîñëåäíèé äåíü ìåñÿöà !^äàòà.last-day[] âåðí¸ò ïîñëåäíèé äåíü ìåñÿöà $äàòà !^äàòà.gmt-string[] Fri, 23 Mar 2001 09:32:23 GMT xdoc(xnode) !$xdoc.search-namespaces hash, where keys=prefixes, values=urls DOM1 attributes: !readonly attribute DocumentType doctype Xreadonly attribute DOMImplementation implementation !readonly attribute Element documentElement DOM1 methods: !Element createElement(in DOMString tagName) !DocumentFragment createDocumentFragment() !Text createTextNode(in DOMString data) !Comment createComment(in DOMString data) !CDATASection createCDATASection(in DOMString data) !ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data) !Attr createAttribute(in DOMString name) !EntityReference createEntityReference(in DOMString name) !NodeList getElementsByTagName(in DOMString tagname) DOM2 some methods: !^.getElementById[elementId] = xnode The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return null. !êîäèðîâêà ñòðîê è óìîë÷àíèå äëÿ $.encoding !ðàâíî òåêóùåé êîäèðîâêå âûõîäíîé ñòðàíèöû, $response:charset ::sql{...} !::create[[URI]]{} ñòàðîå èìÿ 'set' !::create[[URI]][qualifiedName] URI default = disk path to requested document äëÿ êàòàëîãîâ êîíå÷íûé / îáÿçàòåëåí !::create[file] can be usable: $f[^file::load[binary;http://;some HTTP options here...]] $x[^xdoc::create[$f]] !::load[file.xml[;îïöèè]] !.transform[rules.xsl|xdoc][[params hash]] âûäà¸ò dom øàáëîí êýøèðóåòñÿ, êýø îáíîâëÿåòñÿ ïðè èçìåíåíèè äàòû ôàéëà øàáëîíà, èëè èçìåíåíèè äàòû ôàéëà "èìÿ øàáëîíà.stamp"[ïðîâåðêà äàòû stamp ïðèîðèòåòíåå] !ïàðàìåòðû ïåðåäàþòñÿ êàê åñòü, íå xpath âûðàæåíèÿ !.string[[output options]] !.save[file.xml[;output options]] ñ øàïêîé !.file[[output options]] = file output options èäåíòè÷íû àòðèáóòàì xsl:output [èñêëþ÷åíèå: èãíîðèðóåòñÿ cdata-section-elements, íóæíî áóäåò, ñäåëàþ] âûäà¸ò media-type ïðè ïîäñòàíîâêå $response:body[ñþäà] !åñëè íà äîêóìåíò ññûëàþòñÿ òàê: parser://method/param/to/that/method òî â êà÷åñòâå äîêóìåíòà èñïîëüçóåòñÿ ^MAIN:method[/param/to/that/method] [ïðèìå÷àíèå: â ïàðàìåòð âñåãäà ïðèõîäèò ëèäèðóþùàÿ /, äàæå, åñëè ïàðàìåòðîâ âîîáùå íå áûëî] !xnode DOM1 attributes: !$node.nodeName !$node.nodeValue !read !write !$node.nodeType = int ELEMENT_NODE = 1 ATTRIBUTE_NODE = 2 TEXT_NODE = 3 CDATA_SECTION_NODE = 4 ENTITY_REFERENCE_NODE = 5 ENTITY_NODE = 6 PROCESSING_INSTRUCTION_NODE = 7 COMMENT_NODE = 8 DOCUMENT_NODE = 9 DOCUMENT_TYPE_NODE = 10 DOCUMENT_FRAGMENT_NODE = 11 NOTATION_NODE = 12 $vasyaNode.type==$xnode:ELEMENT_NODE !$node.parentNode !$node.childNodes = array of nodes !$node.firstChild !$node.lastChild !$node.previousSibling !$node.nextSibling !$node.ownerDocument = xdoc !$node.prefix !$node.namespaceURI !$element_node.attributes = hash of xnodes !$element_node.tagName !$attribute_node.specified = boolean true if the attribute received its value explicitly in the XML document, or if a value was assigned programatically with the setValue function. false if the attribute value came from the default value declared in the document's DTD. !$attribute_node.name !$attribute_node.value $text_node/cdata_node/comment_node.substringData !$pi_node.target = target of this processing instruction XML defines this as being the first token following the markup that begins the processing instruction. !$pi_node.data = The content of this processing instruction This is from the first non white space character after the target to the character immediately preceding the ?>. document_node. readonly attribute DocumentType doctype readonly attribute DOMImplementation implementation readonly attribute Element documentElement document_type_node. !readonly attribute DOMString name readonly attribute NamedNodeMap entities readonly attribute NamedNodeMap notations !notation_node. !readonly attribute DOMString publicId !readonly attribute DOMString systemId !DOM1 node methods: !Node insertBefore(in Node newChild,in Node refChild) !Node replaceChild(in Node newChild,in Node oldChild) !Node removeChild(in Node oldChild) !Node appendChild(in Node newChild) !boolean hasChildNodes() !Node cloneNode(in boolean deep) !DOM1 element methods: !DOMString getAttribute(in DOMString name) !void setAttribute(in DOMString name, in DOMString value) raises(DOMException) !void removeAttribute(in DOMString name) raises(DOMException) !Attr getAttributeNode(in DOMString name) !Attr setAttributeNode(in Attr newAttr) raises(DOMException) !Attr removeAttributeNode(in Attr oldAttr) raises(DOMException) !NodeList getElementsByTagName(in DOMString name) !void normalize() !Introduced in DOM Level 2: !Node importNode(in Node importedNode, in boolean deep) raises(DOMException) !NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName) !boolean hasAttributes() !XPath: !^node.select[xpath/query/expression] = array of nodes, empty array if nothing found !^node.selectSingle[xpath/query/expression] = first node if any !^node.selectBool[xpath/query/expression] = bool if any or die !^node.selectNumber[xpath/query/expression] = double if any or die !^node.selectString[xpath/query/expression] = string if any or die !error codes(ïîêà ïðèäóò êàê òåêñò â ñëó÷àå ñîîòâåòñòâóþùèõ îøèáîê): INDEX_SIZE_ERR If index or size is negative, or greater than the allowed value DOMSTRING_SIZE_ERR If the specified range of text does not fit into a DOMString HIERARCHY_REQUEST_ERR If any node is inserted somewhere it doesn't belong WRONG_DOCUMENT_ERR If a node is used in a different document than the one that created it (that doesn't support it) INVALID_CHARACTER_ERR If an invalid character is specified, such as in a name. NO_DATA_ALLOWED_ERR If data is specified for a node which does not support data NO_MODIFICATION_ALLOWED_ERR If an attempt is made to modify an object where modifications are not allowed NOT_FOUND_ERR If an attempt was made to reference a node in a context where it does not exist NOT_SUPPORTED_ERR If the implementation does not support the type of object requested INUSE_ATTRIBUTE_ERR If an attempt is made to add an attribute that is already inuse elsewhere !memory !^memory:compact[] ñîáðàòü ìóñîð, îñâîáîäèâ ìåñòî ïîä íîâûå äàííûå (ïðåäóïðåæäåíèå: ïàìÿòü ïðîöåññà íèêîãäà íå îñâîáîæäàåòñÿ) ïîëåçíî äåëàòü ïåðåä XSL transform. !status !÷òîáû êëàññ áûë äîñòóïåí, â apache íóæíî ñêàçàòü ParserStatusAllowed !â cgi äîñòóïåí âåçäå !â isapi íå äîñòóïåí íèãäå !$status:sql hash !cache table url time url time url time !$status:stylesheet !cache table file time file time file time !$status:rusage hash !utime user time used !stime system time used !maxrss max resident set size !ixrss integral shared text memory size !idrss integral unshared data size !isrss integral unshared stack size !tv_sec !tv_usec $s[$status:rusage] ^s.tv_sec.format[%.0f].^s.tv_usec.format[%06.0f] !$status:memory hash !used Includes some pages that were allocated but never written. !free !ever_allocated_since_compact Return the number of bytes allocated since the last collection. !ever_allocated_since_start Return the total number of bytes [EVER(c)PAF] allocated in this process. Never decreases. !$status:pid process id !$status:tid thread id console $console:timeout !$console:line read/write ñòðîêó DATA::=string | file | hash !hash âèäà [ $.file[èìÿ ôàéëà íà äèñêå] $.name[èìÿ ôàéëà äëÿ ïîëüçîâàòåëÿ] $.mdate[date] ] !MAIN ýòî êëàññ, çàãðóæàåìûé íà àâòîìàòå èç êîíôèãóðàöèîííîãî auto.p, êó÷è auto.p è çàïðàøèâàåìîãî äîêóìåíòà: !êîíôèãóðàöèîííûé auto.p cgi: 1. èëè ïîëíûé ïóòü èç ïåðåìåííîé îêðóæåíèÿ CGI_PARSER_SITE_CONFIG èëè ðÿäîì ñ áèíàðíèêîì parser'à isapi: windows directory apache module: 1) ParserConfig [can be in .htaccess] !auto.p âíèç îò DOCUMENT_ROOT/ ïî äåðåâó äî êàòàëîãà ñ îáðàáàòûâàåìûì ôàéëîì âêëþ÷èòåëüíî êëàññ ñîáèðàåòñÿ èç âñåõ ýòèõ ôàéëîâ, ïîñëåäóþùèå ñòàíîâÿòñÿ ðîäèòåëÿìè ïðåäûäóùèõ èìÿ ïîñëåäíåãî çàãðóæåííîãî MAIN, èì¸í ó ïðåäûäóùèõ íåò !ïîñëå çàãðóçêè MAIN êëàññà âûçûâàåòñÿ åãî @main[] !ðåçóëüòàò êîòîðîãî ïåðåäà¸òñÿ â åãî @postprocess[data] if($data is string) ... !ðåçóëüòàò êîòîðîãî îòäà¸òñÿ ïîëüçîâàòåëþ !åñëè âñòðå÷àåòñÿ îøèáêà è try íå çàäàí, å¸ ìîæíî êðàñèâî ñîîáùèòü ïîëüçîâàòåëþ, !îïðåäåëèâ !@unhandled_exception[exception;stack] !$exception.type ñòðîêà "òèï ïðîáëåìû" !$exception.file $exception.lineno $exception.colno ôàéë, ñòðîêà è ïîçèöèÿ, ãäå ñëó÷èëàñü ïðîáëåìà [åñëè íå çàïðåùåíû ïðè êîìïèëÿöèè] !$exception.source ñòðîêà, èç-çà êîòîðîé ñëó÷èëàñü ïðîáëåìà !$exception.comment êîììåíòàðèé english !stack òàáëè÷êà èç êîëîíîê file line name, òàì ëåæàò â îáðàòíîì ïîðÿäêå èìåíà[name] è ìåñòà âûçîâîâ[file line] îïåðàòîðîâ/ìåòîäîâ, ïðèâåäøèõ ê îøèáêå. !ïðè çàãðóçêå ôàéëà (file::load, table::load, xdoc::load) ìîæíî óêàçàòü òàêîå èìÿ ôàéëà: !http://domain/document[?params<> ñîçäàåò http.status îøèáêó, !ýòî ìîæíî îòêëþ÷èòü, ïåðåäàâ !$.any-status(1) !$.charset[êîäèðîâêà óäàë¸ííûõ äîêóìåòîâ ïî-óìîë÷àíèþ] << åñëè ñåðâåð âåðí¸ò content-type:charset=ÎÍÀ_ÏÅÐÅÁÈÂÀÅÒ !$.user[ïîëüçîâàòåëü] !$.password[ïàðîëü] !file::load â äîïîëíèòåëüíûå ïîëÿ çàïèñûâàåò !ÏÎËÅ:çíà÷åíèå (èìåíà ïîëåé îòâåòà çàãëàâíûìè áóêâàìè) !tables << õåø èõ ÏÎËÅ->table ñ åäèíñòâåííûì ñòîëáöîì "value". â òàêèõ òàáëèöàõ ìîæíî áðàòü ïîâòîðÿþùèåñÿ çàãîëîâêè. íàïðèìåð, íåñêîëüêî set-cookies todo:ñäåëàòü îòäåëüíûé cookies !ñèñòåìíûå òèïû îøèáîê: !parser.compile ^test[} êîìïèëÿöèÿ (íåïàðíàÿ ñêîáêà, ...) !parser.runtime ^if(0). ïàðàìåòðû (áîëüøå/ìåíüøå, ÷åì íóæíî, íå òåõ òèïîâ, ...) !number.zerodivision ^eval(1/0) ^eval(1%0) !number.format ^eval(abc*5) !file.lock shared/exclusive lock error !file.missing ^file:delete[delme] not found !file.access ^table::load[.] no rights !file.read ^file::load[...] error while reading file !file.seek seek failed !file.execute ^file::cgi[...] incorrect cgi header/can't execute !image.format ^image::measure[index.html] not gif/jpg !sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout !sql.execute ^void:sql{select bad} syntax error sql.duplicate sql.access sql.missing sql.xxx [serge asked] !xml ^xdoc::create{} any error in xml/xslt libs !smtp.connect not found/timeout !smtp.execute communication error !email.format hren tam@null.ru wrong email format(bad chars/empty) !email.send $MAIL.sendmail[/shit] sendmail not executable !http.host ^file::load[http://notfound/there] host not found !http.connect ^file::load[http://not_accepting/there] host found, but do not accept connections !http.timeout ^file::load[http://host/doc] whole load operation failed to complete in # seconds !http.response ^file::load[http://ok/there] host found, connection accepted, bad answer !http.status ^file::load[http://ok/there] host found, connection accepted, status!=200 !date.range ^date::create(1950;1;1) date out of valid range !íóæíî âûêëþ÷èòü ðóññêèé apache: CharsetDisable on Xåñëè â MAIN áóäåò îïðåäåë¸í ôëàã $ORIGINS(1) òî âìåñòî îáû÷íîãî âûâîäà ñòðàíèöû áóäåò âûäàí ñïèñîê ôðàãìåíòîâ ðåçóëüòàòà ñ óêàçàíèåì èõ ïðîèñõîæäåíèÿ !åñëè â MAIN îïðåäåë¸í $SIGPIPE(1) òî â ñëó÷àå, åñëè îáðàáîòêà áûëà ïðåðâàíà ïîëüçîâàòåëåì, ñîîáùåíèå îá ýòîì áóäåò çàïèñàíî â parser3.log (ðàíüøå îíî âñåãäà ïèñàëîñü) !åñëè îïèñàíèå ìåòîäà ñîäåðæèò ëîêàëüíóþ ïåðåìåííóþ result â ÿâíîì âèäå (åñòü è íåÿâíàÿ ïåðåìåííàÿ) òî êîä âûâîäà ñòðîêîâûõ ëèòåðàëîâ íå ïîïàäàåò â êîíå÷íûé áàéò-êîä, à íåïðîáåëüíûå ñèìâîëû ñ÷èòàþòñÿ ñèíòàêñè÷åñêîé îøèáêîé äëÿ âûâîäà ÷åãî áû òî íè áûëî íàäî ïîëüçîâàòüñÿ ýòîé ïåðåìåííîé parser-3.4.3/gnu.vcproj000644 000000 000000 00000004201 10734724454 015141 0ustar00rootwheel000000 000000 parser-3.4.3/aclocal.m4000644 000000 000000 00000104766 12234222474 014774 0ustar00rootwheel000000 000000 # generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [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, 2005, 2006, 2008 # 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. # serial 9 # 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])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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. # 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.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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. # serial 2 # 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, 2005, 2009 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. # serial 4 # 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 this is the am__doit target .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 # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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 ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( 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)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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. # serial 2 # _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 m4_include([src/lib/ltdl/m4/argz.m4]) m4_include([src/lib/ltdl/m4/libtool.m4]) m4_include([src/lib/ltdl/m4/ltdl.m4]) m4_include([src/lib/ltdl/m4/ltoptions.m4]) m4_include([src/lib/ltdl/m4/ltsugar.m4]) m4_include([src/lib/ltdl/m4/ltversion.m4]) m4_include([src/lib/ltdl/m4/lt~obsolete.m4]) parser-3.4.3/AUTHORS000644 000000 000000 00000000255 12166314563 014175 0ustar00rootwheel000000 000000 Alexandr Petrosian (http://paf.design.ru) Michael Petrushin (http://misha.design.ru) Konstantin Morshnev (http://moko.ru) parser-3.4.3/config.guess000644 000000 000000 00000126755 11764645505 015466 0ustar00rootwheel000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-10-01' # This file 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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 Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo hexagon-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: parser-3.4.3/NEWS000644 000000 000000 00000000000 07426215136 013607 0ustar00rootwheel000000 000000 parser-3.4.3/bin/Makefile.in000644 000000 000000 00000030654 11766635214 015754 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = bin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/auto.p.dist.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = auto.p.dist CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(confdir)" DATA = $(conf_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ confdir = @bindir@ conf_DATA = auto.p.dist all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bin/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 $(am__aclocal_m4_deps): auto.p.dist: $(top_builddir)/config.status $(srcdir)/auto.p.dist.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-confDATA: $(conf_DATA) @$(NORMAL_INSTALL) test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)" @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \ done uninstall-confDATA: @$(NORMAL_UNINSTALL) @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(confdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(confdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(confdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-confDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-confDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-confDATA install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-confDATA # 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: parser-3.4.3/bin/Makefile.am000644 000000 000000 00000000047 07504355454 015734 0ustar00rootwheel000000 000000 confdir=@bindir@ conf_DATA=auto.p.dist parser-3.4.3/bin/auto.p.dist.in000644 000000 000000 00000010453 12230467111 016364 0ustar00rootwheel000000 000000 #$Id: auto.p.dist.in,v 1.19 2013/10/19 11:34:33 misha Exp $ @conf[filespec] $confdir[^file:dirname[$filespec]] $charsetsdir[$confdir/charsets] $sqldriversdir[$confdir/lib] $CHARSETS[ # $.cp866[$charsetsdir/cp866.cfg] # $.koi8-r[$charsetsdir/koi8-r.cfg] # $.koi8-u[$charsetsdir/koi8-u.cfg] # $.windows-1250[$charsetsdir/windows-1250.cfg] # $.windows-1251[$charsetsdir/windows-1251.cfg] # $.windows-1254[$charsetsdir/windows-1254.cfg] # $.windows-1257[$charsetsdir/windows-1257.cfg] # $.x-mac-cyrillic[$charsetsdir/x-mac-cyrillic.cfg] ] #change your client libraries paths to those on your system $SQL[ $.drivers[^table::create{protocol driver client mysql $sqldriversdir/libparser3mysql.@dll_extension@ libmysqlclient.@dll_extension@ #sqlite $sqldriversdir/libparser3sqlite.@dll_extension@ sqlite3.@dll_extension@ #pgsql $sqldriversdir/libparser3pgsql.@dll_extension@ libpq.@dll_extension@ #oracle $sqldriversdir/libparser3oracle.@dll_extension@ libclntsh.@dll_extension@ }] ] #for ^file::load[name;user-name] mime-type autodetection $MIME-TYPES[^table::create{ext mime-type 7z application/x-7z-compressed au audio/basic avi video/x-msvideo css text/css cvs text/csv doc application/msword docx application/vnd.openxmlformats-officedocument.wordprocessingml.document dtd application/xml-dtd gif image/gif gz application/x-gzip htm text/html html text/html ico image/x-icon jpeg image/jpeg jpg image/jpeg js application/javascript log text/plain mid audio/midi midi audio/midi mov video/quicktime mp3 audio/mpeg mpg video/mpeg mpeg video/mpeg mts application/metastream pdf application/pdf png image/png ppt application/powerpoint ra audio/x-realaudio ram audio/x-pn-realaudio rar application/x-rar-compressed rdf application/rdf+xml rpm audio/x-pn-realaudio-plugin rss application/rss+xml rtf application/rtf svg image/svg+xml swf application/x-shockwave-flash tar application/x-tar tgz application/x-gzip tif image/tiff txt text/plain wav audio/x-wav xls application/vnd.ms-excel xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xml text/xml xsl text/xml zip application/zip }] $LIMITS[ $.post_max_size(10*0x400*0x400) ] #$MAIL[ # $.sendmail[your sendmail command goes here] # these are tried when no 'sendmail' specified: # /usr/sbin/sendmail -t -i -f postmaster # /usr/lib/sendmail -t -i -f postmaster #] @fatal_error[title;subtitle;body] $response:status(500) $response:content-type[ $.value[text/html] $.charset[$response:charset] ] $title

^if(def $subtitle){$subtitle;$title}

$body #for [x] MSIE friendly ^for[i](0;512/8){} @unhandled_exception_debug[exception;stack] ^fatal_error[Unhandled Exception^if(def $exception.type){ ($exception.type)};$exception.source;
^untaint[html]{$exception.comment}
^if(def $exception.file){ ^untaint[html]{$exception.file^(${exception.lineno}:$exception.colno^)} } ^if($stack){
^stack.menu{ }
$stack.name$stack.file^(${stack.lineno}:$stack.colno^)
} ] @unhandled_exception_release[exception;stack] ^fatal_error[Unhandled Exception;;

The server encountered an unhandled exception and was unable to complete your request.

Please contact the server administrator, $env:SERVER_ADMIN and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the Parser error log or in debug version of unhandled_exception.

] @is_developer[] #change mask to your ip address $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$]) @unhandled_exception[exception;stack] #developer? use debug version to see problem details ^if(^is_developer[]){ ^unhandled_exception_debug[$exception;$stack] }{ ^if($exception.type eq "file.missing"){ # ^log404[] # ^location[/404/] $response:status(404) }{ ^unhandled_exception_release[$exception;$stack] } } @auto[] #source/client charsets $request:charset[utf-8] $response:charset[utf-8] $response:content-type[ $.value[text/html] $.charset[$response:charset] ] #$SQL.connect-string[mysql://user:pass@host/db?charset=utf8] #$SQL.connect-string[sqlite://db] #$SQL.connect-string[pgsql://user:pass@host/db] #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password] parser-3.4.3/etc/Makefile.in000644 000000 000000 00000042646 11766635214 015763 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = etc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = parser3.charsets all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/etc/parser3.charsets/000755 000000 000000 00000000000 12234223576 017067 5ustar00rootwheel000000 000000 parser-3.4.3/etc/Makefile.am000644 000000 000000 00000000033 07503631237 015725 0ustar00rootwheel000000 000000 SUBDIRS = parser3.charsets parser-3.4.3/etc/parser3.charsets/windows-1257.cfg000644 000000 000000 00000011075 11445753747 021655 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x20AC 0x82 0x201A 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x89 0x2030 0x8B 0x2039 0x8D 0x00A8 0x8E 0x02C7 0x8F 0x00B8 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x99 0x2122 0x9B 0x203A 0x9D 0x00AF 0x9E 0x02DB 0xA0 x 0xA2 0xA3 0xA4 0xA6 0xA7 0xA8 x x 0xB8 0x00D8 0xA9 0xAA x x 0xBA 0x0156 0xAB 0xAC 0xAD 0xAE 0xAF x x 0xBF 0x00C6 0xB0 0xB1 0xB2 x x 0xB3 x x 0xB4 0xB5 0xB6 0xB7 0xB8 x x 0x00F8 0xB9 x x 0xBA x x 0x0157 0xBB 0xBC 0xBD 0xBE 0xBF x x 0x00E6 0xC0 x x 0xE0 0x0104 0xC1 x x 0xE1 0x012E 0xC2 x x 0xE2 0x0100 0xC3 x x 0xE3 0x0106 0xC4 x x 0xE4 0xC5 x x 0xE5 0xC6 x x 0xE6 0x0118 0xC7 x x 0xE7 0x0112 0xC8 x x 0xE8 0x010C 0xC9 x x 0xE9 0xCA x x 0xEA 0x0179 0xCB x x 0xEB 0x0116 0xCC x x 0xEC 0x0122 0xCD x x 0xED 0x0136 0xCE x x 0xEE 0x012A 0xCF x x 0xEF 0x013B 0xD0 x x 0xF0 0x0160 0xD1 x x 0xF1 0x0143 0xD2 x x 0xF2 0x0145 0xD3 x x 0xF3 0xD4 x x 0xF4 0x014C 0xD5 x x 0xF5 0xD6 x x 0xF6 0xD7 0xD8 x x 0xF8 0x0172 0xD9 x x 0xF9 0x0141 0xDA x x 0xFA 0x015A 0xDB x x 0xFB 0x016A 0xDC x x 0xFC 0xDD x x 0xFD 0x017B 0xDE x x 0xFE 0x017D 0xDF x x 0xE0 x x 0x0105 0xE1 x x 0x012F 0xE2 x x 0x0101 0xE3 x x 0x0107 0xE4 x x 0xE5 x x 0xE6 x x 0x0119 0xE7 x x 0x0113 0xE8 x x 0x010D 0xE9 x x 0xEA x x 0x017A 0xEB x x 0x0117 0xEC x x 0x0123 0xED x x 0x0137 0xEE x x 0x012B 0xEF x x 0x013C 0xF0 x x 0x0161 0xF1 x x 0x0144 0xF2 x x 0x0146 0xF3 x x 0xF4 x x 0x014D 0xF5 x x 0xF6 x x 0xF7 0xF8 x x 0x0173 0xF9 x x 0x0142 0xFA x x 0x015B 0xFB x x 0x016B 0xFC x x 0xFD x x 0x017C 0xFE x x 0x017E 0xFF 0x02D9 #$Id: windows-1257.cfg,v 1.3 2010/09/20 21:53:43 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT parser-3.4.3/etc/parser3.charsets/Makefile.in000644 000000 000000 00000031041 11766635214 021140 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = etc/parser3.charsets DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(charsetsdir)" DATA = $(charsets_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ charsetsdir = @datadir@/charsets charsets_DATA = cp866.cfg koi8-r.cfg koi8-u.cfg windows-1250.cfg windows-1251.cfg windows-1254.cfg windows-1257.cfg x-mac-cyrillic.cfg EXTRA_DIST = $(charsets_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/parser3.charsets/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/parser3.charsets/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-charsetsDATA: $(charsets_DATA) @$(NORMAL_INSTALL) test -z "$(charsetsdir)" || $(MKDIR_P) "$(DESTDIR)$(charsetsdir)" @list='$(charsets_DATA)'; test -n "$(charsetsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(charsetsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(charsetsdir)" || exit $$?; \ done uninstall-charsetsDATA: @$(NORMAL_UNINSTALL) @list='$(charsets_DATA)'; test -n "$(charsetsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(charsetsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(charsetsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(charsetsdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-charsetsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-charsetsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-charsetsDATA install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-charsetsDATA # 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: parser-3.4.3/etc/parser3.charsets/windows-1251.cfg000644 000000 000000 00000012010 11445753746 021634 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 x x 0x90 0x0402 0x81 x x 0x83 0x0403 0x82 0x201A 0x83 x x 0x0453 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x88 0x20AC 0x89 0x2030 0x8A x x 0x9A 0x0409 0x8B 0x2039 0x8C x x 0x9C 0x040A 0x8D x x 0x9D 0x040C 0x8E x x 0x9E 0x040B 0x8F x x 0x9F 0x040F 0x90 x x 0x0452 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x99 0x2122 0x9A x x 0x0459 0x9B 0x203A 0x9C x x 0x045A 0x9D x x 0x045C 0x9E x x 0x045B 0x9F x x 0x045F 0xA0 x 0xA1 x x 0xA2 0x040E 0xA2 x x 0x045E 0xA3 x x 0xBC 0x0408 0xA4 0xA5 x x 0xB4 0x0490 0xA6 0xA7 0xA8 x x 0xB8 0x0401 0xA9 0xAA x x 0xBA 0x0404 0xAB 0xAC 0xAD 0xAE 0xAF x x 0xBF 0x0407 0xB0 0xB1 0xB2 x x 0xB3 0x0406 0xB3 x x 0x0456 0xB4 x x 0x0491 0xB5 0xB6 0xB7 0xB8 x x 0x0451 0xB9 0x2116 0xBA x x 0x0454 0xBB 0xBC x x 0x0458 0xBD x x 0xBE 0x0405 0xBE x x 0x0455 0xBF x x 0x0457 0xC0 x x 0xE0 0x0410 0xC1 x x 0xE1 0x0411 0xC2 x x 0xE2 0x0412 0xC3 x x 0xE3 0x0413 0xC4 x x 0xE4 0x0414 0xC5 x x 0xE5 0x0415 0xC6 x x 0xE6 0x0416 0xC7 x x 0xE7 0x0417 0xC8 x x 0xE8 0x0418 0xC9 x x 0xE9 0x0419 0xCA x x 0xEA 0x041A 0xCB x x 0xEB 0x041B 0xCC x x 0xEC 0x041C 0xCD x x 0xED 0x041D 0xCE x x 0xEE 0x041E 0xCF x x 0xEF 0x041F 0xD0 x x 0xF0 0x0420 0xD1 x x 0xF1 0x0421 0xD2 x x 0xF2 0x0422 0xD3 x x 0xF3 0x0423 0xD4 x x 0xF4 0x0424 0xD5 x x 0xF5 0x0425 0xD6 x x 0xF6 0x0426 0xD7 x x 0xF7 0x0427 0xD8 x x 0xF8 0x0428 0xD9 x x 0xF9 0x0429 0xDA x x 0xFA 0x042A 0xDB x x 0xFB 0x042B 0xDC x x 0xFC 0x042C 0xDD x x 0xFD 0x042D 0xDE x x 0xFE 0x042E 0xDF x x 0xFF 0x042F 0xE0 x x 0x0430 0xE1 x x 0x0431 0xE2 x x 0x0432 0xE3 x x 0x0433 0xE4 x x 0x0434 0xE5 x x 0x0435 0xE6 x x 0x0436 0xE7 x x 0x0437 0xE8 x x 0x0438 0xE9 x x 0x0439 0xEA x x 0x043A 0xEB x x 0x043B 0xEC x x 0x043C 0xED x x 0x043D 0xEE x x 0x043E 0xEF x x 0x043F 0xF0 x x 0x0440 0xF1 x x 0x0441 0xF2 x x 0x0442 0xF3 x x 0x0443 0xF4 x x 0x0444 0xF5 x x 0x0445 0xF6 x x 0x0446 0xF7 x x 0x0447 0xF8 x x 0x0448 0xF9 x x 0x0449 0xFA x x 0x044A 0xFB x x 0x044B 0xFC x x 0x044C 0xFD x x 0x044D 0xFE x x 0x044E 0xFF x x 0x044F #$Id: windows-1251.cfg,v 1.14 2010/09/20 21:53:42 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT parser-3.4.3/etc/parser3.charsets/windows-1254.cfg000644 000000 000000 00000010557 11445753746 021655 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x20AC 0x82 0x201A 0x83 x x 0x0192 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x88 0x02C6 0x89 0x2030 0x8A x x 0x9A 0x0160 0x8B 0x2039 0x8C x x 0x9C 0x0152 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x98 0x02DC 0x99 0x2122 0x9A x x 0x0161 0x9B 0x203A 0x9C x x 0x0153 0x9F x x 0xFF 0x0178 0xA0 x 0xA1 0xA2 0xA3 0xA4 0xA5 0xA6 0xA7 0xA8 0xA9 0xAA 0xAB 0xAC 0xAD 0xAE 0xAF 0xB0 0xB1 0xB2 x x 0xB3 x x 0xB4 0xB5 0xB6 0xB7 0xB8 0xB9 x x 0xBA 0xBB 0xBC 0xBD 0xBE 0xBF 0xC0 x x 0xE0 0xC1 x x 0xE1 0xC2 x x 0xE2 0xC3 x x 0xE3 0xC4 x x 0xE4 0xC5 x x 0xE5 0xC6 x x 0xE6 0xC7 x x 0xE7 0xC8 x x 0xE8 0xC9 x x 0xE9 0xCA x x 0xEA 0xCB x x 0xEB 0xCC x x 0xEC 0xCD x x 0xED 0xCE x x 0xEE 0xCF x x 0xEF 0xD0 x x 0xF0 0x011E 0xD1 x x 0xF1 0xD2 x x 0xF2 0xD3 x x 0xF3 0xD4 x x 0xF4 0xD5 x x 0xF5 0xD6 x x 0xF6 0xD7 0xD8 x x 0xF8 0xD9 x x 0xF9 0xDA x x 0xFA 0xDB x x 0xFB 0xDC x x 0xFC 0xDD x x 0x0130 0xDE x x 0xFE 0x015E 0xDF x x 0xE0 x x 0xE1 x x 0xE2 x x 0xE3 x x 0xE4 x x 0xE5 x x 0xE6 x x 0xE7 x x 0xE8 x x 0xE9 x x 0xEA x x 0xEB x x 0xEC x x 0xED x x 0xEE x x 0xEF x x 0xF0 x x 0x011F 0xF1 x x 0xF2 x x 0xF3 x x 0xF4 x x 0xF5 x x 0xF6 x x 0xF7 0xF8 x x 0xF9 x x 0xFA x x 0xFB x x 0xFC x x 0xFD x x 0x0131 0xFE x x 0x015F 0xFF x x #$Id: windows-1254.cfg,v 1.2 2010/09/20 21:53:42 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT parser-3.4.3/etc/parser3.charsets/cp866.cfg000644 000000 000000 00000012015 11534227423 020412 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 x x 0xA0 0x0410 0x81 x x 0xA1 0x0411 0x82 x x 0xA2 0x0412 0x83 x x 0xA3 0x0413 0x84 x x 0xA4 0x0414 0x85 x x 0xA5 0x0415 0x86 x x 0xA6 0x0416 0x87 x x 0xA7 0x0417 0x88 x x 0xA8 0x0418 0x89 x x 0xA9 0x0419 0x8A x x 0xAA 0x041A 0x8B x x 0xAB 0x041B 0x8C x x 0xAC 0x041C 0x8D x x 0xAD 0x041D 0x8E x x 0xAE 0x041E 0x8F x x 0xAF 0x041F 0x90 x x 0xE0 0x0420 0x91 x x 0xE1 0x0421 0x92 x x 0xE2 0x0422 0x93 x x 0xE3 0x0423 0x94 x x 0xE4 0x0424 0x95 x x 0xE5 0x0425 0x96 x x 0xE6 0x0426 0x97 x x 0xE7 0x0427 0x98 x x 0xE8 0x0428 0x99 x x 0xE9 0x0429 0x9A x x 0xEA 0x042A 0x9B x x 0xEB 0x042B 0x9C x x 0xEC 0x042C 0x9D x x 0xED 0x042D 0x9E x x 0xEE 0x042E 0x9F x x 0xEF 0x042F 0xA0 x x 0x0430 0xA1 x x 0x0431 0xA2 x x 0x0432 0xA3 x x 0x0433 0xA4 x x 0x0434 0xA5 x x 0x0435 0xA6 x x 0x0436 0xA7 x x 0x0437 0xA8 x x 0x0438 0xA9 x x 0x0439 0xAA x x 0x043A 0xAB x x 0x043B 0xAC x x 0x043C 0xAD x x 0x043D 0xAE x x 0x043E 0xAF x x 0x043F 0xB0 0x2591 0xB1 0x2592 0xB2 0x2593 0xB3 0x2502 0xB4 0x2524 0xB5 0x2561 0xB6 0x2562 0xB7 0x2556 0xB8 0x2555 0xB9 0x2563 0xBA 0x2551 0xBB 0x2557 0xBC 0x255d 0xBD 0x255c 0xBE 0x255b 0xBF 0x2510 0xC0 0x2514 0xC1 0x2534 0xC2 0x252c 0xC3 0x251c 0xC4 0x2500 0xC5 0x253c 0xC6 0x255e 0xC7 0x255f 0xC8 0x255a 0xC9 0x2554 0xCA 0x2569 0xCB 0x2566 0xCC 0x2560 0xCD 0x2550 0xCE 0x256c 0xCF 0x2567 0xD0 0x2568 0xD1 0x2564 0xD2 0x2565 0xD3 0x2559 0xD4 0x2558 0xD5 0x2552 0xD6 0x2553 0xD7 0x256b 0xD8 0x256a 0xD9 0x2518 0xDA 0x250c 0xDB 0x2588 0xDC 0x2584 0xDD 0x258c 0xDE 0x2590 0xDF 0x2580 0xE0 x x 0x0440 0xE1 x x 0x0441 0xE2 x x 0x0442 0xE3 x x 0x0443 0xE4 x x 0x0444 0xE5 x x 0x0445 0xE6 x x 0x0446 0xE7 x x 0x0447 0xE8 x x 0x0448 0xE9 x x 0x0449 0xEA x x 0x044A 0xEB x x 0x044B 0xEC x x 0x044C 0xED x x 0x044D 0xEE x x 0x044E 0xEF x x 0x044F 0xF0 x x 0xF1 0x0401 0xF1 x x 0x0451 0xF2 x x 0xF3 0x0404 0xF3 x x 0x0454 0xF4 x x 0xF5 0x0407 0xF5 x x 0x0457 0xF6 x x 0xF7 0x040E 0xF7 x x 0x045E 0xF8 0x00b0 0xF9 0x2219 0xFA 0x00b7 0xFB 0x221a 0xFC 0x2116 0xFD 0x00a4 0xFE 0x25a0 0xFF 0x00a0 #$Id: cp866.cfg,v 1.2 2011/03/04 18:27:31 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP866.TXT parser-3.4.3/etc/parser3.charsets/koi8-r.cfg000644 000000 000000 00000011760 11446221750 020662 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x2500 0x81 0x2502 0x82 0x250C 0x83 0x2510 0x84 0x2514 0x85 0x2518 0x86 0x251C 0x87 0x2524 0x88 0x252C 0x89 0x2534 0x8A 0x253C 0x8B 0x2580 0x8C 0x2584 0x8D 0x2588 0x8E 0x258C 0x8F 0x2590 0x90 0x2591 0x91 0x2592 0x92 0x2593 0x93 0x2320 0x94 0x25A0 0x95 0x2219 0x96 0x221A 0x97 0x2248 0x98 0x2264 0x99 0x2265 0x9A 0x00A0 0x9B 0x2321 0x9C 0xB0 0x9D 0x00B2 0x9E 0x00B7 0x9F 0x00F7 0xA0 0x2550 0xA1 0x2551 0xA2 0x2552 0xA3 x x 0x0451 0xA4 0x2553 0xA5 0x2554 0xA6 0x2555 0xA7 0x2556 0xA8 0x2557 0xA9 0x2558 0xAA 0x2559 0xAB 0x255A 0xAC 0x255B 0xAD 0x255C 0xAE 0x255D 0xAF 0x255E 0xB0 0x255F 0xB1 0x2560 0xB2 0x2561 0xB3 x x 0xA3 0x0401 0xB4 0x2562 0xB5 0x2563 0xB6 0x2564 0xB7 0x2565 0xB8 0x2566 0xB9 0x2567 0xBA 0x2568 0xBB 0x2569 0xBC 0x256A 0xBD 0x256B 0xBE 0x256C 0xBF 0x00A9 0xC0 x x 0x044E 0xC1 x x 0x0430 0xC2 x x 0x0431 0xC3 x x 0x0446 0xC4 x x 0x0434 0xC5 x x 0x0435 0xC6 x x 0x0444 0xC7 x x 0x0433 0xC8 x x 0x0445 0xC9 x x 0x0438 0xCA x x 0x0439 0xCB x x 0x043A 0xCC x x 0x043B 0xCD x x 0x043C 0xCE x x 0x043D 0xCF x x 0x043E 0xD0 x x 0x043F 0xD1 x x 0x044F 0xD2 x x 0x0440 0xD3 x x 0x0441 0xD4 x x 0x0442 0xD5 x x 0x0443 0xD6 x x 0x0436 0xD7 x x 0x0432 0xD8 x x 0x044C 0xD9 x x 0x044B 0xDA x x 0x0437 0xDB x x 0x0448 0xDC x x 0x044D 0xDD x x 0x0449 0xDE x x 0x0447 0xDF x x 0x044A 0xE0 x x 0xC0 0x042E 0xE1 x x 0xC1 0x0410 0xE2 x x 0xC2 0x0411 0xE3 x x 0xC3 0x0426 0xE4 x x 0xC4 0x0414 0xE5 x x 0xC5 0x0415 0xE6 x x 0xC6 0x0424 0xE7 x x 0xC7 0x0413 0xE8 x x 0xC8 0x0425 0xE9 x x 0xC9 0x0418 0xEA x x 0xCA 0x0419 0xEB x x 0xCB 0x041A 0xEC x x 0xCC 0x041B 0xED x x 0xCD 0x041C 0xEE x x 0xCE 0x041D 0xEF x x 0xCF 0x041E 0xF0 x x 0xD0 0x041F 0xF1 x x 0xD1 0x042F 0xF2 x x 0xD2 0x0420 0xF3 x x 0xD3 0x0421 0xF4 x x 0xD4 0x0422 0xF5 x x 0xD5 0x0423 0xF6 x x 0xD6 0x0416 0xF7 x x 0xD7 0x0412 0xF8 x x 0xD8 0x042C 0xF9 x x 0xD9 0x042B 0xFA x x 0xDA 0x0417 0xFB x x 0xDB 0x0428 0xFC x x 0xDC 0x042D 0xFD x x 0xDD 0x0429 0xFE x x 0xDE 0x0427 0xFF x x 0xDF 0x042A #$Id: koi8-r.cfg,v 1.8 2010/09/21 21:30:16 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT parser-3.4.3/etc/parser3.charsets/Makefile.am000644 000000 000000 00000000277 11764601311 021123 0ustar00rootwheel000000 000000 charsetsdir=@datadir@/charsets charsets_DATA=cp866.cfg koi8-r.cfg koi8-u.cfg windows-1250.cfg windows-1251.cfg windows-1254.cfg windows-1257.cfg x-mac-cyrillic.cfg EXTRA_DIST=$(charsets_DATA)parser-3.4.3/etc/parser3.charsets/x-mac-cyrillic.cfg000644 000000 000000 00000011770 11445753747 022406 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x80 x x 0xE0 0x0410 0x81 x x 0xE1 0x0411 0x82 x x 0xE2 0x0412 0x83 x x 0xE3 0x0413 0x84 x x 0xE4 0x0414 0x85 x x 0xE5 0x0415 0x86 x x 0xE6 0x0416 0x87 x x 0xE7 0x0417 0x88 x x 0xE8 0x0418 0x89 x x 0xE9 0x0419 0x8A x x 0xEA 0x041A 0x8B x x 0xEB 0x041B 0x8C x x 0xEC 0x041C 0x8D x x 0xED 0x041D 0x8E x x 0xEE 0x041E 0x8F x x 0xEF 0x041F 0x90 x x 0xF0 0x0420 0x91 x x 0xF1 0x0421 0x92 x x 0xF2 0x0422 0x93 x x 0xF3 0x0423 0x94 x x 0xF4 0x0424 0x95 x x 0xF5 0x0425 0x96 x x 0xF6 0x0426 0x97 x x 0xF7 0x0427 0x98 x x 0xF8 0x0428 0x99 x x 0xF9 0x0429 0x9A x x 0xFA 0x042A 0x9B x x 0xFB 0x042B 0x9C x x 0xFC 0x042C 0x9D x x 0xFD 0x042D 0x9E x x 0xFE 0x042E 0x9F x x 0xDF 0x042F 0xA0 0x2020 0xA1 0x00B0 0xA2 0x0490 0xA3 0xA4 0x00A7 0xA5 0x2022 0xA6 0x00B6 0xA7 x x 0xB4 0x0406 0xA8 0x00AE 0xA9 0xAA 0x2122 0xAB 0x0402 0xAC 0x0452 0xAD 0x2260 0xAE 0x0403 0xAF 0x0453 0xB0 0x221E 0xB1 0x00B1 0xB2 0x2264 0xB3 0x2265 0xB4 x x 0x0456 0xB5 0xB6 0x0491 0xB7 0x0408 0xB8 x x 0xB9 0x0404 0xB9 x x 0x0454 0xBA x x 0xBB 0x0407 0xBB x x 0x0457 0xBC 0x0409 0xBD 0x0459 0xBE 0x040A 0xBF 0x045A 0xC0 0x0458 0xC1 0x0405 0xC2 0x00AC 0xC3 0x221A 0xC4 0x0192 0xC5 0x2248 0xC6 0x2206 0xC7 0x00AB 0xC8 0x00BB 0xC9 0x2026 0xCA x 0x00A0 0xCB 0x040B 0xCC 0x045B 0xCD 0x040C 0xCE 0x045C 0xCF 0x0455 0xD0 0x2013 0xD1 0x2014 0xD2 0x201C 0xD3 0x201D 0xD4 0x2018 0xD5 0x2019 0xD6 0x00F7 0xD7 0x201E 0xD8 0x040E 0xD9 0x045E 0xDA 0x040F 0xDB 0x045F 0xDC 0x2116 0xDD x x 0xDE 0x0401 0xDE x x 0x0451 0xDF x x 0x044F 0xE0 x x 0x0430 0xE1 x x 0x0431 0xE2 x x 0x0432 0xE3 x x 0x0433 0xE4 x x 0x0434 0xE5 x x 0x0435 0xE6 x x 0x0436 0xE7 x x 0x0437 0xE8 x x 0x0438 0xE9 x x 0x0439 0xEA x x 0x043A 0xEB x x 0x043B 0xEC x x 0x043C 0xED x x 0x043D 0xEE x x 0x043E 0xEF x x 0x043F 0xF0 x x 0x0440 0xF1 x x 0x0441 0xF2 x x 0x0442 0xF3 x x 0x0443 0xF4 x x 0x0444 0xF5 x x 0x0445 0xF6 x x 0x0446 0xF7 x x 0x0447 0xF8 x x 0x0448 0xF9 x x 0x0449 0xFA x x 0x044A 0xFB x x 0x044B 0xFC x x 0x044C 0xFD x x 0x044D 0xFE x x 0x044E 0xFF 0x20AC #$Id: x-mac-cyrillic.cfg,v 1.3 2010/09/20 21:53:43 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT parser-3.4.3/etc/parser3.charsets/windows-1250.cfg000644 000000 000000 00000011275 11445753746 021647 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x20AC 0x82 0x201A 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x89 0x2030 0x8A x x 0x9A 0x0160 0x8B 0x2039 0x8C x x 0x9C 0x015A 0x8D x x 0x9D 0x0164 0x8E x x 0x9E 0x017D 0x8F x x 0x9F 0x0179 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x99 0x2122 0x9A x x 0x0161 0x9B 0x203A 0x9C x x 0x015B 0x9D x x 0x0165 0x9E x x 0x017E 0x9F x x 0x017A 0xA0 x 0xA1 0x02C7 0xA2 0x02D8 0xA3 x x 0xB3 0x0141 0xA4 0xA5 x x 0xB9 0x0104 0xA6 0xA7 0xA8 0xA9 0xAA x x 0xBA 0x015E 0xAB 0xAC 0xAD 0xAE 0xAF x x 0xBF 0x017B 0xB0 0xB1 0xB2 0x02DB 0xB3 x x 0x0142 0xB4 0xB5 0xB6 0xB7 0xB8 0xB9 x x 0x0105 0xBA x x 0x015F 0xBB 0xBC x x 0xBE 0x013D 0xBD 0x02DD 0xBE x x 0x013E 0xBF x x 0x017C 0xC0 x x 0xE0 0x0154 0xC1 x x 0xE1 0xC2 x x 0xE2 0xC3 x x 0xE3 0x0102 0xC4 x x 0xE4 0xC5 x x 0xE5 0x0139 0xC6 x x 0xE6 0x0106 0xC7 x x 0xE7 0xC8 x x 0xE8 0x010C 0xC9 x x 0xE9 0xCA x x 0xEA 0x0118 0xCB x x 0xEB 0xCC x x 0xEC 0x011A 0xCD x x 0xED 0xCE x x 0xEE 0xCF x x 0xEF 0x010E 0xD0 x x 0xF0 0x0110 0xD1 x x 0xF1 0x0143 0xD2 x x 0xF2 0x0147 0xD3 x x 0xF3 0xD4 x x 0xF4 0xD5 x x 0xF5 0x0150 0xD6 x x 0xF6 0xD7 0xD8 x x 0xF8 0x0158 0xD9 x x 0xF9 0x016E 0xDA x x 0xFA 0xDB x x 0xFB 0x0170 0xDC x x 0xFC 0xDD x x 0xFD 0xDE x x 0xFE 0x0162 0xDF x x 0xE0 x x 0x0155 0xE1 x x 0xE2 x x 0xE3 x x 0x0103 0xE4 x x 0xE5 x x 0x013A 0xE6 x x 0x0107 0xE7 x x 0xE8 x x 0x010D 0xE9 x x 0xEA x x 0x0119 0xEB x x 0xEC x x 0x011B 0xED x x 0xEE x x 0xEF x x 0x010F 0xF0 x x 0x0111 0xF1 x x 0x0144 0xF2 x x 0x0148 0xF3 x x 0xF4 x x 0xF5 x x 0x0151 0xF6 x x 0xF7 0xF8 x x 0x0159 0xF9 x x 0x016F 0xFA x x 0xFB x x 0x0171 0xFC x x 0xFD x x 0xFE x x 0x0163 0xFF 0x02D9 #$Id: windows-1250.cfg,v 1.2 2010/09/20 21:53:42 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT parser-3.4.3/etc/parser3.charsets/koi8-u.cfg000644 000000 000000 00000012020 11446221750 020653 0ustar00rootwheel000000 000000 char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x2500 0x81 0x2502 0x82 0x250C 0x83 0x2510 0x84 0x2514 0x85 0x2518 0x86 0x251C 0x87 0x2524 0x88 0x252C 0x89 0x2534 0x8A 0x253C 0x8B 0x2580 0x8C 0x2584 0x8D 0x2588 0x8E 0x258C 0x8F 0x2590 0x90 0x2591 0x91 0x2592 0x92 0x2593 0x93 0x2320 0x94 0x25A0 0x95 0x2219 0x96 0x221A 0x97 0x2248 0x98 0x2264 0x99 0x2265 0x9A 0x00A0 0x9B 0x2321 0x9C 0xB0 0x9D 0x00B2 0x9E 0x00B7 0x9F 0x00F7 0xA0 0x2550 0xA1 0x2551 0xA2 0x2552 0xA3 x x 0x0451 0xA4 x x 0x0454 0xA5 0x2554 0xA6 x x 0x0456 0xA7 x x 0x0457 0xA8 0x2557 0xA9 0x2558 0xAA 0x2559 0xAB 0x255A 0xAC 0x255B 0xAD x x 0x0491 0xAE 0x255D 0xAF 0x255E 0xB0 0x255F 0xB1 0x2560 0xB2 0x2561 0xB3 x x 0xA3 0x0401 0xB4 x x 0xA4 0x0404 0xB5 0x2563 0xB6 x x 0xA6 0x0406 0xB7 x x 0xA7 0x0407 0xB8 0x2566 0xB9 0x2567 0xBA 0x2568 0xBB 0x2569 0xBC 0x256A 0xBD x x 0xAD 0x0490 0xBE 0x256C 0xBF 0x00A9 0xC0 x x 0x044E 0xC1 x x 0x0430 0xC2 x x 0x0431 0xC3 x x 0x0446 0xC4 x x 0x0434 0xC5 x x 0x0435 0xC6 x x 0x0444 0xC7 x x 0x0433 0xC8 x x 0x0445 0xC9 x x 0x0438 0xCA x x 0x0439 0xCB x x 0x043A 0xCC x x 0x043B 0xCD x x 0x043C 0xCE x x 0x043D 0xCF x x 0x043E 0xD0 x x 0x043F 0xD1 x x 0x044F 0xD2 x x 0x0440 0xD3 x x 0x0441 0xD4 x x 0x0442 0xD5 x x 0x0443 0xD6 x x 0x0436 0xD7 x x 0x0432 0xD8 x x 0x044C 0xD9 x x 0x044B 0xDA x x 0x0437 0xDB x x 0x0448 0xDC x x 0x044D 0xDD x x 0x0449 0xDE x x 0x0447 0xDF x x 0x044A 0xE0 x x 0xC0 0x042E 0xE1 x x 0xC1 0x0410 0xE2 x x 0xC2 0x0411 0xE3 x x 0xC3 0x0426 0xE4 x x 0xC4 0x0414 0xE5 x x 0xC5 0x0415 0xE6 x x 0xC6 0x0424 0xE7 x x 0xC7 0x0413 0xE8 x x 0xC8 0x0425 0xE9 x x 0xC9 0x0418 0xEA x x 0xCA 0x0419 0xEB x x 0xCB 0x041A 0xEC x x 0xCC 0x041B 0xED x x 0xCD 0x041C 0xEE x x 0xCE 0x041D 0xEF x x 0xCF 0x041E 0xF0 x x 0xD0 0x041F 0xF1 x x 0xD1 0x042F 0xF2 x x 0xD2 0x0420 0xF3 x x 0xD3 0x0421 0xF4 x x 0xD4 0x0422 0xF5 x x 0xD5 0x0423 0xF6 x x 0xD6 0x0416 0xF7 x x 0xD7 0x0412 0xF8 x x 0xD8 0x042C 0xF9 x x 0xD9 0x042B 0xFA x x 0xDA 0x0417 0xFB x x 0xDB 0x0428 0xFC x x 0xDC 0x042D 0xFD x x 0xDD 0x0429 0xFE x x 0xDE 0x0427 0xFF x x 0xDF 0x042A #$Id: koi8-u.cfg,v 1.1 2010/09/21 21:30:16 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-U.TXT parser-3.4.3/src/sql/000755 000000 000000 00000000000 12234223575 014507 5ustar00rootwheel000000 000000 parser-3.4.3/src/targets/000755 000000 000000 00000000000 12234223575 015361 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/000755 000000 000000 00000000000 12234223575 014456 5ustar00rootwheel000000 000000 parser-3.4.3/src/Makefile.in000644 000000 000000 00000042700 11766635214 015766 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include main sql types classes lib targets all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/Makefile.am000644 000000 000000 00000000065 07522215527 015747 0ustar00rootwheel000000 000000 SUBDIRS = include main sql types classes lib targets parser-3.4.3/src/types/000755 000000 000000 00000000000 12234223575 015054 5ustar00rootwheel000000 000000 parser-3.4.3/src/include/000755 000000 000000 00000000000 12234223575 015333 5ustar00rootwheel000000 000000 parser-3.4.3/src/main/000755 000000 000000 00000000000 12234223575 014634 5ustar00rootwheel000000 000000 parser-3.4.3/src/classes/000755 000000 000000 00000000000 12234223575 015345 5ustar00rootwheel000000 000000 parser-3.4.3/src/classes/classes.vcproj000644 000000 000000 00000015045 12230131504 020216 0ustar00rootwheel000000 000000 parser-3.4.3/src/classes/hashfile.C000644 000000 000000 00000011543 12230062002 017216 0ustar00rootwheel000000 000000 /** @file Parser: @b hashfile parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_request.h" #include "pa_vmethod_frame.h" #include "pa_vhashfile.h" #include "pa_vhash.h" volatile const char * IDENT_HASHFILE_C="$Id: hashfile.C,v 1.55 2013/10/17 22:26:10 moko Exp $"; // class class MHashfile : public Methoded { public: // VStateless_class Value *create_new_value(Pool& apool) { return new VHashfile(apool); } public: MHashfile(); }; // global variable DECLARE_CLASS_VAR(hashfile, new MHashfile, 0); // defines for statics #define OPEN_DATA_NAME "HASHFILE-OPEN-DATA" // methods typedef HashString HashStringBool; static void _open(Request& r, MethodParams& params) { HashStringBool* file_list=static_cast(r.classes_conf.get(OPEN_DATA_NAME)); if(!file_list) { file_list=new HashStringBool(); r.classes_conf.put(OPEN_DATA_NAME, file_list); } const String& file_spec=r.absolute(params.as_string(0, FILE_NAME_MUST_BE_STRING)); if(file_list->get(file_spec)) throw Exception(PARSER_RUNTIME, 0, "this hashfile is already opened, use existing variable"); file_list->put(file_spec, true); VHashfile& self=GET_SELF(r, VHashfile); self.open(file_spec); } static void _hash(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); // write out result VHash& result=*new VHash(*self.get_hash()); r.write_no_lang(result); } static void _delete(Request& r, MethodParams& params) { VHashfile& self=GET_SELF(r, VHashfile); if(!params.count()) { // ^hashfile.delete[] asked to delete hashfile itself self.delete_files(); return; } // key const String &key=params.as_string(0, "key must be string"); // remove self.remove(key); } static void _clear(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.delete_files(); } #ifndef DOXYGEN struct Foreach_info { Request* r; const String* key_var_name; const String* value_var_name; Value* body_code; Value* delim_maybe_code; Value* var_context; bool need_delim; }; #endif static bool one_foreach_cycle( const String::Body key, const String& value, void* ainfo) { Foreach_info& info=*static_cast(ainfo); if(info.key_var_name){ VString* vkey=new VString(*new String(key, String::L_TAINTED)); info.r->put_element(*info.var_context, *info.key_var_name, vkey); } if(info.value_var_name){ VString* vvalue=new VString(value); info.r->put_element(*info.var_context, *info.value_var_name, vvalue); } StringOrValue sv_processed=info.r->process(*info.body_code); Request::Skip lskip=info.r->get_skip(); info.r->set_skip(Request::SKIP_NOTHING); const String* s_processed=sv_processed.get_string(); if(info.delim_maybe_code && s_processed && !s_processed->is_empty()) { // delimiter set and we have body if(info.need_delim) // need delim & iteration produced string? info.r->write_pass_lang(info.r->process(*info.delim_maybe_code)); else info.need_delim=true; } info.r->write_pass_lang(sv_processed); return lskip==Request::SKIP_BREAK; } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String& key_var_name=params.as_string(0, "key-var name must be string"); const String& value_var_name=params.as_string(1, "value-var name must be string"); Foreach_info info={ &r, key_var_name.is_empty()? 0 : &key_var_name, value_var_name.is_empty()? 0 : &value_var_name, ¶ms.as_junction(2, "body must be code"), /*delimiter*/params.count()>3 ? params.get(3) : 0, /*var_context*/r.get_method_frame()->caller(), false }; VHashfile& self=GET_SELF(r, VHashfile); self.for_each(one_foreach_cycle, &info); } static bool one_cleanup_cycle(const String::Body, const String&, void*) { return false; } static void _cleanup(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.for_each(one_cleanup_cycle, 0); } static void _release(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.close(); } // constructor MHashfile::MHashfile(): Methoded("hashfile") { // ^hashfile::open[filename] add_native_method("open", Method::CT_DYNAMIC, _open, 1, 1); // ^hashfile.hash[] add_native_method("hash", Method::CT_DYNAMIC, _hash, 0, 0); // ^hashfile.delete[key] add_native_method("delete", Method::CT_DYNAMIC, _delete, 0, 1); // ^hashfile.clear[] -- for backward compatibility. use .delete[] instead. add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); // ^hashfile.release[] add_native_method("release", Method::CT_DYNAMIC, _release, 0, 0); // ^hashfile.cleanup[] add_native_method("cleanup", Method::CT_DYNAMIC, _cleanup, 0, 0); add_native_method("defecate", Method::CT_DYNAMIC, _cleanup, 0, 0); // ^hashfile.foreach[key;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 2+1, 2+1+1); } parser-3.4.3/src/classes/memory.C000644 000000 000000 00000002150 11730603267 016757 0ustar00rootwheel000000 000000 /** @file Parser: @b memory parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_common.h" #include "pa_vmemory.h" #include "pa_request.h" volatile const char * IDENT_MEMORY_C="$Id: memory.C,v 1.9 2012/03/16 09:24:07 moko Exp $" IDENT_PA_VMEMORY_H; class MMemory: public Methoded { public: MMemory(); public: // Methoded bool used_directly() { return false; } }; // global variables DECLARE_CLASS_VAR(memory, 0 /*fictive*/, new MMemory); #undef GC_DEBUG #ifdef GC_DEBUG extern "C" GC_API void GC_print_backtrace(void *); void *debug_print_backtrace=0; #endif static void _compact(Request& r, MethodParams&) { r.wipe_unused_execution_stack(); #ifndef PA_DEBUG_DISABLE_GC { int saved=GC_dont_gc; GC_dont_gc=0; GC_gcollect(); GC_dont_gc=saved; } #ifdef GC_DEBUG if(debug_print_backtrace) GC_print_backtrace(debug_print_backtrace); #endif #endif } // constructor MMemory::MMemory(): Methoded("memory") { // ^compact[] add_native_method("compact", Method::CT_STATIC, _compact, 0, 0); } parser-3.4.3/src/classes/Makefile.in000644 000000 000000 00000043461 11766635214 017430 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/classes DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libclasses_la_LIBADD = am__objects_1 = bool.lo curl.lo date.lo double.lo file.lo form.lo \ hash.lo hashfile.lo image.lo inet.lo int.lo json.lo mail.lo \ math.lo memcached.lo memory.lo op.lo reflection.lo regex.lo \ response.lo string.lo table.lo void.lo xnode.lo xdoc.lo am_libclasses_la_OBJECTS = $(am__objects_1) classes.lo libclasses_la_OBJECTS = $(am_libclasses_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libclasses_la_SOURCES) DIST_SOURCES = $(libclasses_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I../types -I../sql -I../lib/gd -I../lib/gc/include -I../lib/cord/include -I../lib/sdbm/pa-include -Igd $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ -I../lib/md5 -I../lib/smtp -I../lib/json -I../lib/memcached -I../lib/curl CLASSES_SOURCE_FILES = classes.awk bool.C curl.C date.C double.C file.C form.C hash.C hashfile.C image.C inet.C int.C json.C mail.C math.C memcached.C memory.C op.C reflection.C regex.C response.C string.C table.C void.C xnode.C xdoc.C noinst_HEADERS = classes.h xnode.h noinst_LTLIBRARIES = libclasses.la libclasses_la_SOURCES = $(CLASSES_SOURCE_FILES) classes.C CLEANFILES = classes.inc EXTRA_DIST = classes.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/classes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/classes/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libclasses.la: $(libclasses_la_OBJECTS) $(libclasses_la_DEPENDENCIES) $(CXXLINK) $(libclasses_la_OBJECTS) $(libclasses_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/classes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/double.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/form.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mail.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reflection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/response.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/void.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdoc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xnode.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am classes.inc: $(CLASSES_SOURCE_FILES) Makefile.am echo "/* do not edit. autogenerated by Makefile.am */" > classes.inc echo >> classes.inc ls $(CLASSES_SOURCE_FILES) | $(AWK) -f classes.awk >> classes.inc classes.C: classes.inc # 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: parser-3.4.3/src/classes/xnode.C000644 000000 000000 00000071002 12227340624 016563 0ustar00rootwheel000000 000000 /** @file Parser: @b dom parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #ifdef XML #include "pa_vmethod_frame.h" #include "pa_charset.h" #include "pa_request.h" #include "pa_vxnode.h" #include "pa_vxdoc.h" #include "pa_vvoid.h" #include "pa_xml_exception.h" #include "pa_vbool.h" #include "xnode.h" #include "libxml/xpath.h" #include "libxml/xpathInternals.h" volatile const char * IDENT_XNODE_C="$Id: xnode.C,v 1.88 2013/10/15 22:28:36 moko Exp $" IDENT_XNODE_H; // global variable DECLARE_CLASS_VAR(xnode, new MXnode, 0); // classes class xmlXPathObject_auto_ptr { public: explicit xmlXPathObject_auto_ptr(xmlXPathObject *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlXPathObject_auto_ptr(const xmlXPathObject_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlXPathObject_auto_ptr& operator=(const xmlXPathObject_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xmlXPathFreeObject(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xmlXPathObject_auto_ptr() {if (_Owns && _Ptr) xmlXPathFreeObject(_Ptr); } xmlXPathObject& operator*() const {return (*get()); } xmlXPathObject *operator->() const {return (get()); } xmlXPathObject *get() const {return (_Ptr); } xmlXPathObject *release() const {((xmlXPathObject_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xmlXPathObject *_Ptr; }; class xmlXPathContext_auto_ptr { public: explicit xmlXPathContext_auto_ptr(xmlXPathContext *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlXPathContext_auto_ptr(const xmlXPathContext_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlXPathContext_auto_ptr& operator=(const xmlXPathContext_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xmlXPathFreeContext(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xmlXPathContext_auto_ptr() {if (_Owns && _Ptr) xmlXPathFreeContext(_Ptr); } xmlXPathContext& operator*() const {return (*get()); } xmlXPathContext *operator->() const {return (get()); } xmlXPathContext *get() const {return (_Ptr); } xmlXPathContext *release() const {((xmlXPathContext_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xmlXPathContext *_Ptr; }; // helpers xmlNode& as_node(MethodParams& params, int index, const char* msg) { Value& value=params.as_no_junction(index, msg); if(Value* vxnode=value.as(VXNODE_TYPE)) return static_cast(vxnode)->get_xmlnode(); else throw Exception(PARSER_RUNTIME, 0, msg); } xmlChar* as_xmlchar(Request& r, MethodParams& params, int index, const char* msg) { return r.transcode(params.as_string(index, msg)); } xmlChar* as_xmlqname(Request& r, MethodParams& params, int index, const char* msg) { xmlChar* qname=r.transcode(params.as_string(index, msg ? msg : XML_QUALIFIED_NAME_MUST_BE_STRING)); if(xmlValidateQName(qname, 0)) throw XmlException(0, XML_INVALID_QUALIFIED_NAME, qname); return qname; } xmlChar* as_xmlncname(Request& r, MethodParams& params, int index, const char* msg) { xmlChar* ncname=r.transcode(params.as_string(index, msg ? msg : XML_NC_NAME_MUST_BE_STRING)); if(xmlValidateNCName(ncname, 0)) throw XmlException(0, XML_INVALID_NC_NAME, ncname); return ncname; } xmlChar* as_xmlname(Request& r, MethodParams& params, int index, const char* msg) { xmlChar* localName=r.transcode(params.as_string(index, msg ? msg : XML_LOCAL_NAME_MUST_BE_STRING)); if(xmlValidateName(localName, 0)) throw XmlException(0, XML_INVALID_LOCAL_NAME, localName); return localName; } xmlChar* as_xmlnsuri(Request& r, MethodParams& params, int index) { return r.transcode(params.as_string(index, XML_NAMESPACEURI_MUST_BE_STRING)); } xmlAttr& as_attr(MethodParams& params, int index, const char* msg) { xmlNode& xmlnode=as_node(params, index, msg); if(xmlnode.type!=XML_ATTRIBUTE_NODE) throw Exception(PARSER_RUNTIME, 0, msg); return *(xmlAttr*)&xmlnode; } static void writeNode(Request& r, VXdoc& xdoc, xmlNode* node) { if(!node|| xmlHaveGenericErrors()) throw XmlException(0, r); // OOM, bad name, things like that // write out result r.write_no_lang(xdoc.wrap(*node)); } static xmlNode* pa_getAttributeNodeNS(xmlNode& selfNode, const xmlChar* localName, const xmlChar* namespaceURI) { for(xmlNode* currentNode=(xmlNode*)selfNode.properties; currentNode; currentNode=currentNode->next) { if(!namespaceURI || currentNode->ns && xmlStrEqual(currentNode->ns->href, namespaceURI)) if(!localName || xmlStrEqual(currentNode->name, localName)) return currentNode; } return 0; } xmlNs& pa_xmlMapNs(xmlDoc& doc, const xmlChar *href, const xmlChar *prefix) { assert(href); // prefix can be null xmlNs *cur=doc.oldNs; while (cur != NULL && ((cur->prefix == NULL && prefix != NULL) || (cur->prefix != NULL && prefix == NULL) || !xmlStrEqual (cur->prefix, prefix)) && !xmlStrEqual (cur->href, href)) cur = cur->next; if (cur == NULL) { cur = xmlNewNs (NULL, href, prefix); if(!cur || xmlHaveGenericErrors()) throw XmlException(); cur->next = doc.oldNs; doc.oldNs = cur; } return *cur; } /// @todo: ïðîâåðèòü, îáíîâëÿåòñÿ ëè parent! static void pa_addAttributeNode(xmlNode& selfNode, xmlAttr& attrNode) { if(attrNode.type!=XML_ATTRIBUTE_NODE) throw Exception(PARSER_RUNTIME, 0, "must be ATTRIBUTE_NODE"); /* * Add it at the end to preserve parsing order ... */ if (selfNode.properties == NULL) { selfNode.properties = &attrNode; } else { xmlAttrPtr prev = selfNode.properties; while (prev->next != NULL) prev = prev->next; prev->next = &attrNode; attrNode.prev = prev; } if (xmlIsID(selfNode.doc, &selfNode, &attrNode) == 1) xmlAddID(NULL, selfNode.doc, xmlNodeGetContent((xmlNode*)&attrNode), &attrNode); } static const xmlChar * pa_xmlGetNsURI(xmlNode *node) { if (node == NULL || node->ns == NULL) return NULL; return node->ns->href; } #ifndef DOXYGEN struct AccumulateFoundInfo { HashStringValue* hash; VXdoc* vdoc; int index; }; #endif static void AccumulateFound(xmlNode& node, AccumulateFoundInfo* info) { info->hash->put( String::Body::Format(info->index++), &info->vdoc->wrap(node)); } template static void pa_xmlNamedPreorderTraversal ( xmlNode *root, xmlChar *tagURI, xmlChar *tagName, void callback(xmlNode& node, I info), I info) { for(xmlNode *iter=root->children; iter; iter = iter->next) { if(iter->type == XML_ELEMENT_NODE && (xmlStrEqual(iter->name, tagName) || xmlStrEqual(tagName, (const xmlChar*)"*"))) { if(tagURI != NULL && (xmlStrEqual(pa_xmlGetNsURI(iter), tagURI) || xmlStrEqual(tagURI, (const xmlChar*)"*"))) callback(*iter, info); else if(tagURI == NULL) callback(*iter, info); } pa_xmlNamedPreorderTraversal(iter, tagURI, tagName, callback, info); } return; } // methods // DOM1 node // Node insertBefore(in Node newChild,in Node refChild) raises(DOMException); static void _insertBefore(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); xmlNode& refChild=as_node(params, 1, "refChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); //xmlNode& selfNode=vnode.get_xmlnode(); xmlNode* retNode=xmlAddPrevSibling(&refChild, &newChild); // write out result writeNode(r, vxdoc, retNode); } // Node replaceChild(in Node newChild,in Node oldChild) raises(DOMException); static void _replaceChild(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); xmlNode& oldChild=as_node(params, 1, "oldChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlNode& selfNode=vnode.get_xmlnode(); if(newChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(oldChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(oldChild.parent!=&selfNode) throw Exception("xml.dom", 0, "NOT_FOUND_ERR"); xmlNode* refChild=oldChild.next; xmlUnlinkNode(&oldChild); xmlNode* retNode; if(refChild) retNode=xmlAddPrevSibling(refChild, &newChild); else retNode=xmlAddChild(&selfNode, &newChild); // write out result writeNode(r, vxdoc, retNode); } // Node removeChild(in Node oldChild) raises(DOMException); static void _removeChild(Request& r, MethodParams& params) { xmlNode& oldChild=as_node(params, 0, "refChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); // xmlNode& selfNode=vnode.get_xmlnode(); if(oldChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); xmlUnlinkNode(&oldChild); // write out result writeNode(r, vxdoc, &oldChild); } // Node appendChild(in Node newChild) raises(DOMException); static void _appendChild(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& selfNode=vnode.get_xmlnode(); xmlNode* retNode=xmlAddChild(&selfNode, &newChild); // write out result writeNode(r, vxdoc, retNode); } // boolean hasChildNodes(); static void _hasChildNodes(Request& r, MethodParams&) { VXnode& vnode=GET_SELF(r, VXnode); xmlNode& node=vnode.get_xmlnode(); // write out result r.write_no_lang(VBool::get(node.children!=0)); } // Node cloneNode(in boolean deep); static void _cloneNode(Request& r, MethodParams& params) { bool deep=params.as_bool(0, "deep must be bool", r); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& selfNode=vnode.get_xmlnode(); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlNode* retNode=xmlDocCopyNode(&selfNode, &xmldoc, deep?1: 0); // write out result writeNode(r, vxdoc, retNode); } // DOM1 element xmlNode& get_self_element(VXnode& vnode) { xmlNode& node=vnode.get_xmlnode(); if(node.type!=XML_ELEMENT_NODE) throw Exception(PARSER_RUNTIME, 0, "method can only be called on nodes of ELEMENT type"); return node; } // DOMString getAttribute(in DOMString name); static void _getAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" xmlChar* attribute_value=xmlGetProp(&element, name); // write out result r.write_pass_lang(r.transcode(attribute_value)); } // void setAttribute(in DOMString name, in DOMString value) raises(DOMException); static void _setAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); const xmlChar* attribute_value=as_xmlchar(r, params, 1, XML_VALUE_MUST_BE_STRING); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" if(!xmlSetProp(&element, name, attribute_value)) throw XmlException(0, r); } // void removeAttribute(in DOMString name) raises(DOMException); static void _removeAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" xmlUnsetProp(&element, name); } // Attr getAttributeNode(in DOMString name); static void _getAttributeNode(Request& r, MethodParams& params) { const xmlChar* localName=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); if(xmlNode* retNode=pa_getAttributeNodeNS(element, localName, 0)){ // write out result writeNode(r, vxdoc, retNode); } } // Attr setAttributeNode(in Attr newAttr) raises(DOMException); // Attr setAttributeNodeNS(in Attr newAttr) raises(DOMException); static void _setAttributeNode(Request& r, MethodParams& params) { VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlAttr& newAttr=as_attr(params, 0, "newAttr must be ATTRIBUTE node"); if(newAttr.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(newAttr.parent) throw Exception("xml.dom", 0, "INUSE_ATTRIBUTE_ERR"); if(xmlNode* retNode=pa_getAttributeNodeNS(element, newAttr.name, pa_xmlGetNsURI((xmlNode*)&newAttr))) { // write out result writeNode(r, vxdoc, retNode); xmlUnlinkNode(retNode); } pa_addAttributeNode(element, newAttr); } // Attr removeAttributeNode(in Attr oldAttr) raises(DOMException); static void _removeAttributeNode(Request& r, MethodParams& params) { xmlAttr& oldAttr=as_attr(params, 0, "oldAttr must be ATTRIBUTE node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); if(oldAttr.parent!=&element) throw Exception("xml.dom", 0, "NOT_FOUND_ERR"); xmlUnlinkNode((xmlNode*)&oldAttr); // write out result writeNode(r, vxdoc, (xmlNode*)&oldAttr); } // NodeList getElementsByTagName(in DOMString name); // '*' means all tags static void _getElementsByTagName(Request& r, MethodParams& params) { xmlChar* tagName=as_xmlchar(r, params, 0, XML_LOCAL_NAME_MUST_BE_STRING); if(xmlValidateName(tagName, 0) != 0 && strcmp((const char*)tagName, "*") != 0) throw XmlException(0, XML_INVALID_LOCAL_NAME, tagName); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& xmlnode=vnode.get_xmlnode(); VHash& result=*new VHash; AccumulateFoundInfo info={&result.hash(), &vxdoc, 0}; pa_xmlNamedPreorderTraversal(&xmlnode, 0, tagName, AccumulateFound, &info); // write out result r.write_no_lang(result); } // DOM 2 // DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName); static void _getAttributeNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // todo: when name="xmlns" xmlChar* attribute_value=xmlGetNsProp(&element, localName, namespaceURI); // write out result r.write_pass_lang(r.transcode(attribute_value)); } // void setAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value) raises(DOMException); static void _setAttributeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* qualifiedName=as_xmlqname(r, params, 1); const xmlChar* attribute_value=as_xmlchar(r, params, 2, XML_VALUE_MUST_BE_STRING); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlChar* prefix=0; xmlChar* localName=xmlSplitQName2(qualifiedName, &prefix); // @todo: name=xmlns xmlAttr* attrNode; if(localName) { xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, prefix); attrNode=xmlSetNsProp(&element, &ns, localName, attribute_value); } else { attrNode=xmlSetProp(&element, qualifiedName/*unqualified, actually*/, attribute_value); } if(!attrNode) throw XmlException(0, r); } // void removeAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); static void _removeAttributeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); // @todo: when name="xmlns" xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, 0); xmlUnsetNsProp(&element, &ns, localName); } // Attr getAttributeNodeNS(in DOMString namespaceURI, in DOMString localName); static void _getAttributeNodeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); if(xmlNode* retNode=pa_getAttributeNodeNS(element, localName, namespaceURI)){ // write out result writeNode(r, vxdoc, retNode); } } // boolean hasAttribute(in DOMString name) raises(DOMException); static void _hasAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" // write out result r.write_no_lang(VBool::get(xmlHasProp(&element, name)!=0)); } // boolean hasAttributeNS(n DOMString namespaceURI, in DOMString localName) raises(DOMException); static void _hasAttributeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // write out result r.write_no_lang(VBool::get(xmlHasNsProp(&element, localName, namespaceURI)!=0)); } // boolean hasAttributes static void _hasAttributes(Request& r, MethodParams&) { VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // write out result r.write_no_lang(VBool::get(element.properties!=0)); } // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); // '*' as namespaceURI means get all namespaces // '*' as localName means get all tags static void _getElementsByTagNameNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlchar(r, params, 0, XML_NAMESPACEURI_MUST_BE_STRING); xmlChar* localName=as_xmlchar(r, params, 1, XML_LOCAL_NAME_MUST_BE_STRING); if(xmlValidateName(localName, 0) != 0 && strcmp((const char*)localName, "*") != 0) throw XmlException(0, XML_INVALID_LOCAL_NAME, localName); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vdoc.get_xmldoc(); VHash& result=*new VHash; AccumulateFoundInfo info={&result.hash(), &vdoc, 0}; pa_xmlNamedPreorderTraversal((xmlNode*)&xmldoc, namespaceURI, localName, AccumulateFound, &info); // write out result r.write_no_lang(result); } // void normalize(); static void _normalize(Request&, MethodParams&) { /*maybe someday VXnode& vnode=GET_SELF(r, VXnode); xmlNode& selfNode=vnode.get_xmlnode(); gdome_n_normalize(selfNode, &exc); if(exc) throw XmlException(0, exc); */ } #ifndef DOXYGEN struct Register_one_ns_info { Request* r; xmlXPathContextPtr ctxt; }; #endif static void register_one_ns( HashStringValue::key_type key, HashStringValue::value_type value, Register_one_ns_info* info) { if(const String* svalue=value->get_string()) xmlXPathRegisterNs(info->ctxt, info->r->transcode(key), info->r->transcode(*svalue)); else throw Exception(PARSER_RUNTIME, new String(key, String::L_TAINTED), "value is %s, must be string or number", value->type()); } static void _selectX(Request& r, MethodParams& params, void (*handler)(Request& r, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& xdoc, Value*& result)) { VXnode& vnode=GET_SELF(r, VXnode); xmlNode& xmlnode=vnode.get_xmlnode(); VXdoc& vdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vdoc.get_xmldoc(); // expression const String& expression=params.as_string(0, "expression must be string"); xmlXPathContext_auto_ptr ctxt(xmlXPathNewContext(&xmldoc)); { Register_one_ns_info info={&r, ctxt.get()}; vdoc.search_namespaces.hash().for_each(register_one_ns, &info); } ctxt->node=&xmlnode; /*error to stderr for now*/ xmlXPathObject_auto_ptr res( xmlXPathEvalExpression(r.transcode(expression), ctxt.get())); if(xmlHaveGenericErrors()) throw XmlException(0, r); Value* result=0; if(res.get()) handler(r, expression, res, vdoc, result); if(result) r.write_no_lang(*result); } static void selectNodesHandler(Request&, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& xdoc, Value*& result) { VHash& vhash=*new VHash; result=&vhash; switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_NODESET: if(res->nodesetval) if(int size=res->nodesetval->nodeNr) { HashStringValue& hash=vhash.hash(); for(int i=0; inodesetval->nodeTab[i])); } break; default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void selectNodeHandler(Request& r, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& xdoc, Value*& result) { switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_NODESET: if(res->nodesetval && res->nodesetval->nodeNr) { // empty result strangely has NODESET res->type if(res->nodesetval->nodeNr>1) throw Exception(PARSER_RUNTIME, &expression, "resulted not in a single node (%d)", res->nodesetval->nodeNr); result=&xdoc.wrap(*res->nodesetval->nodeTab[0]); } break; case XPATH_BOOLEAN: result=&VBool::get(res->boolval!=0); break; case XPATH_NUMBER: result=new VDouble(res->floatval); break; case XPATH_STRING: result=new VString(r.transcode((xmlChar*)res->stringval)); break; default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); } } static void selectBoolHandler(Request&, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& /*xdoc*/, Value*& result) { switch(res->type) { case XPATH_BOOLEAN: result=&VBool::get(res->boolval!=0); break; case XPATH_NODESET: if(!(res->nodesetval && res->nodesetval->nodeNr)) break; // else[nodeset] fall down to default default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void selectNumberHandler(Request&, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& /*xdoc*/, Value*& result) { switch(res->type) { case XPATH_NUMBER: result=new VDouble(res->floatval); break; case XPATH_NODESET: if(!(res->nodesetval && res->nodesetval->nodeNr)) break; // else[nodeset] fall down to default default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void selectStringHandler(Request& r, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& /*xdoc*/, Value*& result) { switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_STRING: result=new VString(r.transcode((xmlChar*)res->stringval)); break; case XPATH_NODESET: if(!(res->nodesetval && res->nodesetval->nodeNr)) break; // else[nodeset] fall down to default default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void _select(Request& r, MethodParams& params) { _selectX(r, params, selectNodesHandler); } static void _selectSingle(Request& r, MethodParams& params) { _selectX(r, params, selectNodeHandler); } static void _selectBool(Request& r, MethodParams& params) { _selectX(r, params, selectBoolHandler); } static void _selectNumber(Request& r, MethodParams& params) { _selectX(r, params, selectNumberHandler); } static void _selectString(Request& r, MethodParams& params) { _selectX(r, params, selectStringHandler); } // constructor /// @bug one can change const and ruin other's work, we need unchangable VIntConst class MXnode::MXnode(const char* aname, VStateless_class *abase): Methoded(aname?aname:"xnode", abase) { /// DOM1 node // Node insertBefore(in Node newChild,in Node refChild) raises(DOMException); add_native_method("insertBefore", Method::CT_DYNAMIC, _insertBefore, 2, 2); // Node replaceChild(in Node newChild,in Node oldChild) raises(DOMException); add_native_method("replaceChild", Method::CT_DYNAMIC, _replaceChild, 2, 2); // Node removeChild(in Node oldChild) raises(DOMException); add_native_method("removeChild", Method::CT_DYNAMIC, _removeChild, 1, 1); // Node appendChild(in Node newChild) raises(DOMException); add_native_method("appendChild", Method::CT_DYNAMIC, _appendChild, 1, 1); // boolean hasChildNodes(); add_native_method("hasChildNodes", Method::CT_DYNAMIC, _hasChildNodes, 0, 0); // Node cloneNode(in boolean deep); add_native_method("cloneNode", Method::CT_DYNAMIC, _cloneNode, 1, 1); /// DOM1 element // DOMString getAttribute(in DOMString name); add_native_method("getAttribute", Method::CT_DYNAMIC, _getAttribute, 1, 1); // void setAttribute(in DOMString name, in DOMString value) raises(DOMException); add_native_method("setAttribute", Method::CT_DYNAMIC, _setAttribute, 2, 2); // void removeAttribute(in DOMString name) raises(DOMException); add_native_method("removeAttribute", Method::CT_DYNAMIC, _removeAttribute, 1, 1); // Attr getAttributeNode(in DOMString name); add_native_method("getAttributeNode", Method::CT_DYNAMIC, _getAttributeNode, 1, 1); // Attr setAttributeNode(in Attr newAttr) raises(DOMException); add_native_method("setAttributeNode", Method::CT_DYNAMIC, _setAttributeNode, 1, 1); // Attr removeAttributeNode(in Attr oldAttr) raises(DOMException); add_native_method("removeAttributeNode", Method::CT_DYNAMIC, _removeAttributeNode, 1, 1); // NodeList getElementsByTagName(in DOMString name); add_native_method("getElementsByTagName", Method::CT_DYNAMIC, _getElementsByTagName, 1, 1); // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); add_native_method("getElementsByTagNameNS", Method::CT_DYNAMIC, _getElementsByTagNameNS, 2, 2); // void normalize(); add_native_method("normalize", Method::CT_DYNAMIC, _normalize, 0, 0); /// DOM2 element // DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName); add_native_method("getAttributeNS", Method::CT_DYNAMIC, _getAttributeNS, 2, 2); // void setAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value) raises(DOMException); add_native_method("setAttributeNS", Method::CT_DYNAMIC, _setAttributeNS, 3, 3); // void removeAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); add_native_method("removeAttributeNS", Method::CT_DYNAMIC, _removeAttributeNS, 2, 2); // Attr getAttributeNodeNS(in DOMString namespaceURI, in DOMString localName); add_native_method("getAttributeNodeNS", Method::CT_DYNAMIC, _getAttributeNodeNS, 2, 2); // Attr setAttributeNodeNS(in Attr newAttr) raises(DOMException); add_native_method("setAttributeNodeNS", Method::CT_DYNAMIC, _setAttributeNode, 1, 1); // boolean hasAttribute(in DOMString name) raises(DOMException); add_native_method("hasAttribute", Method::CT_DYNAMIC, _hasAttribute, 1, 1); // boolean hasAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); add_native_method("hasAttributeNS", Method::CT_DYNAMIC, _hasAttributeNS, 2, 2); // boolean hasAttributes add_native_method("hasAttributes", Method::CT_DYNAMIC, _hasAttributes, 0, 0); /// parser // ^node.select[/some/xpath/query] = hash $.#[dnode] add_native_method("select", Method::CT_DYNAMIC, _select, 1, 1); // ^node.selectSingle[/some/xpath/query] = first node [if any] add_native_method("selectSingle", Method::CT_DYNAMIC, _selectSingle, 1, 1); // ^node.selectBool[/some/xpath/query] = bool value [if any] add_native_method("selectBool", Method::CT_DYNAMIC, _selectBool, 1, 1); // ^node.selectNumber[/some/xpath/query] = double value [if any] add_native_method("selectNumber", Method::CT_DYNAMIC, _selectNumber, 1, 1); // ^node.selectString[/some/xpath/query] = strinv value [if any] add_native_method("selectString", Method::CT_DYNAMIC, _selectString, 1, 1); // consts #define CONST(name) \ consts.put(String::Body(#name), new VInt(XML_##name)) #define CONST2(name, value) \ consts.put(String::Body(#name), new VInt(value)) CONST(ELEMENT_NODE); CONST(ATTRIBUTE_NODE); CONST(TEXT_NODE); CONST(CDATA_SECTION_NODE); CONST2(ENTITY_REFERENCE_NODE, XML_ENTITY_REF_NODE); CONST(ENTITY_NODE); CONST2(PROCESSING_INSTRUCTION_NODE, XML_PI_NODE); CONST(COMMENT_NODE); CONST(DOCUMENT_NODE); CONST(DOCUMENT_TYPE_NODE); CONST2(DOCUMENT_FRAGMENT_NODE, XML_DOCUMENT_FRAG_NODE); CONST(NOTATION_NODE); } #else // global variable DECLARE_CLASS_VAR(xnode, 0, 0); // fictive #endif parser-3.4.3/src/classes/image.C000644 000000 000000 00000117272 12223102011 016520 0ustar00rootwheel000000 000000 /** @file Parser: @b image parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ /* jpegsize: gets the width and height (in pixels) of a jpeg file Andrew Tong, werdna@ugcs.caltech.edu February 14, 1995 modified slightly by alex@ed.ac.uk and further still by rjray@uswest.com optimization and general re-write from tmetro@vl.com from perl by paf@design.ru */ #include "pa_config_includes.h" #include "gif.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_vimage.h" #include "pa_vdate.h" #include "pa_table.h" volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.144 2013/10/02 20:37:29 moko Exp $"; // defines static const String spacebar_width_name("space"); static const String monospace_width_name("width"); static const String letter_spacing_name("spacing"); // class class MImage: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VImage(); } public: MImage(); }; // globals DECLARE_CLASS_VAR(image, new MImage, 0); // helpers #define EXIF_TAG(tag, name) put(tag, #name); /// value of exif tag -> it's value class EXIF_tag_value2name: public Hash { public: EXIF_tag_value2name() { // image JPEG Exif // Tags used by IFD0 (main image) EXIF_TAG(0x010e, ImageDescription); EXIF_TAG(0x010f, Make); EXIF_TAG(0x0110, Model); EXIF_TAG(0x0112, Orientation); EXIF_TAG(0x011a, XResolution); EXIF_TAG(0x011b, YResolution); EXIF_TAG(0x0128, ResolutionUnit); EXIF_TAG(0x0131, Software); EXIF_TAG(0x0132, DateTime); EXIF_TAG(0x013e, WhitePoint); EXIF_TAG(0x013f, PrimaryChromaticities); EXIF_TAG(0x0211, YCbCrCoefficients); EXIF_TAG(0x0213, YCbCrPositioning); EXIF_TAG(0x0214, ReferenceBlackWhite); EXIF_TAG(0x8298, Copyright); EXIF_TAG(0x8769, ExifOffset); // Tags used by Exif SubIFD EXIF_TAG(0x829a, ExposureTime); EXIF_TAG(0x829d, FNumber); EXIF_TAG(0x8822, ExposureProgram); EXIF_TAG(0x8827, ISOSpeedRatings); EXIF_TAG(0x9000, ExifVersion); EXIF_TAG(0x9003, DateTimeOriginal); EXIF_TAG(0x9004, DateTimeDigitized); EXIF_TAG(0x9101, ComponentsConfiguration); EXIF_TAG(0x9102, CompressedBitsPerPixel); EXIF_TAG(0x9201, ShutterSpeedValue); EXIF_TAG(0x9202, ApertureValue); EXIF_TAG(0x9203, BrightnessValue); EXIF_TAG(0x9204, ExposureBiasValue); EXIF_TAG(0x9205, MaxApertureValue); EXIF_TAG(0x9206, SubjectDistance); EXIF_TAG(0x9207, MeteringMode); EXIF_TAG(0x9208, LightSource); EXIF_TAG(0x9209, Flash); EXIF_TAG(0x920a, FocalLength); EXIF_TAG(0x927c, MakerNote); EXIF_TAG(0x9286, UserComment); EXIF_TAG(0x9290, SubsecTime); EXIF_TAG(0x9291, SubsecTimeOriginal); EXIF_TAG(0x9292, SubsecTimeDigitized); EXIF_TAG(0xa000, FlashPixVersion); EXIF_TAG(0xa001, ColorSpace); EXIF_TAG(0xa002, ExifImageWidth); EXIF_TAG(0xa003, ExifImageHeight); EXIF_TAG(0xa004, RelatedSoundFile); EXIF_TAG(0xa005, ExifInteroperabilityOffset); EXIF_TAG(0xa20e, FocalPlaneXResolution); EXIF_TAG(0xa20f, FocalPlaneYResolution); EXIF_TAG(0xa210, FocalPlaneResolutionUnit); EXIF_TAG(0xa215, ExposureIndex); EXIF_TAG(0xa217, SensingMethod); EXIF_TAG(0xa300, FileSource); EXIF_TAG(0xa301, SceneType); EXIF_TAG(0xa302, CFAPattern); // Misc Tags EXIF_TAG(0x00fe, NewSubfileType); EXIF_TAG(0x00ff, SubfileType); EXIF_TAG(0x012d, TransferFunction); EXIF_TAG(0x013b, Artist); EXIF_TAG(0x013d, Predictor); EXIF_TAG(0x0142, TileWidth); EXIF_TAG(0x0143, TileLength); EXIF_TAG(0x0144, TileOffsets); EXIF_TAG(0x0145, TileByteCounts); EXIF_TAG(0x014a, SubIFDs); EXIF_TAG(0x015b, JPEGTables); EXIF_TAG(0x828d, CFARepeatPatternDim); EXIF_TAG(0x828e, CFAPattern); EXIF_TAG(0x828f, BatteryLevel); EXIF_TAG(0x83bb, IPTC/NAA); EXIF_TAG(0x8773, InterColorProfile); EXIF_TAG(0x8824, SpectralSensitivity); //EXIF_TAG(0x8825, GPSInfo); EXIF_TAG(0x8828, OECF); EXIF_TAG(0x8829, Interlace); EXIF_TAG(0x882a, TimeZoneOffset); EXIF_TAG(0x882b, SelfTimerMode); EXIF_TAG(0x920b, FlashEnergy); EXIF_TAG(0x920c, SpatialFrequencyResponse); EXIF_TAG(0x920d, Noise); EXIF_TAG(0x9211, ImageNumber); EXIF_TAG(0x9212, SecurityClassification); EXIF_TAG(0x9213, ImageHistory); EXIF_TAG(0x9214, SubjectLocation); EXIF_TAG(0x9215, ExposureIndex); EXIF_TAG(0x9216, TIFF/EPStandardID); EXIF_TAG(0xa20b, FlashEnergy); EXIF_TAG(0xa20c, SpatialFrequencyResponse); EXIF_TAG(0xa214, SubjectLocation); // additional things added by misha@ EXIF_TAG(0x0100, ImageWidth); EXIF_TAG(0x0101, ImageLength); EXIF_TAG(0x0102, BitsPerSample); EXIF_TAG(0x0103, Compression); EXIF_TAG(0x0106, PhotometricInterpretation); EXIF_TAG(0x010a, FillOrder); EXIF_TAG(0x010d, DocumentName); EXIF_TAG(0x0111, StripOffsets); EXIF_TAG(0x0115, SamplesPerPixel); EXIF_TAG(0x0116, RowsPerStrip); EXIF_TAG(0x0117, StripByteCounts); EXIF_TAG(0x011c, PlanarConfiguration); EXIF_TAG(0x0156, TransferRange); EXIF_TAG(0x0200, JPEGProc); EXIF_TAG(0x0201, JPEGInterchangeFormat); EXIF_TAG(0x0202, JPEGInterchangeFormatLength); EXIF_TAG(0x0212, YCbCrSubSampling); EXIF_TAG(0xa401, CustomRendered); EXIF_TAG(0xa402, ExposureMode); EXIF_TAG(0xa403, WhiteBalance); EXIF_TAG(0xa404, DigitalZoomRatio); EXIF_TAG(0xa405, FocalLengthIn35mmFilm); EXIF_TAG(0xa406, SceneCaptureType); EXIF_TAG(0xa407, GainControl); EXIF_TAG(0xa408, Contrast); EXIF_TAG(0xa409, Saturation); EXIF_TAG(0xa40a, Sharpness); EXIF_TAG(0xa40b, DeviceSettingDescription); EXIF_TAG(0xa40c, SubjectDistanceRange); EXIF_TAG(0xa420, ImageUniqueID); } } exif_tag_value2name; class EXIF_gps_tag_value2name: public Hash { public: EXIF_gps_tag_value2name() { EXIF_TAG(0x0, GPSVersionID); EXIF_TAG(0x1, GPSLatitudeRef); EXIF_TAG(0x2, GPSLatitude); EXIF_TAG(0x3, GPSLongitudeRef); EXIF_TAG(0x4, GPSLongitude); EXIF_TAG(0x5, GPSAltitudeRef); EXIF_TAG(0x6, GPSAltitude); EXIF_TAG(0x7, GPSTimeStamp); EXIF_TAG(0x8, GPSSatellites); EXIF_TAG(0x9, GPSStatus); EXIF_TAG(0xA, GPSMeasureMode); EXIF_TAG(0xB, GPSDOP); EXIF_TAG(0xC, GPSSpeedRef); EXIF_TAG(0xD, GPSSpeed); EXIF_TAG(0xE, GPSTrackRef); EXIF_TAG(0xF, GPSTrack); EXIF_TAG(0x10, GPSImgDirectionRef); EXIF_TAG(0x11, GPSImgDirection); EXIF_TAG(0x12, GPSMapDatum); EXIF_TAG(0x13, GPSDestLatitudeRef); EXIF_TAG(0x14, GPSDestLatitude); EXIF_TAG(0x15, GPSDestLongitudeRef); EXIF_TAG(0x16, GPSDestLongitude); EXIF_TAG(0x17, GPSDestBearingRef); EXIF_TAG(0x18, GPSDestBearing); EXIF_TAG(0x19, GPSDestDistanceRef); EXIF_TAG(0x1A, GPSDestDistance); EXIF_TAG(0x1B, GPSProcessingMethod); EXIF_TAG(0x1C, GPSAreaInformation); EXIF_TAG(0x1D, GPSDateStamp); EXIF_TAG(0x1E, GPSDifferential); } } exif_gps_tag_value2name; #undef EXIF_TAG #ifndef DOXYGEN class Measure_reader { public: virtual size_t read(const char* &buf, size_t limit)=0; virtual void seek(long value, int whence)=0; virtual long tell()=0; }; class Measure_file_reader: public Measure_reader { const String& file_name; const char* fname; int f; public: Measure_file_reader(int af, const String& afile_name, const char* afname): file_name(afile_name), fname(afname), f(af) { } override size_t read(const char* &abuf, size_t limit) { if(limit==0) return 0; char* lbuf=new(PointerFreeGC) char[limit]; ssize_t read_size=::read(f, lbuf, limit); abuf=lbuf; if(read_size<0) throw Exception(0, &file_name, "measure read failed: %s (%d)", strerror(errno), errno); return read_size; } override void seek(long value, int whence) { if(lseek(f, value, whence)<0) throw Exception(IMAGE_FORMAT, &file_name, "seek(value=%ld, whence=%d) failed: %s (%d), actual filename '%s'", value, whence, strerror(errno), errno, fname); } override long tell() { return lseek(f, 0, SEEK_CUR); } }; class Measure_buf_reader: public Measure_reader { const char* buf; size_t size; const String& file_name; size_t offset; public: Measure_buf_reader(const char* abuf, size_t asize, const String& afile_name): buf(abuf), size(asize), file_name(afile_name), offset(0) { } override size_t read(const char* &abuf, size_t limit) { size_t to_read=min(limit, size-offset); abuf=buf+offset; offset+=to_read; return to_read; } override void seek(long value, int whence) { size_t new_offset; switch(whence) { case SEEK_CUR: new_offset=offset+value; break; case SEEK_SET: new_offset=(size_t)value; break; default: throw Exception(0, 0, "whence #%d not supported", 0, whence); break; // never } if((ssize_t)new_offset<0 || new_offset>size) throw Exception(IMAGE_FORMAT, &file_name, "seek(value=%l, whence=%d) failed: out of buffer, new_offset>size (%l>%l) or new_offset<0", value, whence, new_offset, size); offset=new_offset; } override long tell() { return offset; } }; #endif /// PNG file header struct PNG_Header { char dummy[12]; char signature[4]; //< must be "IHDR" uchar high_width[2]; //< image width high bytes [we ignore for now] uchar width[2]; //< image width low bytes uchar high_height[2]; //< image height high bytes [we ignore for now] uchar height[4]; //< image height }; /// GIF file header struct GIF_Header { char signature[3]; // 'GIF' char version[3]; uchar width[2]; uchar height[2]; char dif; char fonColor; char nulls; }; /// JPEG record head struct JPG_Segment_head { uchar marker; uchar code; uchar length[2]; }; /// JPEG frame header struct JPG_Size_segment_body { char data; //< data precision of bits/sample uchar height[2]; //< image height uchar width[2]; //< image width char numComponents; //< number of color components }; /// JPEG frame header struct JPG_Exif_segment_begin { char signature[6]; // Exif\0\0 }; /// JPEG Exif TIFF Header struct JPG_Exif_TIFF_header { uchar byte_align_identifier[2]; char dummy[2]; // always 000A [or 0A00] uchar first_IFD_offset[4]; // Usually the first IFD starts immediately next to TIFF header, so this offset has value '0x00000008'. }; // JPEG Exif IFD start struct JPG_Exif_IFD_begin { uchar directory_entry_count[2]; // the number of directory entry contains in this IFD }; // TTTT ffff NNNNNNNN DDDDDDDD struct JPG_Exif_IFD_entry { uchar tag[2]; // Tag number, this shows a kind of data uchar format[2]; // data format uchar components_count[4]; // number of components uchar value_or_offset_to_it[4]; // data value or offset to data value }; #define JPG_IFD_TAG_EXIF_OFFSET 0x8769 #define JPG_IFD_TAG_EXIF_GPS_OFFSET 0x8825 #define JPEG_EXIF_DATE_CHARS 20 // inline ushort x_endian_to_ushort(uchar b0, uchar b1) { return (ushort)((b1<<8) + b0); } inline uint x_endian_to_uint(uchar b0, uchar b1, uchar b2, uchar b3) { return (uint)(((((b3<<8) + b2)<<8)+b1)<<8)+b0; } inline ushort endian_to_ushort(bool is_big, const uchar *b/* [2] */) { return is_big?x_endian_to_ushort(b[1], b[0]): x_endian_to_ushort(b[0], b[1]); } inline uint endian_to_uint(bool is_big, const uchar *b /* [4] */) { return is_big?x_endian_to_uint(b[3], b[2], b[1], b[0]): x_endian_to_uint(b[0], b[1], b[2], b[3]); } static void measure_gif(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { const char* buf; const size_t head_size=sizeof(GIF_Header); if(reader.read(buf, head_size)signature, "GIF", 3)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not GIF file - wrong signature"); width=endian_to_ushort(false, head->width); height=endian_to_ushort(false, head->height); } static Value* parse_IFD_entry_formatted_one_value( bool is_big, ushort format, size_t component_size, const uchar *value) { switch(format) { case 1: // unsigned byte return new VInt((uchar)value[0]); case 3: // unsigned short return new VInt(endian_to_ushort(is_big, value)); case 4: // unsigned long // 'double' because parser's Int is signed return new VDouble(endian_to_uint(is_big, value)); case 5: // unsigned rational { uint numerator=endian_to_uint(is_big, value); value+=component_size/2; uint denominator=endian_to_uint(is_big, value); if(!denominator) return 0; return new VDouble(((double)numerator)/denominator); } case 6: // signed byte return new VInt((signed char)value[0]); case 8: // signed short return new VInt((signed short)endian_to_ushort(is_big, value)); case 9: // signed long return new VInt((signed int)endian_to_uint(is_big, value)); case 10: // signed rational { signed int numerator=(signed int)endian_to_uint(is_big, value); value+=component_size/2; uint denominator=endian_to_uint(is_big, value); if(!denominator) return 0; return new VDouble(numerator/denominator); } /* case 11: // single float @todo case 12: // double float @todo */ }; return 0; } // date.C tm cstr_to_time_t(char *cstr); static Value* parse_IFD_entry_formatted_value(bool is_big, ushort format, size_t component_size, uint components_count, const uchar *value) { if(format==2) { // ascii string, exception: the only type with varying size const char* cstr=(const char* )value; size_t length=components_count; // Data format is "YYYY:MM:DD HH:MM:SS"+0x00, total 20bytes if(length==JPEG_EXIF_DATE_CHARS && isdigit((unsigned char)cstr[0]) && cstr[length-1]==0) { char cstr_writable[JPEG_EXIF_DATE_CHARS]; strcpy(cstr_writable, cstr); try { return new VDate(cstr_to_time_t(cstr_writable)); } catch(...) { /*ignore bad date times*/ } } return new VString(*new String(cstr, String::L_TAINTED)); } if(components_count==1) return parse_IFD_entry_formatted_one_value(is_big, format, component_size, value); VHash* result=new VHash; HashStringValue& hash=result->hash(); for(uint i=0; i=sizeof(format2component_size)/sizeof(format2component_size[0])) return 0; // format out of range, ignoring size_t component_size=format2component_size[format]; if(component_size==0) return 0; // undefined format // You can get the total data byte length by multiplies // a 'bytes/components' value (see above chart) by number of components stored 'NNNNNNNN' area uint components_count=endian_to_uint(is_big, entry.components_count); uint value_size=component_size*components_count; // If its size is over 4bytes, 'DDDDDDDD' contains the offset to data stored address Value* result; if(value_size<=4) result=parse_IFD_entry_formatted_value( is_big, format, component_size, components_count, entry.value_or_offset_to_it); else { long remembered=reader.tell(); { reader.seek(tiff_base+endian_to_uint(is_big, entry.value_or_offset_to_it), SEEK_SET); const char* value; if(reader.read(value, value_size)directory_entry_count); for(int i=0; isignature, "Exif\0\0", 4+2)!=0) //signature invalid? return 0; // ignore invalid block uint tiff_base=reader.tell(); if(reader.read(buf, sizeof(JPG_Exif_TIFF_header))byte_align_identifier[0]=='M'; // [M]otorola vs [I]ntel uint first_IFD_offset=endian_to_uint(is_big, head->first_IFD_offset); reader.seek(tiff_base+first_IFD_offset, SEEK_SET); VHash* vhash=new VHash; // IFD parse_IFD(vhash->hash(), is_big, reader, tiff_base); return vhash; } static void measure_jpeg(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height, Value** exif) { // JFIF format markers const uchar MARKER=0xFF; const uchar CODE_SIZE_A=0xC0; const uchar CODE_SIZE_B=0xC1; const uchar CODE_SIZE_C=0xC2; const uchar CODE_SIZE_D=0xC3; const uchar CODE_EXIF=0xE1; const char* buf; const size_t prefix_size=2; if(reader.read(buf, prefix_size)marker!=MARKER) throw Exception(IMAGE_FORMAT, &origin_string, "not JPEG file - marker not found"); switch(head->code) { // http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html case CODE_EXIF: if(exif && !*exif) // seen .jpg with some xml under EXIF tag, after real exif block :) *exif=parse_exif(reader, origin_string); break; case CODE_SIZE_A: case CODE_SIZE_B: case CODE_SIZE_C: case CODE_SIZE_D: { // Segments that contain size info if(reader.read(buf, sizeof(JPG_Size_segment_body))width); height=endian_to_ushort(true, body->height); } return; }; reader.seek(segment_base+endian_to_ushort(true, head->length), SEEK_SET); } throw Exception(IMAGE_FORMAT, &origin_string, "broken JPEG file - size frame not found"); } static void measure_png(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { const char* buf; const size_t head_size=sizeof(PNG_Header); if(reader.read(buf, head_size)signature, "IHDR", 4)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not PNG file - wrong signature"); width=endian_to_ushort(true, head->width); height=endian_to_ushort(true, head->height); } // measure center static void measure(const String& file_name, Measure_reader& reader, ushort& width, ushort& height, Value** exif) { const char* file_name_cstr=file_name.taint_cstr(String::L_FILE_SPEC); if(const char* cext=strrchr(file_name_cstr, '.')) { cext++; if(strcasecmp(cext, "GIF")==0) measure_gif(file_name, reader, width, height); else if(strcasecmp(cext, "JPG")==0 || strcasecmp(cext, "JPEG")==0) measure_jpeg(file_name, reader, width, height, exif); else if(strcasecmp(cext, "PNG")==0) measure_png(file_name, reader, width, height); else throw Exception(IMAGE_FORMAT, &file_name, "unhandled image file name extension '%s'", cext); } else throw Exception(IMAGE_FORMAT, &file_name, "can not determine image type - no file name extension"); } // methods #ifndef DOXYGEN struct File_measure_action_info { ushort* width; ushort* height; Value** exif; const String* file_name; }; #endif static void file_measure_action( struct stat& /*finfo*/, int f, const String& /*file_spec*/, const char* fname, bool /*as_text*/, void *context) { File_measure_action_info& info=*static_cast(context); Measure_file_reader reader(f, *info.file_name, fname); measure(*info.file_name, reader, *info.width, *info.height, info.exif); } static void _measure(Request& r, MethodParams& params) { Value& data=params.as_no_junction(0, "data must not be code"); ushort width=0; ushort height=0; Value* exif=0; const String* file_name; if((file_name=data.get_string())) { File_measure_action_info info={ &width, &height, &exif, file_name }; file_read_action_under_lock(r.absolute(*file_name), "measure", file_measure_action, &info); } else { VFile* vfile=data.as_vfile(String::L_AS_IS); file_name=&vfile->fields().get(name_name)->as_string(); Measure_buf_reader reader( vfile->value_ptr(), vfile->value_size(), *file_name ); measure(*file_name, reader, width, height, &exif); } GET_SELF(r, VImage).set(file_name, width, height, 0, exif); } #ifndef DOXYGEN struct Attrib_info { String* tag; ///< html tag being constructed HashStringValue* skip; ///< tag attributes not to append to tag string [to skip] }; #endif static void append_attrib_pair( HashStringValue::key_type key, HashStringValue::value_type value, Attrib_info* info) { // skip user-specified, internal(starting with "line-") attributes and border attribute with empty value if( (info->skip && info->skip->get(key)) || key.pos("line-")==0 || (key=="border" && !value->is_defined()) ) return; // src="a.gif" width="123" ismap[=-1] *info->tag << " " << key; if(value->is_string() || value->as_int()>=0) *info->tag << "=\"" << value->as_string() << "\""; } static void _html(Request& r, MethodParams& params) { String tag; tag << "for_each(append_attrib_pair, &info); } else throw Exception(PARSER_RUNTIME, 0, "attributes must be hash"); } { Attrib_info info={&tag, attribs}; fields.for_each(append_attrib_pair, &info); } tag << " />"; r.write_pass_lang(tag); } /// @test wrap FILE to auto-object static gdImage* load(Request& r, const String& file_name){ const char* file_name_cstr=r.absolute(file_name).taint_cstr(String::L_FILE_SPEC); if(FILE *f=fopen(file_name_cstr, "rb")) { gdImage* image=new gdImage; bool ok=image->CreateFromGif(f); fclose(f); if(!ok) throw Exception(IMAGE_FORMAT, &file_name, "is not in GIF format"); return image; } else { throw Exception("file.missing", 0, "can not open '%s'", file_name_cstr); } } static void _load(Request& r, MethodParams& params) { const String& file_name=params.as_string(0, FILE_NAME_MUST_NOT_BE_CODE); gdImage* image=load(r, file_name); GET_SELF(r, VImage).set(&file_name, image->SX(), image->SY(), image); } static void _create(Request& r, MethodParams& params) { int width=params.as_int(0, "width must be int", r); int height=params.as_int(1, "height must be int", r); int bgcolor_value=0xffFFff; if(params.count()>2) bgcolor_value=params.as_int(2, "color must be int", r); gdImage* image=new gdImage; image->Create(width, height); image->FilledRectangle(0, 0, width-1, height-1, image->Color(bgcolor_value)); GET_SELF(r, VImage).set(0, width, height, image); } static void _gif(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); const String *file_name=params.count()>0?¶ms.as_string(0, FILE_NAME_MUST_BE_STRING):0; gdBuf buf=image.Gif(); VFile& vfile=*new VFile; vfile.set_binary(false/*not tainted*/, (const char *)buf.ptr, buf.size, file_name, new VString(*new String("image/gif"))); r.write_no_lang(vfile); } static void _line(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Line( params.as_int(0, "x0 must be int", r), params.as_int(1, "y0 must be int", r), params.as_int(2, "x1 must be int", r), params.as_int(3, "y1 must be int", r), image.Color(params.as_int(4, "color must be int", r))); } static void _fill(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Fill( params.as_int(0, "x must be int", r), params.as_int(1, "y must be int", r), image.Color(params.as_int(2, "color must be int", r))); } static void _rectangle(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Rectangle( params.as_int(0, "x0 must be int", r), params.as_int(1, "y0 must be int", r), params.as_int(2, "x1 must be int", r), params.as_int(3, "y1 must be int", r), image.Color(params.as_int(4, "color must be int", r))); } static void _bar(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.FilledRectangle( params.as_int(0, "x0 must be int", r), params.as_int(1, "y0 must be int", r), params.as_int(2, "x1 must be int", r), params.as_int(3, "y1 must be int", r), image.Color(params.as_int(4, "color must be int", r))); } #ifndef DOXYGEN static void add_point(Table::element_type row, gdImage::Point **p) { if(row->count()!=2) throw Exception(0, 0, "coordinates table must contain two columns: x and y values"); (**p).x=row->get(0)->as_int(); (**p).y=row->get(1)->as_int(); (*p)++; } #endif #ifndef DOXYGEN static void add_point(int x, int y, gdImage::Point **p) { (**p).x=x; (**p).y=y; (*p)++; } #endif static void _replace(Request& r, MethodParams& params) { int src_color=params.as_int(0, "src color must be int", r); int dest_color=params.as_int(1, "dest color must be int", r); gdImage& image=GET_SELF(r, VImage).image(); gdImage::Point* all_p=0; size_t count=0; if(params.count() == 3){ Table* table=params.as_table(2, "coordinates"); count=table->count(); all_p=new(PointerFreeGC) gdImage::Point[count]; gdImage::Point* add_p=all_p; table->for_each(add_point, &add_p); } else { int max_x=image.SX()-1; int max_y=image.SY()-1; if(max_x > 0 && max_y > 0){ count=4; all_p=new(PointerFreeGC) gdImage::Point[count]; gdImage::Point* add_p=all_p; add_point(0, 0, &add_p); add_point(max_x, 0, &add_p); add_point(max_x, max_y, &add_p); add_point(0, max_y, &add_p); } } if(count) image.FilledPolygonReplaceColor(all_p, count, image.Color(src_color), image.Color(dest_color)); } static void _polyline(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); Table* table=params.as_table(1, "coordinates"); gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image.Polygon(all_p, table->count(), image.Color(params.as_int(0, "color must be int", r)), false/*not closed*/); } static void _polygon(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); Table* table=(Table*)params.as_table(1, "coordinates"); gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image.Polygon(all_p, table->count(), image.Color(params.as_int(0, "color must be int", r))); } static void _polybar(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); Table* table=(Table*)params.as_table(1, "coordinates"); gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image.FilledPolygon(all_p, table->count(), image.Color(params.as_int(0, "color must be int", r))); } // font #define Y(y)(y+index*height) // Font class Font::Font( Charset& asource_charset, const String& aalphabet, gdImage* aifont, int aheight, int amonospace, int aspacebarspace, int aletterspacing): fsource_charset(asource_charset), height(aheight), monospace(amonospace), spacebarspace(aspacebarspace), letterspacing(aletterspacing), ifont(aifont), alphabet(aalphabet) { if(fsource_charset.isUTF8()){ size_t index=0; for(UTF8_string_iterator i(alphabet); i.has_next(); ) fletter2index.put_dont_replace(i.next(), index++); } } /* ******************************** char ********************************** */ size_t Font::index_of(char ch) { if(ch==' ') return STRING_NOT_FOUND; return alphabet.pos(ch); } size_t Font::index_of(XMLCh ch) { if(ch==' ') return STRING_NOT_FOUND; return fletter2index.get(ch); } int Font::index_width(size_t index) { if(index==STRING_NOT_FOUND) return spacebarspace; int tr=ifont->GetTransparent(); for(int x=ifont->SX()-1; x>=0; x--) { for(int y=0; yGetPixel(x, Y(y))!=tr) return x+1; } return 0; } void Font::index_display(gdImage& image, int x, int y, size_t index){ if(index!=STRING_NOT_FOUND) ifont->Copy(image, x, y, 0, Y(0), index_width(index), height); } /* ******************************** string ********************************** */ int Font::step_width(int index) { return letterspacing + (monospace ? monospace : index_width(index)); } // counts trailing letter_spacing, consider this OK. useful for contiuations int Font::string_width(const String& s){ const char* cstr=s.cstr(); int result=0; if(fsource_charset.isUTF8()){ for(UTF8_string_iterator i(s); i.has_next(); ) result+=step_width(index_of(i.next())); } else { for(const char* current=cstr; *current; current++) result+=step_width(index_of(*current)); } return result; } void Font::string_display(gdImage& image, int x, int y, const String& s){ const char* cstr=s.cstr(); if(fsource_charset.isUTF8()){ for(UTF8_string_iterator i(s); i.has_next(); ){ size_t index=index_of(i.next()); index_display(image, x, y, index); x+=step_width(index); } } else { for(const char* current=cstr; *current; current++) { size_t index=index_of(*current); index_display(image, x, y, index); x+=step_width(index); } } } // static void _font(Request& r, MethodParams& params) { const String& alphabet=params.as_string(0, "alphabet must not be code"); size_t alphabet_length=alphabet.length(r.charsets.source()); if(!alphabet_length) throw Exception(PARSER_RUNTIME, 0, "alphabet must not be empty"); gdImage* image=load(r, params.as_string(1, FILE_NAME_MUST_NOT_BE_CODE)); int spacebar_width=image->SX(); int monospace_width=0; // proportional int letter_spacing=1; if(params.count()>2){ if(HashStringValue* options=params[2].get_hash()){ // third option is hash if(params.count()>3) throw Exception(PARSER_RUNTIME, 0, "too many params were specified"); int valid_options=0; if(Value* vspacebar_width=options->get(spacebar_width_name)){ valid_options++; spacebar_width=r.process_to_value(*vspacebar_width).as_int(); } if(Value* vmonospace_width=options->get(monospace_width_name)){ valid_options++; monospace_width=r.process_to_value(*vmonospace_width).as_int(); if(!monospace_width) monospace_width=image->SX(); } if(Value* vletter_spacing=options->get(letter_spacing_name)){ valid_options++; letter_spacing=r.process_to_value(*vletter_spacing).as_int(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } else { // backward spacebar_width=params.as_int(2, "param must be int or hash", r); if(params.count()>3) { monospace_width=params.as_int(3, "monospace_width must be int", r); if(!monospace_width) monospace_width=image->SX(); } } } if(int remainder=image->SY() % alphabet_length) throw Exception(PARSER_RUNTIME, 0, "font-file height(%d) not divisable by alphabet size(%d), remainder=%d", image->SY(), alphabet_length, remainder); GET_SELF(r, VImage).set_font(new Font( r.charsets.source(), alphabet, image, image->SY() / alphabet_length, monospace_width, spacebar_width, letter_spacing)); } static void _text(Request& r, MethodParams& params) { int x=params.as_int(0, "x must be int", r); int y=params.as_int(1, "y must be int", r); const String& s=params.as_string(2, "text must not be code"); VImage& vimage=GET_SELF(r, VImage); vimage.font().string_display(vimage.image(), x, y, s); } static void _length(Request& r, MethodParams& params) { const String& s=params.as_string(0, "text must not be code"); VImage& vimage=GET_SELF(r, VImage); r.write_no_lang(*new VInt(vimage.font().string_width(s))); } static void _arc(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Arc( params.as_int(0, "center_x must be int", r), params.as_int(1, "center_y must be int", r), params.as_int(2, "width must be int", r), params.as_int(3, "height must be int", r), params.as_int(4, "start degrees must be int", r), params.as_int(5, "end degrees must be int", r), image.Color(params.as_int(6, "cx must be int", r))); } static void _sector(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Sector( params.as_int(0, "center_x must be int", r), params.as_int(1, "center_y must be int", r), params.as_int(2, "width must be int", r), params.as_int(3, "height must be int", r), params.as_int(4, "start degrees must be int", r), params.as_int(5, "end degrees must be int", r), image.Color(params.as_int(6, "color must be int", r))); } static void _circle(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); int size=params.as_int(2, "radius must be int", r)*2; image.Arc( params.as_int(0, "center_x must be int", r), params.as_int(1, "center_y must be int", r), size, //w size, //h 0, //s 360, //e image.Color(params.as_int(3, "color must be int", r))); } gdImage& as_image(MethodParams& params, int index, const char* msg) { Value& value=params.as_no_junction(index, msg); if(Value* vimage=value.as(VIMAGE_TYPE)) { return static_cast(vimage)->image(); } else throw Exception(PARSER_RUNTIME, 0, msg); } static void _copy(Request& r, MethodParams& params) { gdImage& dest=GET_SELF(r, VImage).image(); gdImage& src=as_image(params, 0, "src must be image"); int sx=params.as_int(1, "src_x must be int", r); int sy=params.as_int(2, "src_y must be int", r); int sw=params.as_int(3, "src_w must be int", r); int sh=params.as_int(4, "src_h must be int", r); int dx=params.as_int(5, "dest_x must be int", r); int dy=params.as_int(6, "dest_y must be int", r); if(params.count()>1+2+2+2) { int dw=params.as_int(1+2+2+2, "dest_w must be int", r); int dh=(int)(params.count()>1+2+2+2+1? params.as_int(1+2+2+2+1, "dest_h must be int", r):sh*(((double)dw)/((double)sw))); int tolerance=params.count()>1+2+2+2+2? params.as_int(1+2+2+2+2, "tolerance must be int", r):150; src.CopyResampled(dest, dx, dy, sx, sy, dw, dh, sw, sh, tolerance); } else src.Copy(dest, dx, dy, sx, sy, sw, sh); } static void _pixel(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); int x=params.as_int(0, "x must be int", r); int y=params.as_int(1, "y must be int", r); if(params.count()>2) { image.SetPixel(x, y, image.Color(params.as_int(2, "color must be int", r))); } else r.write_no_lang(*new VInt(image.DecodeColor(image.GetPixel(x, y)))); } // constructor MImage::MImage(): Methoded("image") { // ^image:measure[DATA] add_native_method("measure", Method::CT_DYNAMIC, _measure, 1, 1); // ^image.html[] // ^image.html[hash] add_native_method("html", Method::CT_DYNAMIC, _html, 0, 1); // ^image.load[background.gif] add_native_method("load", Method::CT_DYNAMIC, _load, 1, 1); // ^image.create[width;height] bgcolor=white // ^image.create[width;height;bgcolor] add_native_method("create", Method::CT_DYNAMIC, _create, 2, 3); // ^image.gif[] add_native_method("gif", Method::CT_DYNAMIC, _gif, 0, 1); // ^image.line(x0;y0;x1;y1;color) add_native_method("line", Method::CT_DYNAMIC, _line, 5, 5); // ^image.fill(x;y;color) add_native_method("fill", Method::CT_DYNAMIC, _fill, 3, 3); // ^image.rectangle(x0;y0;x1;y1;color) add_native_method("rectangle", Method::CT_DYNAMIC, _rectangle, 5, 5); // ^image.bar(x0;y0;x1;y1;color) add_native_method("bar", Method::CT_DYNAMIC, _bar, 5, 5); // ^image.replace(color-source;color-dest)[table x:y] // ^image.replace(color-source;color-dest) add_native_method("replace", Method::CT_DYNAMIC, _replace, 2, 3); // ^image.polyline(color)[table x:y] add_native_method("polyline", Method::CT_DYNAMIC, _polyline, 2, 2); // ^image.polygon(color)[table x:y] add_native_method("polygon", Method::CT_DYNAMIC, _polygon, 2, 2); // ^image.polybar(color)[table x:y] add_native_method("polybar", Method::CT_DYNAMIC, _polybar, 2, 2); // ^image.font[alPHAbet;font-file-name.gif] // ^image.font[alPHAbet;font-file-name.gif](spacebar_width) // ^image.font[alPHAbet;font-file-name.gif](spacebar_width;letter_width) // ^image.font[alPHAbet;font-file-name.gif][$.space-width(.) $.letter-width(.) $.letter-space(.)] add_native_method("font", Method::CT_DYNAMIC, _font, 2, 4); // ^image.text(x;y)[text] add_native_method("text", Method::CT_DYNAMIC, _text, 3, 3); // ^image.length[text] add_native_method("length", Method::CT_DYNAMIC, _length, 1, 1); // ^image.arc(center x;center y;width;height;start in degrees;end in degrees;color) add_native_method("arc", Method::CT_DYNAMIC, _arc, 7, 7); // ^image.sector(center x;center y;width;height;start in degrees;end in degrees;color) add_native_method("sector", Method::CT_DYNAMIC, _sector, 7, 7); // ^image.circle(center x;center y;r;color) add_native_method("circle", Method::CT_DYNAMIC, _circle, 4, 4); // ^image.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]]) add_native_method("copy", Method::CT_DYNAMIC, _copy, 1+2+2+2, (1+2+2+2)+2+1); // ^image.pixel(x;y)[(color)] add_native_method("pixel", Method::CT_DYNAMIC, _pixel, 2, 3); } parser-3.4.3/src/classes/Makefile.am000644 000000 000000 00000001563 11766067564 017423 0ustar00rootwheel000000 000000 INCLUDES = -I../types -I../sql -I../lib/gd -I../lib/gc/include -I../lib/cord/include -I../lib/sdbm/pa-include -Igd $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ -I../lib/md5 -I../lib/smtp -I../lib/json -I../lib/memcached -I../lib/curl CLASSES_SOURCE_FILES = classes.awk bool.C curl.C date.C double.C file.C form.C hash.C hashfile.C image.C inet.C int.C json.C mail.C math.C memcached.C memory.C op.C reflection.C regex.C response.C string.C table.C void.C xnode.C xdoc.C noinst_HEADERS = classes.h xnode.h noinst_LTLIBRARIES = libclasses.la libclasses_la_SOURCES = $(CLASSES_SOURCE_FILES) classes.C classes.inc: $(CLASSES_SOURCE_FILES) Makefile.am echo "/* do not edit. autogenerated by Makefile.am */" > classes.inc echo >> classes.inc ls $(CLASSES_SOURCE_FILES) | $(AWK) -f classes.awk >> classes.inc CLEANFILES = classes.inc classes.C: classes.inc EXTRA_DIST = classes.vcproj parser-3.4.3/src/classes/json.C000644 000000 000000 00000033676 12233734064 016440 0ustar00rootwheel000000 000000 /** @file Parser: @b json parser class. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vbool.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_json.h" #ifdef XML #include "pa_vxdoc.h" #endif volatile const char * IDENT_JSON_C="$Id: json.C,v 1.29 2013/10/29 13:29:24 moko Exp $"; // class class MJson: public Methoded { public: MJson(); }; // global variable DECLARE_CLASS_VAR(json, new MJson, 0); // methods struct Json { Stack stack; Stack key_stack; String* key; Value* result; Junction* hook_object; Junction* hook_array; Request* request; Charset *charset; String::Language taint; bool handle_double; enum Distinct { D_EXCEPTION, D_FIRST, D_LAST, D_ALL } distinct; Json(Charset* acharset): stack(), key_stack(), key(NULL), result(NULL), hook_object(NULL), hook_array(NULL), request(NULL), charset(acharset), taint(String::L_TAINTED), handle_double(true), distinct(D_EXCEPTION){} bool set_distinct(const String &value){ if (value == "first") distinct = D_FIRST; else if (value == "last") distinct = D_LAST; else if (value == "all") distinct = D_ALL; else return false; return true; } }; static void set_json_value(Json *json, Value *value){ VHash *top = json->stack.top_value(); if(json->key == NULL){ top->hash().put(String(format(top->get_hash()->count(), 0)), value); } else { switch (json->distinct){ case Json::D_EXCEPTION: if (top->hash().put_dont_replace(*json->key, value)) throw Exception(PARSER_RUNTIME, json->key, "duplicate key"); break; case Json::D_FIRST: top->hash().put_dont_replace(*json->key, value); break; case Json::D_LAST: top->hash().put(*json->key, value); break; case Json::D_ALL: if (top->hash().put_dont_replace(*json->key, value)){ for(int i=2;;i++){ String key; key << *json->key << "_" << format(i, 0); if (!top->hash().put_dont_replace(key, value)) break; } } break; } json->key=NULL; } } String* json_string(Json *json, const char *value, uint32_t length){ String::C result = json->charset !=NULL ? Charset::transcode(String::C(value, length), UTF8_charset, *json->charset) : String::C(pa_strdup(value, length), length); return new String(result.str, json->taint, result.length); } static Value *json_hook(Request &r, Junction *hook, String* key, Value* value){ VMethodFrame frame(*hook->method, r.method_frame, hook->self); Value *params[]={new VString(key ? *key : String::Empty), value}; frame.store_params(params, 2); r.execute_method(frame); return &frame.result().as_value(); } static int json_callback(Json *json, int type, const char *value, uint32_t length) { switch(type) { case JSON_OBJECT_BEGIN:{ VHash *v = new VHash(); if (json->hook_object){ json->key_stack.push(json->key); json->key=NULL; } else { if (json->stack.count()) set_json_value(json, v); } json->stack.push(v); break; } case JSON_OBJECT_END:{ if (json->hook_object){ String* key = json->key_stack.pop(); json->result = json_hook(*json->request, json->hook_object, key, json->stack.pop()); if (json->stack.count()){ json->key = key; set_json_value(json, json->result); } } else { json->result = json->stack.pop(); } break; } case JSON_ARRAY_BEGIN:{ VHash *v = new VHash(); if (json->hook_array){ json->key_stack.push(json->key); json->key=NULL; } else { if (json->stack.count()) set_json_value(json, v); } json->stack.push(v); break; } case JSON_ARRAY_END: // libjson supports array at top level, we too if (json->hook_array){ String* key = json->key_stack.pop(); json->result = json_hook(*json->request, json->hook_array, key, json->stack.pop()); if (json->stack.count()){ json->key = key; set_json_value(json, json->result); } } else { json->result = json->stack.pop(); } break; case JSON_KEY: json->key = json_string(json, value, length); break; case JSON_INT: set_json_value(json, new VDouble( json_string(json, value, length)->as_double() )); break; case JSON_FLOAT: if (json->handle_double){ set_json_value(json, new VDouble( json_string(json, value, length)->as_double() )); break; } // else is JSON_STRING case JSON_STRING: set_json_value(json, new VString(*json_string(json, value, length))); break; case JSON_NULL: set_json_value(json, VVoid::get()); break; case JSON_TRUE: set_json_value(json, &VBool::get(true)); break; case JSON_FALSE: set_json_value(json, &VBool::get(false)); break; } return 0; } static const char* json_error_message(int error_code){ static const char* error_messages[] = { NULL, "out of memory", "bad character", "stack empty", "pop unexpected mode", "nesting limit", "data limit", "comment not allowed by config", "unexpected char", "missing unicode low surrogate", "unexpected unicode low surrogate", "error comma out of structure", "error in a callback" }; return error_messages[error_code]; } extern String::Language get_untaint_lang(const String& lang_name); static void _parse(Request& r, MethodParams& params) { const String& json_string=params.as_string(0, "json must be string"); Json json(r.charsets.source().isUTF8() ? NULL : &(r.charsets.source())); json_config config = { 0, // buffer_initial_size 128, // max_nesting 0, // max_data 1, // allow_c_comments 1, // allow_yaml_comments pa_malloc, pa_realloc, pa_free }; if(params.count() == 2) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; if(Value* value=options->get("depth")) { config.max_nesting=r.process_to_value(*value).as_int(); valid_options++; } if(Value* value=options->get("double")) { json.handle_double=r.process_to_value(*value).as_bool(); valid_options++; } if(Value* value=options->get("distinct")) { const String& sdistinct=value->as_string(); if (!json.set_distinct(sdistinct)) throw Exception(PARSER_RUNTIME, &sdistinct, "must be 'first', 'last' or 'all'"); valid_options++; } if(Value* value=options->get("taint")) { json.taint=get_untaint_lang(value->as_string()); valid_options++; } if(Value* value=options->get("object")) { json.hook_object=value->get_junction(); json.request=&r; if (!json.hook_object || !json.hook_object->method || !json.hook_object->method->params_names || !(json.hook_object->method->params_names->count() == 2)) throw Exception(PARSER_RUNTIME, 0, "$.object must be parser method with 2 parameters"); valid_options++; } if(Value* value=options->get("array")) { json.hook_array=value->get_junction(); json.request=&r; if (!json.hook_array || !json.hook_array->method || !json.hook_array->method->params_names || !(json.hook_array->method->params_names->count() == 2)) throw Exception(PARSER_RUNTIME, 0, "$.array must be parser method with 2 parameters"); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } const String::Body json_body = json_string.cstr_to_string_body_untaint(String::L_JSON, r.connection(false), &r.charsets); const char *json_cstr = json.charset != NULL ? Charset::transcode(json_body, *json.charset, UTF8_charset).cstr() : json_body.cstr(); json_parser parser; if(int result = json_parser_init(&parser, &config, (json_parser_callback)&json_callback, &json)) throw Exception("json.parse", 0, "%s", json_error_message(result)); uint32_t processed; if(int result = json_parser_string(&parser, json_cstr, strlen(json_cstr), &processed)) throw Exception("json.parse", 0, "%s at byte %d", json_error_message(result), processed); if (!json_parser_is_done(&parser)) throw Exception("json.parse", 0, "unexpected end of json data"); json_parser_free(&parser); if (json.result) r.write_no_lang(*json.result); } const uint ANTI_ENDLESS_JSON_STRING_RECOURSION=128; char *get_indent(uint level){ static char* cache[ANTI_ENDLESS_JSON_STRING_RECOURSION]={}; if (!cache[level]){ char *result = static_cast(pa_gc_malloc_atomic(level+1)); memset(result, '\t', level); result[level]='\0'; return cache[level]=result; } return cache[level]; } class Json_string_recoursion { Json_options& foptions; public: Json_string_recoursion(Json_options& aoptions) : foptions(aoptions) { if(++foptions.json_string_recoursion==ANTI_ENDLESS_JSON_STRING_RECOURSION) throw Exception(PARSER_RUNTIME, 0, "call canceled - endless json recursion detected"); } ~Json_string_recoursion() { if(foptions.json_string_recoursion) foptions.json_string_recoursion--; } }; const String& value_json_string(String::Body key, Value& v, Json_options& options); const String* Json_options::hash_json_string(HashStringValue &hash) { if(!hash.count()) return new String("{}", String::L_AS_IS); Json_string_recoursion go_down(*this); String& result = *new String("{\n", String::L_AS_IS); if (indent){ String *delim=NULL; indent=get_indent(json_string_recoursion); for(HashStringValue::Iterator i(hash); i; i.next() ){ if (delim){ result << *delim; } else { result << indent << "\""; delim = new String(",\n", String::L_AS_IS); *delim << indent << "\""; } result << String(i.key(), String::L_JSON) << "\":" << value_json_string(i.key(), *i.value(), *this); } result << "\n" << (indent=get_indent(json_string_recoursion-1)) << "}"; } else { bool need_delim=false; for(HashStringValue::Iterator i(hash); i; i.next() ){ result << (need_delim ? ",\n\"" : "\""); result << String(i.key(), String::L_JSON) << "\":" << value_json_string(i.key(), *i.value(), *this); need_delim=true; } result << "\n}"; } return &result; } static bool based_on(HashStringValue::key_type key, HashStringValue::value_type /*value*/, Value* v) { return v->is(key.cstr()); } const String& value_json_string(String::Body key, Value& v, Json_options& options) { if(options.methods) { Value* method=options.methods->get(v.type()); if(!method){ method=options.methods->first_that(based_on, &v); options.methods->put(key, method ? method : VVoid::get()); } if(method && !method->is_void()) { Junction* junction=method->get_junction(); VMethodFrame frame(*junction->method, options.r->method_frame, junction->self); HashStringValue* params_hash=options.params && options.indent ? options.params->get_hash() : NULL; Temp_hash_value indent(params_hash, "indent", new VString(*new String(options.indent, String::L_AS_IS))); Value *params[]={new VString(*new String(key, String::L_JSON)), &v, options.params ? options.params : VVoid::get()}; frame.store_params(params, 3); options.r->execute_method(frame); return frame.result().as_string(); } } options.key=key; return *v.get_json_string(options); } static void _string(Request& r, MethodParams& params) { Json_options json(&r); if(params.count() == 2) if(HashStringValue* options=params.as_hash(1)) { json.params=params.get(1); HashStringValue* methods=new HashStringValue(); int valid_options=0; HashStringValue* vvalue; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "skip-unknown"){ json.skip_unknown=r.process_to_value(*value).as_bool(); valid_options++; } else if(key == "date" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_date_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'sql-string', 'gmt-string' or 'unix-timestamp'"); valid_options++; } else if(key == "indent"){ if(value->is_string()){ json.indent=value->as_string().cstr(); json.json_string_recoursion=strlen(json.indent); } else json.indent=r.process_to_value(*value).as_bool() ? "" : NULL; valid_options++; } else if(key == "table" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_table_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'array', 'object' or 'compact'"); valid_options++; } else if(key == "file" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_file_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'base64', 'text' or 'stat'"); valid_options++; #ifdef XML } else if(key == "xdoc" && (vvalue = value->get_hash())){ json.xdoc_options=new XDocOutputOptions(); json.xdoc_options->append(r, vvalue); valid_options++; #endif } else if(Junction* junction=value->get_junction()){ if(!junction->method || !junction->method->params_names || junction->method->params_names->count() != 3) throw Exception(PARSER_RUNTIME, 0, "$.%s must be parser method with 3 parameters", key.cstr()); methods->put(key, value); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); // special handling for $._default if(VHash* vhash=static_cast(params[1].as(VHASH_TYPE))) if(Value* value=vhash->get_default()) { Junction* junction=value->get_junction(); if(!junction || !junction->method || !junction->method->params_names || junction->method->params_names->count() != 3) throw Exception(PARSER_RUNTIME, 0, "$.%s must be parser method with 3 parameters", HASH_DEFAULT_ELEMENT_NAME); json.default_method=value; } if(methods->count()) json.methods=methods; } const String& result_string=value_json_string(String::Body(), params[0], json); String::Body result_body=result_string.cstr_to_string_body_untaint(String::L_JSON, r.connection(false), &r.charsets); r.write_pass_lang(*new String(result_body, String::L_AS_IS)); } // constructor MJson::MJson(): Methoded("json") { add_native_method("parse", Method::CT_STATIC, _parse, 1, 2); add_native_method("string", Method::CT_ANY, _string, 1, 2); } parser-3.4.3/src/classes/response.C000644 000000 000000 00000001503 11730603270 017300 0ustar00rootwheel000000 000000 /** @file Parser: @b response parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vresponse.h" volatile const char * IDENT_RESPONSE_C="$Id: response.C,v 1.28 2012/03/16 09:24:08 moko Exp $"; // class class MResponse: public Methoded { public: MResponse(); public: // Methoded bool used_directly() { return false; } }; // global variable DECLARE_CLASS_VAR(response, new MResponse, 0); // methods static void _clear(Request& r, MethodParams&) { GET_SELF(r, VResponse).fields().clear(); } // constructor MResponse::MResponse(): Methoded("response") { // ^clear[] add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); } parser-3.4.3/src/classes/curl.C000644 000000 000000 00000050020 12173310332 016401 0ustar00rootwheel000000 000000 /** @file Parser: @b curl parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) */ #include "pa_config_includes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_charsets.h" #include "pa_vstring.h" #include "pa_vtable.h" #include "pa_common.h" #include "pa_http.h" #include "ltdl.h" volatile const char * IDENT_CURL_C="$Id: curl.C,v 1.29 2013/07/22 20:06:50 moko Exp $"; class MCurl: public Methoded { public: MCurl(); }; // global variables DECLARE_CLASS_VAR(curl, new MCurl, 0); #include "curl.h" typedef CURL *(*t_curl_easy_init)(); t_curl_easy_init f_curl_easy_init; typedef CURLcode (*t_curl_easy_setopt)(CURL *, CURLoption option, ...); t_curl_easy_setopt f_curl_easy_setopt; typedef CURLcode (*t_curl_easy_perform)(CURL *); t_curl_easy_perform f_curl_easy_perform; typedef void (*t_curl_easy_cleanup)(CURL *); t_curl_easy_cleanup f_curl_easy_cleanup; typedef const char *(*t_curl_easy_strerror)(CURLcode); t_curl_easy_strerror f_curl_easy_strerror; typedef CURLcode (*t_curl_easy_getinfo)(CURL *curl, CURLINFO info, ...); t_curl_easy_getinfo f_curl_easy_getinfo; typedef struct curl_slist *(*t_curl_slist_append)(struct curl_slist *,const char *); t_curl_slist_append f_curl_slist_append; typedef const char *(*t_curl_version)(); t_curl_version f_curl_version; typedef CURLFORMcode (*t_curl_formadd)(struct curl_httppost **httppost, struct curl_httppost **last_post, ...); t_curl_formadd f_curl_formadd; typedef void (*t_curl_formfree)(struct curl_httppost *form); t_curl_formfree f_curl_formfree; #define GLINK(name) f_##name=(t_##name)lt_dlsym(handle, #name); #define DLINK(name) GLINK(name) if(!f_##name) return "function " #name " was not found"; static const char *dlink(const char *dlopen_file_spec) { pa_dlinit(); lt_dlhandle handle=lt_dlopen(dlopen_file_spec); if(!handle){ if(const char* result=lt_dlerror()) return result; return "can not open the dynamic link module"; } DLINK(curl_easy_init); DLINK(curl_easy_cleanup); DLINK(curl_version); DLINK(curl_easy_setopt); DLINK(curl_easy_perform); DLINK(curl_easy_strerror); DLINK(curl_easy_getinfo); DLINK(curl_slist_append); DLINK(curl_formadd); DLINK(curl_formfree); return 0; } class ParserOptions { public: const String *filename; const String *content_type; bool is_text; Charset *charset, *response_charset; struct curl_httppost *f_post; FILE *f_stderr; ParserOptions() : filename(0), content_type(0), is_text(true), charset(0), response_charset(0), f_post(0), f_stderr(0){} ~ParserOptions() { f_curl_formfree(f_post); if(f_stderr) fclose(f_stderr); } }; // using TLS instead of keeping variables in request THREAD_LOCAL CURL *fcurl = 0; THREAD_LOCAL ParserOptions *foptions = 0; static CURL *curl(){ if(!fcurl) throw Exception("curl", 0, "outside of 'session' operator"); return fcurl; } static ParserOptions &options(){ if(!foptions) throw Exception("curl", 0, "outside of 'session' operator"); return *foptions; } // using temporal object scheme to garanty cleanup call class Temp_curl { CURL *saved_curl; ParserOptions *saved_options; public: Temp_curl() : saved_curl(fcurl), saved_options(foptions){ fcurl = f_curl_easy_init(); foptions = new ParserOptions(); f_curl_easy_setopt(fcurl, CURLOPT_POSTFIELDSIZE, 0); // fix libcurl bug f_curl_easy_setopt(fcurl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); // avoid ipv6 by default } ~Temp_curl() { f_curl_easy_cleanup(fcurl); fcurl = saved_curl; delete foptions; foptions = saved_options; } }; bool curl_linked = false; const char *curl_library="libcurl" LT_MODULE_EXT; const char *curl_status = 0; static void temp_curl(void (*action)(Request&, MethodParams&), Request& r, MethodParams& params){ if(!curl_linked){ curl_linked=true; curl_status=dlink(curl_library); } if(curl_status == 0){ Temp_curl temp_curl; action(r,params); } else { throw Exception("curl", 0, "failed to load curl library %s: %s", curl_library, curl_status); } } static void _curl_session_action(Request& r, MethodParams& params){ Value& body_code=params.as_junction(0, "body must be code"); r.process_write(body_code); } static void _curl_session(Request& r, MethodParams& params){ temp_curl(_curl_session_action, r, params); } static void _curl_version_action(Request& r, MethodParams& ){ r.write_no_lang(*new VString(*new String(f_curl_version(), String::L_TAINTED))); } static void _curl_version(Request& r, MethodParams& params){ fcurl ? _curl_version_action(r, params) : temp_curl(_curl_version_action, r, params); } static char *str_lower(const char *str){ char *result=pa_strdup(str); for(char* c=result; *c; c++) *c=(char)tolower((unsigned char)*c); return result; } static char *str_upper(const char *str){ char *result=pa_strdup(str); for(char* c=result; *c; c++) *c=(char)toupper((unsigned char)*c); return result; } class CurlOption { public: enum OptionType { CURL_STRING, CURL_URLENCODE, // url-encoded string CURL_URL, CURL_INT, CURL_POST, CURL_FORM, CURL_HEADERS, CURL_FILE, CURL_STDERR, PARSER_LIBRARY, PARSER_NAME, PARSER_CONTENT_TYPE, PARSER_MODE, PARSER_CHARSET, PARSER_RESPONSE_CHARSET }; CURLoption id; OptionType type; CurlOption(CURLoption aid, OptionType atype): id(aid), type(atype) {} }; class CurlOptionHash: public HashString { public: CurlOptionHash() { #define CURL_OPT(type, name) put(str_lower(#name),new CurlOption(CURLOPT_##name, CurlOption::type)); #define PARSER_OPT(type, name) put(name,new CurlOption((CURLoption)0, CurlOption::type)); CURL_OPT(CURL_URL, URL); CURL_OPT(CURL_STRING, INTERFACE); CURL_OPT(CURL_INT, LOCALPORT); CURL_OPT(CURL_INT, PORT); CURL_OPT(CURL_INT, VERBOSE); CURL_OPT(CURL_STDERR, STDERR); CURL_OPT(CURL_INT, MAXFILESIZE); CURL_OPT(CURL_INT, HTTPAUTH); CURL_OPT(CURL_STRING, USERPWD); CURL_OPT(CURL_STRING, USERNAME); CURL_OPT(CURL_STRING, PASSWORD); CURL_OPT(CURL_URLENCODE, USERAGENT); CURL_OPT(CURL_URLENCODE, REFERER); CURL_OPT(CURL_INT, AUTOREFERER); CURL_OPT(CURL_STRING, ENCODING); // gzip or deflate CURL_OPT(CURL_STRING, ACCEPT_ENCODING); // gzip or deflate CURL_OPT(CURL_INT, FOLLOWLOCATION); CURL_OPT(CURL_INT, UNRESTRICTED_AUTH); CURL_OPT(CURL_INT, IPRESOLVE); CURL_OPT(CURL_INT, POST); CURL_OPT(CURL_INT, HTTPGET); CURL_OPT(CURL_INT, NOBODY); CURL_OPT(CURL_STRING, CUSTOMREQUEST); CURL_OPT(CURL_POST, POSTFIELDS); // hopefully is safe too CURL_OPT(CURL_POST, COPYPOSTFIELDS); CURL_OPT(CURL_FORM, HTTPPOST); CURL_OPT(CURL_HEADERS, HTTPHEADER); CURL_OPT(CURL_URLENCODE, COOKIE); CURL_OPT(CURL_URLENCODE, COOKIELIST); CURL_OPT(CURL_INT, COOKIESESSION); CURL_OPT(CURL_INT, IGNORE_CONTENT_LENGTH); CURL_OPT(CURL_INT, HTTP_CONTENT_DECODING); CURL_OPT(CURL_INT, HTTP_TRANSFER_DECODING); CURL_OPT(CURL_INT, MAXREDIRS); CURL_OPT(CURL_INT, POSTREDIR); CURL_OPT(CURL_STRING, RANGE); CURL_OPT(CURL_INT, TIMEOUT); CURL_OPT(CURL_INT, TIMEOUT_MS); CURL_OPT(CURL_INT, LOW_SPEED_LIMIT); CURL_OPT(CURL_INT, LOW_SPEED_TIME); CURL_OPT(CURL_INT, MAXCONNECTS); CURL_OPT(CURL_STRING, PROXY); CURL_OPT(CURL_INT, PROXYPORT); CURL_OPT(CURL_INT, PROXYTYPE); CURL_OPT(CURL_INT, HTTPPROXYTUNNEL); CURL_OPT(CURL_STRING, PROXYUSERPWD); CURL_OPT(CURL_INT, PROXYAUTH); CURL_OPT(CURL_INT, FRESH_CONNECT); CURL_OPT(CURL_INT, FORBID_REUSE); CURL_OPT(CURL_INT, CONNECTTIMEOUT); CURL_OPT(CURL_INT, CONNECTTIMEOUT_MS); CURL_OPT(CURL_INT, FAILONERROR); CURL_OPT(CURL_FILE, SSLCERT); CURL_OPT(CURL_STRING, SSLCERTTYPE); CURL_OPT(CURL_FILE, SSLKEY); CURL_OPT(CURL_STRING, SSLKEYTYPE); CURL_OPT(CURL_STRING, KEYPASSWD); CURL_OPT(CURL_STRING, SSLENGINE); CURL_OPT(CURL_STRING, SSLENGINE_DEFAULT); CURL_OPT(CURL_FILE, ISSUERCERT); CURL_OPT(CURL_FILE, CRLFILE); CURL_OPT(CURL_STRING, CAINFO); CURL_OPT(CURL_FILE, CAPATH); CURL_OPT(CURL_INT, SSL_VERIFYPEER); CURL_OPT(CURL_INT, SSL_VERIFYHOST); CURL_OPT(CURL_STRING, SSL_CIPHER_LIST); CURL_OPT(CURL_INT, SSL_SESSIONID_CACHE); PARSER_OPT(PARSER_LIBRARY, "library"); PARSER_OPT(PARSER_NAME, "name"); PARSER_OPT(PARSER_CONTENT_TYPE, "content-type"); PARSER_OPT(PARSER_MODE, "mode"); PARSER_OPT(PARSER_CHARSET, "charset"); PARSER_OPT(PARSER_RESPONSE_CHARSET, "response-charset"); } } *curl_options=0; static const char *curl_urlencode(const String &s, Request& r){ if(options().charset){ Temp_client_charset temp(r.charsets, *options().charset); return s.untaint_and_transcode_cstr(String::L_URI, &r.charsets); } else return s.untaint_cstr(String::L_URI); } static struct curl_slist *curl_headers(HashStringValue *value_hash, Request& r) { struct curl_slist *slist=NULL; for(HashStringValue::Iterator i(*value_hash); i; i.next() ){ String header = String(pa_http_safe_header_name(capitalize(i.key().cstr())), String::L_AS_IS) << ": " << String(i.value()->as_string(), String::L_HTTP_HEADER); slist=f_curl_slist_append(slist, curl_urlencode(header, r)); } return slist; } static const char* curl_transcode(const String &s, Request& r){ return options().charset ? Charset::transcode(s.cstr(), r.charsets.source(), *options().charset).cstr() : s.cstr(); } static void curl_form(HashStringValue *value_hash, Request& r){ struct curl_httppost *f_last=0; for(HashStringValue::Iterator i(*value_hash); i; i.next() ){ const char *key = curl_transcode(String(i.key().cstr()), r); if(const String* svalue = i.value()->get_string()){ // string f_curl_formadd(&options().f_post, &f_last, CURLFORM_PTRNAME, key, CURLFORM_PTRCONTENTS, curl_transcode(String(svalue->cstr()), r), CURLFORM_END); } else if(Table* tvalue = i.value()->get_table()){ // table for(size_t t = 0; t < tvalue->count(); t++) { f_curl_formadd(&options().f_post, &f_last, CURLFORM_PTRNAME, key, CURLFORM_PTRCONTENTS, curl_transcode(String(tvalue->get(t)->get(0)->cstr()), r), CURLFORM_END); } } else if(VFile* fvalue=static_cast(i.value()->as("file"))){ // file f_curl_formadd(&options().f_post, &f_last, CURLFORM_PTRNAME, key, CURLFORM_BUFFER, curl_transcode(String(fvalue->fields().get("name")->as_string(), String::L_FILE_SPEC), r), CURLFORM_BUFFERLENGTH, (long)fvalue->value_size(), CURLFORM_BUFFERPTR, fvalue->value_ptr(), CURLFORM_CONTENTTYPE, fvalue->fields().get("content-type")->as_string().taint_cstr(String::L_URI), CURLFORM_END); } else { throw Exception("curl", new String(i.key(), String::L_TAINTED), "is %s, form option value can be string, table or file only", i.value()->type()); } } } static const char *curl_check_file(const String &file_spec){ const char *file_spec_cstr=file_spec.taint_cstr(String::L_FILE_SPEC); struct stat finfo; if(stat(file_spec_cstr, &finfo)==0) check_safe_mode(finfo, file_spec, file_spec_cstr); return file_spec_cstr; } static void curl_setopt(HashStringValue::key_type key, HashStringValue::value_type value, Request& r) { CurlOption *opt=curl_options->get(key); if(opt==0) throw Exception("curl", 0, "called with invalid option '%s'", key.cstr()); CURLcode res = CURLE_OK; Value &v=r.process_to_value(*value); switch (opt->type){ case CurlOption::CURL_STRING:{ // string curl option const char *value_str=v.as_string().cstr(); res=f_curl_easy_setopt(curl(), opt->id, value_str); break; } case CurlOption::CURL_URLENCODE:{ // url-encoded string curl option const char *value_str=curl_urlencode(v.as_string(), r); res=f_curl_easy_setopt(curl(), opt->id, value_str); break; } case CurlOption::CURL_URL:{ // url-encoded string curl_url option const String url = v.as_string(); if(!url.starts_with("http://") && !url.starts_with("https://")) throw Exception("curl", 0, "failed to set option '%s': invalid url scheme '%s'", key.cstr(), url.cstr()); const char *value_str=curl_urlencode(url, r); res=f_curl_easy_setopt(curl(), opt->id, value_str); break; } case CurlOption::CURL_INT:{ // integer curl option long value_int=(long)v.as_double(); res=f_curl_easy_setopt(curl(), opt->id, value_int); break; } case CurlOption::CURL_POST:{ // http post curl option if(v.get_string()){ if( (res=f_curl_easy_setopt(curl(), CURLOPT_POSTFIELDSIZE, -1L)) == CURLE_OK ) res=f_curl_easy_setopt(curl(), opt->id, curl_urlencode(v.as_string(), r)); } else { VFile *file=v.as_vfile(String::L_AS_IS); if( (res=f_curl_easy_setopt(curl(), CURLOPT_POSTFIELDSIZE, (long)file->value_size())) == CURLE_OK ) res=f_curl_easy_setopt(curl(), opt->id, file->value_ptr()); } break; } case CurlOption::CURL_FORM:{ HashStringValue *value_hash = v.get_hash(); if(value_hash){ curl_form(value_hash, r); } else if(v.get_string()->is_empty()){ f_curl_formfree(options().f_post); options().f_post = 0; } else { throw Exception("curl", 0, "failed to set option '%s': value must be a hash", key.cstr()); } res=f_curl_easy_setopt(curl(), CURLOPT_HTTPPOST, foptions->f_post); break; } case CurlOption::CURL_HEADERS:{ // http headers curl option HashStringValue *value_hash=v.get_hash(); res=f_curl_easy_setopt(curl(), opt->id, value_hash ? curl_headers(value_hash, r) : 0); break; } case CurlOption::CURL_FILE:{ // file-spec curl option const char *file_spec_cstr=curl_check_file(r.absolute(v.as_string())); res=f_curl_easy_setopt(curl(), opt->id, file_spec_cstr); break; } case CurlOption::CURL_STDERR:{ // verbose output redirection from stderr to file curl option const char *file_spec_cstr=curl_check_file(r.absolute(v.as_string())); FILE *f_stderr=options().f_stderr=fopen(file_spec_cstr, "wt"); if (f_stderr){ res=f_curl_easy_setopt(curl(), opt->id, f_stderr); } else { throw Exception("curl", 0, "failed to set option '%s': unable to open file '%s'", key.cstr(), file_spec_cstr); } break; } case CurlOption::PARSER_LIBRARY:{ // 'library' parser option if(fcurl==0){ curl_library=v.as_string().taint_cstr(String::L_FILE_SPEC); } else throw Exception("curl", 0, "failed to set option '%s': already loaded", key.cstr()); break; } case CurlOption::PARSER_NAME:{ // 'name' parser option options().filename=&v.as_string(); break; } case CurlOption::PARSER_CONTENT_TYPE:{ // 'content-type' parser option options().content_type=&v.as_string(); break; } case CurlOption::PARSER_MODE:{ // 'mode' parser option options().is_text=VFile::is_text_mode(v.as_string()); break; } case CurlOption::PARSER_CHARSET:{ // 'charset' parser option options().charset=&::charsets.get(v.as_string().change_case(r.charsets.source(), String::CC_UPPER)); break; } case CurlOption::PARSER_RESPONSE_CHARSET:{ // 'response-charset' parser option options().response_charset=&::charsets.get(v.as_string().change_case(r.charsets.source(), String::CC_UPPER)); break; } } if(res != CURLE_OK) throw Exception("curl", 0, "failed to set option '%s': %s", key.cstr(), f_curl_easy_strerror(res)); } static void _curl_options(Request& r, MethodParams& params){ if(curl_options==0) curl_options=new CurlOptionHash(); if(HashStringValue* options=params.as_hash(0)) options->for_each(curl_setopt, r); } class Curl_buffer{ public: char *buf; size_t length; size_t buf_size; Curl_buffer() : buf((char *)pa_malloc(MAX_STRING+1)), length(0), buf_size(MAX_STRING){} }; static int curl_writer(char *data, size_t size, size_t nmemb, Curl_buffer *result){ if(result == 0) return 0; size=size*nmemb; if(size>0){ if(result->length + size >= result->buf_size){ result->buf_size = result->buf_size*2 + size; result->buf = (char *)pa_realloc(result->buf, result->buf_size+1); } memcpy(result->buf+result->length, data, size); result->length += size; } return size; } class Curl_response { public: HASH_STRING headers; Array cookies; }; static int curl_header(char *data, size_t size, size_t nmemb, Curl_response *result){ if(result == 0) return 0; size=size*nmemb; if(size>0){ char *line=pa_strdup(data, size); char *value=lsplit(line,':'); if(value && *line){ // we need only headers, not the response code const char* HEADER_NAME=str_upper(line); result->headers.put(HEADER_NAME, value); if(strcmp(HEADER_NAME, "SET-COOKIE")==0) result->cookies+=value; } } return size; } #define CURL_SETOPT(option, arg, message) \ if( (res=f_curl_easy_setopt(curl(), option, arg)) != CURLE_OK){ \ throw Exception("curl", 0, "failed to set " message ": %s", f_curl_easy_strerror(res)); \ } static void _curl_load_action(Request& r, MethodParams& params){ if(params.count()==1) _curl_options(r, params); CURLcode res; Curl_buffer body; CURL_SETOPT(CURLOPT_WRITEFUNCTION, curl_writer, "curl writer function"); CURL_SETOPT(CURLOPT_WRITEDATA, &body, "curl write buffer"); // we need a container for headers as VFile fields can be put only after VFile.set Curl_response response; CURL_SETOPT(CURLOPT_HEADERFUNCTION, curl_header, "curl header function"); CURL_SETOPT(CURLOPT_WRITEHEADER, &response, "curl header buffer"); if((res=f_curl_easy_perform(curl())) != CURLE_OK){ const char *ex_type = 0; switch(res){ case CURLE_OPERATION_TIMEDOUT: ex_type = "curl.timeout"; break; case CURLE_COULDNT_RESOLVE_HOST: ex_type = "curl.host"; break; case CURLE_COULDNT_CONNECT: ex_type = "curl.connect"; break; case CURLE_HTTP_RETURNED_ERROR: ex_type = "curl.status"; break; case CURLE_SSL_CONNECT_ERROR: case CURLE_SSL_CERTPROBLEM: case CURLE_SSL_CIPHER: case CURLE_SSL_CACERT: case CURLE_SSL_ENGINE_INITFAILED: ex_type = "curl.ssl"; break; } throw Exception( ex_type ? ex_type : "curl.fail", 0, "%s", f_curl_easy_strerror(res)); } // assure trailing zero body.buf[body.length]=0; VFile& result=*new VFile; String::Body ct_header = response.headers.get(HTTP_CONTENT_TYPE_UPPER); Charset *asked_charset = options().response_charset; if (asked_charset == 0){ Charset *remote_charset = ct_header.is_empty() ? 0 : detect_charset(ct_header.trim(String::TRIM_BOTH, " \t\n\r").cstr()); asked_charset = remote_charset ? remote_charset : options().charset; } if(options().is_text && asked_charset != 0){ String::C c=Charset::transcode(String::C(body.buf, body.length), *asked_charset, r.charsets.source()); body.buf=(char *)c.str; body.length=c.length; } result.set(true/*tainted*/, options().is_text, body.buf, body.length, options().filename , options().content_type ? new VString(*options().content_type) : 0, &r); long http_status = 0; if(f_curl_easy_getinfo(curl(), CURLINFO_RESPONSE_CODE, &http_status) == CURLE_OK){ result.fields().put("status", new VInt(http_status)); } for(HASH_STRING::Iterator i(response.headers); i; i.next() ){ String::Body HEADER_NAME=i.key(); String::Body value=i.value(); if(asked_charset){ HEADER_NAME=Charset::transcode(HEADER_NAME, *asked_charset, r.charsets.source()); value=Charset::transcode(value, *asked_charset, r.charsets.source()); } result.fields().put(HEADER_NAME, new VString(*new String(value.trim(String::TRIM_BOTH, " \t\n\r"), String::L_TAINTED))); } // filling $.cookies Table* tcookies=0; for(Array_iterator i(response.cookies); i.has_next(); ){ if(!tcookies){ Table::columns_type columns=new ArrayString(1); *columns+=new String("value"); tcookies=new Table(columns); } String::Body value=i.next(); if(asked_charset) value=Charset::transcode(value, *asked_charset, r.charsets.source()); ArrayString& row=*new ArrayString(1); row+=new String(value.trim(String::TRIM_BOTH, " \t\n\r"), String::L_TAINTED); *tcookies+=&row; } if(tcookies) result.fields().put(HTTP_COOKIES_NAME, new VTable(parse_cookies(r, tcookies))); r.write_no_lang(result); } static void _curl_load(Request& r, MethodParams& params){ fcurl ? _curl_load_action(r, params) : temp_curl(_curl_load_action, r, params); } // constructor MCurl::MCurl(): Methoded("curl") { add_native_method("session", Method::CT_STATIC, _curl_session, 1, 1); add_native_method("version", Method::CT_STATIC, _curl_version, 0, 0); add_native_method("options", Method::CT_STATIC, _curl_options, 1, 1); add_native_method("load", Method::CT_STATIC, _curl_load, 0, 1); } parser-3.4.3/src/classes/table.C000644 000000 000000 00000125660 12230057633 016546 0ustar00rootwheel000000 000000 /** @file Parser: @b table parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4)) #include #endif #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" #include "pa_charsets.h" #include "pa_vtable.h" #include "pa_vint.h" #include "pa_sql_connection.h" #include "pa_vbool.h" #include "pa_array.h" volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.300 2013/10/17 22:07:23 moko Exp $"; // class class MTable: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VTable(); } public: MTable(); }; // global variable DECLARE_CLASS_VAR(table, new MTable, 0); #define TABLE_REVERSE_NAME "reverse" // globals String sql_bind_name(SQL_BIND_NAME); String sql_limit_name(PA_SQL_LIMIT_NAME); String sql_offset_name(PA_SQL_OFFSET_NAME); String sql_default_name(SQL_DEFAULT_NAME); String sql_distinct_name(SQL_DISTINCT_NAME); String sql_value_type_name(SQL_VALUE_TYPE_NAME); String table_reverse_name(TABLE_REVERSE_NAME); // methods static Table::Action_options get_action_options(Request& r, MethodParams& params, size_t options_index, const Table& source) { Table::Action_options result; if(params.count() <= options_index) return result; HashStringValue* options=params.as_hash(options_index); if(!options) return result; result.defined=true; bool defined_offset=false; int valid_options=0; if(Value* voffset=options->get(sql_offset_name)) { valid_options++; defined_offset=true; if(voffset->is_string()) { const String& soffset=*voffset->get_string(); if(soffset == "cur") result.offset=source.current(); else throw Exception(PARSER_RUNTIME, &soffset, "must be 'cur' string or expression"); } else result.offset=r.process_to_value(*voffset).as_int(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; result.limit=r.process_to_value(*vlimit).as_int(); } if(Value *vreverse=(Value *)options->get(table_reverse_name)) { valid_options++; result.reverse=r.process_to_value(*vreverse).as_bool(); if(result.reverse && !defined_offset) result.offset=source.count()-1; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); return result; } static void check_option_param(bool options_defined, MethodParams& params, size_t next_param_index, const char *msg) { if(next_param_index+(options_defined?1:0) != params.count()) throw Exception(PARSER_RUNTIME, 0, "%s", msg); } struct TableSeparators { char column; const String* scolumn; char encloser; const String* sencloser; TableSeparators(): column('\t'), scolumn(new String("\t")), encloser(0), sencloser(0) {} int load( HashStringValue& options ) { int result=0; if(Value* vseparator=options.get(PA_COLUMN_SEPARATOR_NAME)) { scolumn=&vseparator->as_string(); if(scolumn->length()!=1) throw Exception(PARSER_RUNTIME, scolumn, "separator must be one character long"); column=scolumn->first_char(); result++; } if(Value* vencloser=options.get(PA_COLUMN_ENCLOSER_NAME)) { sencloser=&vencloser->as_string(); if(sencloser->is_empty()){ encloser=0; } else { if(sencloser->length()!=1) throw Exception(PARSER_RUNTIME, sencloser, "encloser must be one character long"); encloser=sencloser->first_char(); } result++; } return result; } }; static void _create(Request& r, MethodParams& params) { // clone/copy part? if(Table *source=params[0].get_table()) { Table::Action_options o=get_action_options(r, params, 1, *source); check_option_param(o.defined, params, 1, "too many parameters"); GET_SELF(r, VTable).set_table(*new Table(*source, o)); return; } size_t data_param_index=0; bool nameless=false; if(params.count()>1) { if(params[0].is_string()){ // can be nameless only const String& snameless=params.as_string(0, "called with more then 1 param, first param may be only string 'nameless' or junction"); if(snameless!="nameless") throw Exception(PARSER_RUNTIME, &snameless, "table::create called with more then 1 param, first param may be only 'nameless'"); nameless=true; data_param_index++; } } HashStringValue *options=0; TableSeparators separators; size_t options_param_index=data_param_index+1; if( options_param_indexis_empty()) *columns += new String(); else head[0]->split(*columns, col_pos_after, *separators.scolumn, String::L_AS_IS); } } Table& table=*new Table(columns); // parse cells ArrayString rows; data.split(rows, raw_pos_after, "\n", String::L_AS_IS); Array_iterator i(rows); while(i.has_next()) { Table::element_type row(new ArrayString); const String& string=*i.next(); // remove comment lines if(string.is_empty()) continue; size_t col_pos_after=0; string.split(*row, col_pos_after, *separators.scolumn, String::L_AS_IS); table+=row; } // replace any previous table value GET_SELF(r, VTable).set_table(table); } struct lsplit_result { char* piece; char delim; operator bool() { return piece!=0; } }; inline lsplit_result lsplit(char* string, char delim1, char delim2) { lsplit_result result; if(string) { char delims[]={delim1, delim2, 0}; if(char* v=strpbrk(string, delims)) { result.delim=*v; *v=0; result.piece=v+1; return result; } } result.piece=0; result.delim=0; return result; } inline lsplit_result lsplit(char* *string_ref, char delim1, char delim2) { lsplit_result result; result.piece=*string_ref; lsplit_result next=lsplit(*string_ref, delim1, delim2); result.delim=next.delim; *string_ref=next.piece; return result; } static lsplit_result lsplit(char** string_ref, char delim1, char delim2, char encloser) { lsplit_result result; if(char* string=*string_ref) { if(encloser && *string==encloser) { string++; char *read; char *write; write=read=string; char c; // we are enclosed, searching for second encloser while(c=*read++) { if(c==encloser) { if(*read==encloser) // double-encloser stands for encloser read++; else break; // note: skipping encloser } *write++=c; } // we are no longer enclosed, searching for delimiter, skipping extra enclosers while(c=*read++) { if(c==delim1 || c==delim2) { result.delim=c; break; } else if(c!=encloser) *write++=c; } *write=0; // terminate *string_ref=c? read: 0; result.piece=string; return result; } else return lsplit(string_ref, delim1, delim2); } result.piece=0; return result; } static void skip_empty_and_comment_lines( char** data_ref ) { if(char *data=*data_ref) { while( char c=*data ) { if( c== '\n' || c == '#' ) { /*nowhere=*/getrow(&data); // remove empty&comment lines if(!(*data_ref=data)) break; continue; } break; } } } static void skip_empty_lines( char** data_ref ) { if(char *data=*data_ref) { while( char c=*data ) { if( c== '\n' ) { /*nowhere=*/getrow(&data); // remove empty lines if(!(*data_ref=data)) break; continue; } break; } } } typedef void (*Skip_lines_action)(char** data_ref); static void _load(Request& r, MethodParams& params) { const String& first_param=params.as_string(0, FILE_NAME_MUST_BE_STRING); int filename_param_index=0; bool nameless=first_param=="nameless"; if(nameless) filename_param_index++; size_t options_param_index=filename_param_index+1; HashStringValue *options=0; TableSeparators separators; if(options_param_indexcount(): 0; // parse cells Table::element_type row(new ArrayString(columns_count)); skip_lines_action(&data); while( lsplit_result sr=lsplit(&data, separators.column, '\n', separators.encloser) ) { if(!*sr.piece && !sr.delim && !row->count()) // append last empty column [if without \n] break; *row+=new String(sr.piece, String::L_TAINTED); if(sr.delim=='\n') { table+=row; row=new ArrayString(columns_count); skip_lines_action(&data); } } // last line [if without \n] if(row->count()) table+=row; // replace any previous table value GET_SELF(r, VTable).set_table(table); } #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4)) #define USE_STRINGSTREAM #endif #ifdef USE_STRINGSTREAM #include "gc_allocator.h" typedef std::basic_stringstream, gc_allocator > pa_stringstream; typedef std::basic_string, gc_allocator > pa_string; static void enclose( pa_stringstream& to, const String* from, char encloser ) { if(from){ to<pos( encloser, pos_after ))!=STRING_NOT_FOUND; pos_after=pos_before) { pos_before++; // including first encloser (and skipping it for next pos) to<mid(pos_after, pos_before).cstr(); to<length(); if(pos_aftermid(pos_after, from_length).cstr(); to< i(*table.columns()); i.has_next(); ) { enclose( result, i.next(), separators.encloser ); if(i.has_next()) result< i(*table.columns()); i.has_next(); ) { result<cstr(); if(i.has_next()) result<count():0) for(int column=0; column i(table); if(separators.encloser){ while(i.has_next()) { for(Array_iterator c(*i.next()); c.has_next(); ) { enclose( result, c.next(), separators.encloser ); if(c.has_next()) result< c(*i.next()); c.has_next(); ) { result<cstr(); if(c.has_next()) result<pos( encloser, pos_after ))!=STRING_NOT_FOUND; pos_after=pos_before) { pos_before++; // including first encloser (and skipping it for next pos) to<mid(pos_after, pos_before); to<<*sencloser; // doubling encloser } // last piece size_t from_length=from->length(); if(pos_aftermid(pos_after, from_length); to<<*sencloser; } else { to<<*sencloser<<*sencloser; } } static void table_to_csv(String& result, Table& table, TableSeparators& separators, bool output_column_names) { if(output_column_names) { if(table.columns()) { // named table if(separators.encloser) { for(Array_iterator i(*table.columns()); i.has_next(); ) { enclose( result, i.next(), separators.encloser, separators.sencloser ); if(i.has_next()) result<<*separators.scolumn; } } else { for(Array_iterator i(*table.columns()); i.has_next(); ) { result<<*i.next(); if(i.has_next()) result<<*separators.scolumn; } } } else { // nameless table [we were asked to output column names] if(int lsize=table.count()?table[0]->count():0) for(int column=0; column i(table); if(separators.encloser){ while(i.has_next()) { for(Array_iterator c(*i.next()); c.has_next(); ) { enclose( result, c.next(), separators.encloser, separators.sencloser ); if(c.has_next()) result<<*separators.scolumn; } result.append_know_length("\n", 1, String::L_CLEAN); } } else { while(i.has_next()) { for(Array_iterator c(*i.next()); c.has_next(); ) { result<<*c.next(); if(c.has_next()) result<<*separators.scolumn; } result.append_know_length("\n", 1, String::L_CLEAN); } } } #endif // don't use stringstream static void _save(Request& r, MethodParams& params) { const String& first_arg=params.as_string(0, FIRST_ARG_MUST_NOT_BE_CODE); size_t param_index=1; bool do_append=false; bool output_column_names=true; // mode? if(first_arg=="append") do_append=true; else if(first_arg=="nameless") output_column_names=false; else --param_index; const String& file_name=params.as_string(param_index++, FILE_NAME_MUST_NOT_BE_CODE); String file_spec=r.absolute(file_name); if(do_append && file_exist(file_spec)) output_column_names=false; TableSeparators separators; if(param_indexcount()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(param_index0 && params[0].is_string()) { if(params.as_string(0, FIRST_ARG_MUST_NOT_BE_CODE)=="nameless") { output_column_names=false; param_index++; } else { throw Exception(PARSER_RUNTIME, 0, "bad mode (must be nameless)"); } } TableSeparators separators; if(param_indexcount()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } Table& table=GET_SELF(r, VTable).table(); #ifdef USE_STRINGSTREAM pa_stringstream ost(std::stringstream::out); table_to_csv(ost, table, separators, output_column_names); r.write_no_lang(*new VString(*new String(pa_strdup(ost.str().c_str()), String::L_CLEAN))); #else String sdata; table_to_csv(sdata, table, separators, output_column_names); r.write_no_lang(*new VString(*new String(sdata.cstr(), String::L_CLEAN))); #endif } static void _count(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); size_t result=0; if(params.count()) { const String& param=params.as_string(0, PARAMETER_MUST_BE_STRING); if(param == "columns") result = table.columns() ? table.columns()->count() : 0; else if(param == "cells") result = table.count() ? table[table.current()]->count() : 0; else if(param == "rows") // synonim for ^table.count[] result = table.count(); else throw Exception(PARSER_RUNTIME, ¶m, "parameter must be 'columns', 'cells' and 'rows' only"); } else result = table.count(); r.write_no_lang(*new VInt(result)); } static void _line(Request& r, MethodParams&) { int result=1+GET_SELF(r, VTable).table().current(); r.write_no_lang(*new VInt(result)); } static void _offset(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); if(params.count()) { bool absolute=false; if(params.count()>1) { const String& whence=params.as_string(0, "whence must be string"); if(whence=="cur") absolute=false; else if(whence=="set") absolute=true; else throw Exception(PARSER_RUNTIME, &whence, "is invalid whence, valid are 'cur' or 'set'"); } int offset=params.as_int(params.count()-1, "offset must be expression", r); table.offset(absolute, offset); } else r.write_no_lang(*new VInt(table.current())); } static void _menu(Request& r, MethodParams& params) { InCycle temp(r); Value& body_code=params.as_junction(0, "body must be code"); Value* delim_maybe_code=params.count()>1?¶ms[1]:0; Table& table=GET_SELF(r, VTable).table(); size_t saved_current=table.current(); size_t size=table.count(); if(delim_maybe_code) { // delimiter set bool need_delim=false; for(size_t row=0; rowis_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write_pass_lang(r.process(*delim_maybe_code)); else need_delim=true; } r.write_pass_lang(sv_processed); if(lskip==Request::SKIP_BREAK) break; } } else { for(size_t row=0; row* value_fields; HashStringValue* hash; Table2hash_distint distinct; size_t row; Table2hash_value_type value_type; }; #endif static void table_row_to_hash(Table::element_type row, Row_info *info) { const String* key; if(info->key_code) { info->table->set_current(info->row++); // change context row StringOrValue sv_processed=info->r->process(*info->key_code); key=&sv_processed.as_string(); } else { key=info->key_fieldcount()?row->get(info->key_field):0; } if(!key) return; // ignore rows without key [too-short-record_array if-indexed] bool exist=false; switch(info->value_type) { case C_STRING: { size_t index=info->value_fields->get(0); exist=info->hash->put_dont_replace(*key, (index < row->count()) ? new VString(*row->get(index)) : new VString()); break; } case C_HASH: { VHash* vhash=new VHash; HashStringValue& hash=vhash->hash(); for(Array_iterator i(*info->value_fields); i.has_next(); ) { size_t value_field=i.next(); if(value_fieldcount()) hash.put( *info->table->columns()->get(value_field), new VString(*row->get(value_field))); } exist=info->hash->put_dont_replace(*key, vhash); break; } case C_TABLE: { VTable* vtable=(VTable*)info->hash->get(*key); // table exist? Table* table; if(vtable) { if(info->distinct==D_ILLEGAL) { exist=true; break; } table=vtable->get_table(); } else { // no? creating table of same structure as source Table::Action_options table_options(0, 0); table=new Table(*info->table, table_options/*no rows, just structure*/); info->hash->put(*key, new VTable(table)); } *table+=row; break; } } if(exist && info->distinct==D_ILLEGAL) throw Exception(PARSER_RUNTIME, key, "duplicate key"); } Table2hash_value_type get_value_type(Value& vvalue_type){ if(vvalue_type.is_string()) { const String& svalue_type=*vvalue_type.get_string(); if(svalue_type == "table"){ return C_TABLE; } else if (svalue_type == "string") { return C_STRING; } else if (svalue_type == "hash") { return C_HASH; } else { throw Exception(PARSER_RUNTIME, &svalue_type, "must be 'hash', 'table' or 'string'"); } } else { throw Exception(PARSER_RUNTIME, 0, "'type' must be hash"); } } static void _hash(Request& r, MethodParams& params) { Table& self_table=GET_SELF(r, VTable).table(); VHash& result=*new VHash; if(Table::columns_type columns=self_table.columns()){ if(columns->count()>0) { Table2hash_distint distinct=D_ILLEGAL; Table2hash_value_type value_type=C_HASH; int param_index=params.count()-1; if(param_index>0) { if(HashStringValue* options=params.as_no_junction(param_index, PARAM_MUST_NOT_BE_CODE).get_hash()){ // can't use .as_has because the 2nd param could be table so .as_hash throws an error --param_index; int valid_options=0; if(Value* vdistinct_code=options->get(sql_distinct_name)) { // $.distinct ? valid_options++; Value& vdistinct_value=r.process_to_value(*vdistinct_code); if(vdistinct_value.is_string()) { const String& sdistinct=*vdistinct_value.get_string(); if(sdistinct=="tables") { value_type=C_TABLE; distinct=D_FIRST; } else { throw Exception(PARSER_RUNTIME, &sdistinct, "must be 'tables' or true/false"); } } else { distinct=vdistinct_value.as_bool()?D_FIRST:D_ILLEGAL; } } if(Value* vvalue_type_code=options->get(sql_value_type_name)) { // $.type ? if(value_type==C_TABLE) // $.distinct[tables] already was specified throw Exception(PARSER_RUNTIME, 0, "you can't specify $.distinct[tables] and $.type[] together"); valid_options++; value_type=get_value_type(r.process_to_value(*vvalue_type_code)); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } } if(param_index==2) // options was specified but not as hash throw Exception(PARSER_RUNTIME, 0, "options must be hash"); Array value_fields; if(param_index==0){ // list of columns wasn't specified if(value_type==C_STRING) // $.type[string] throw Exception(PARSER_RUNTIME, 0, "you must specify one value field with option $.type[string]"); for(size_t i=0; icount(); i++) // by all columns, including key value_fields+=i; } else { // list of columns was specified if(value_type==C_TABLE) throw Exception(PARSER_RUNTIME, 0, "you can't specify value field(s) with option $.distinct[tables] or $.type[tables]"); Value& value_fields_param=params.as_no_junction(param_index, "value field(s) must not be code"); if(value_fields_param.is_string()) { // one column as string was specified value_fields+=self_table.column_name2index(*value_fields_param.get_string(), true); } else if(Table* value_fields_table=value_fields_param.get_table()) { // list of columns were specified in table for(Array_iterator i(*value_fields_table); i.has_next(); ) { const String& value_field_name =*i.next()->get(0); value_fields +=self_table.column_name2index(value_field_name, true); } } else throw Exception(PARSER_RUNTIME, 0, "value field(s) must be string or table"); } if(value_type==C_STRING && value_fields.count()!=1) throw Exception(PARSER_RUNTIME, 0, "you can specify only one value field with option $.type[string]"); { Value* key_param=¶ms[0]; Row_info info={ &r, &self_table, /*key_code=*/key_param->get_junction()?key_param:0, /*key_field=*/0/*filled below*/, &value_fields, &result.hash(), distinct, /*row=*/0, value_type }; info.key_field=(info.key_code?-1 :self_table.column_name2index(key_param->as_string(), true)); int saved_current=self_table.current(); self_table.for_each(table_row_to_hash, &info); self_table.set_current(saved_current); result.extract_default(); } } } r.write_no_lang(result); } #ifndef DOXYGEN struct Table_seq_item { ArrayString* row; union { const char *c_str; double d; } value; }; #endif static int sort_cmp_string(const void *a, const void *b) { return strcmp( static_cast(a)->value.c_str, static_cast(b)->value.c_str ); } static int sort_cmp_double(const void *a, const void *b) { double va=static_cast(a)->value.d; double vb=static_cast(b)->value.d; if(vavb) return +1; else return 0; } static void _sort(Request& r, MethodParams& params) { Value& key_maker=params.as_junction(0, "key-maker must be code"); bool reverse=params.count()>1/*..[desc|asc|]*/? reverse=params.as_no_junction(1, "order must not be code").as_string()=="desc": false; // default=asc Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(old_table.columns()); Table_seq_item* seq=new(PointerFreeGC) Table_seq_item[old_table.count()]; int i; // calculate key values bool key_values_are_strings=true; int old_count=old_table.count(); for(i=0; ir->process_to_value(*info->expression_code).as_bool(); } static bool _locate_expression(Table& table, Request& r, MethodParams& params) { Value& expression_code=params.as_junction(0, "must be expression"); const size_t options_index=1; Table::Action_options o=get_action_options(r, params, options_index, table); check_option_param(o.defined, params, options_index, "locate by expression only has parameters: expression and, maybe, options"); Expression_is_true_info info={&r, &expression_code}; return table.table_first_that(expression_is_true, &info, o); } static bool _locate_name_value(Table& table, Request& r, MethodParams& params) { const String& name=params.as_string(0, "column name must be string"); const String& value=params.as_string(1, VALUE_MUST_BE_STRING); const size_t options_index=2; Table::Action_options o=get_action_options(r, params, options_index, table); check_option_param(o.defined, params, options_index, "locate by name has parameters: name, value and, maybe, options"); return table.locate(name, value, o); } static void _locate(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); bool result=params[0].get_junction() || (params.count() == 1) ? _locate_expression(table, r, params) : _locate_name_value(table, r, params); r.write_no_lang(VBool::get(result)); } static void _flip(Request& r, MethodParams&) { Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(0); if(size_t old_count=old_table.count()) if(size_t old_cols=old_table.columns()?old_table.columns()->count():old_table[0]->count()) for(size_t column=0; columncount()?old_row->get(column):new String; } new_table+=new_row; } r.write_no_lang(*new VTable(&new_table)); } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String& rownum_name=params.as_string(0, "rownum-var name must be string"); const String& value_name=params.as_string(1, "value-var name must be string"); Value& body_code=params.as_junction(2, "body must be code"); Value* delim_maybe_code=params.count()>3?¶ms[3]:0; Table& table=GET_SELF(r, VTable).table(); size_t saved_current=table.current(); size_t size=table.count(); const String* rownum_var_name=rownum_name.is_empty()? 0 : &rownum_name; const String* value_var_name=value_name.is_empty()? 0 : &value_name; Value* var_context=r.get_method_frame()->caller(); if(delim_maybe_code) { // delimiter set bool need_delim=false; for(size_t row=0; rowis_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write_pass_lang(r.process(*delim_maybe_code)); else need_delim=true; } r.write_pass_lang(sv_processed); if(lskip==Request::SKIP_BREAK) break; } } else { for(size_t row=0; rowcolumns(); size_t dest_columns_count=dest_columns->count(); Table::element_type dest_row(new ArrayString(dest_columns_count)); for(size_t dest_column=0; dest_columnget(dest_column)); *dest_row+=src_item?src_item:new String; } *dest+=dest_row; } static void join_nameless_row(Table& src, Table* dest) { *dest+=src[src.current()]; } static void _join(Request& r, MethodParams& params) { Table& src=*params.as_table(0, "source"); Table::Action_options o=get_action_options(r, params, 1, src); check_option_param(o.defined, params, 1, "invalid extra parameter"); Table& dest=GET_SELF(r, VTable).table(); if(&src == &dest) throw Exception(PARSER_RUNTIME, 0, "source and destination are same table"); if(dest.columns()) // dest is named src.table_for_each(join_named_row, &dest, o); else // dest is nameless src.table_for_each(join_nameless_row, &dest, o); } #ifndef DOXYGEN class Table_sql_event_handlers: public SQL_Driver_query_event_handlers { ArrayString& columns; int columns_count; ArrayString* row; public: Table* table; public: Table_sql_event_handlers() : columns(*new ArrayString), row(0), table(0) { } bool add_column(SQL_Error& error, const char *str, size_t ) { try { columns+=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */); return false; } catch(...) { error=SQL_Error("exception occured in Table_sql_event_handlers::add_column"); return true; } } bool before_rows(SQL_Error& error) { try { table=new Table(&columns); columns_count=columns.count(); return false; } catch(...) { error=SQL_Error("exception occured in Table_sql_event_handlers::before_rows"); return true; } } bool add_row(SQL_Error& error) { try { *table+=row=new ArrayString(columns_count); return false; } catch(...) { error=SQL_Error("exception occured in Table_sql_event_handlers::add_row"); return true; } } bool add_row_cell(SQL_Error& error, const char* str, size_t ) { try { *row+=str?new String(str, String::L_TAINTED /* no length as 0x00 can be inside */):&String::Empty; return false; } catch(...) { error=SQL_Error("exception occured in Table_sql_event_handlers::add_row_cell"); return true; } } }; #endif static void marshal_bind( HashStringValue::key_type aname, HashStringValue::value_type avalue, SQL_Driver::Placeholder** pptr) { SQL_Driver::Placeholder& ph=**pptr; ph.name=aname.cstr(); ph.value=avalue->as_string().untaint_cstr(String::L_AS_IS); ph.is_null=avalue->get_class()==void_class; ph.were_updated=false; (*pptr)++; } // not static, used elsewhere int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders) { int hash_count=hash.count(); placeholders=new(UseGC) SQL_Driver::Placeholder[hash_count]; SQL_Driver::Placeholder* ptr=placeholders; hash.for_each(marshal_bind, &ptr); return hash_count; } // not static, used elsewhere void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders) { SQL_Driver::Placeholder* ph=placeholders; for(int i=0; iwere_updated) { Value* value; if(ph->is_null) value=VVoid::get(); else value=new VString(*new String(ph->value, String::L_TAINTED)); hash.put(ph->name, value); } } static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process_to_value(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process_to_value(*voffset).as_double(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); Temp_lang temp_lang(r, String::L_SQL); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); Table_sql_event_handlers handlers; r.connection()->query( statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); Table& result= handlers.table?*handlers.table: // query resulted in table? return it *new Table(Table::columns_type(0)); // query returned no table, fake it // replace any previous table value GET_SELF(r, VTable).set_table(result); } static void _columns(Request& r, MethodParams& params) { const String* column_column_name; if(params.count()>0) column_column_name=¶ms.as_string(0, COLUMN_NAME_MUST_BE_STRING); else column_column_name=new String("column"); Table::columns_type result_columns(new ArrayString); *result_columns+=column_column_name; Table& result_table=*new Table(result_columns); Table& source_table=GET_SELF(r, VTable).table(); if(Table::columns_type source_columns=source_table.columns()) { for(Array_iterator i(*source_columns); i.has_next(); ) { Table::element_type result_row(new ArrayString); *result_row+=i.next(); result_table+=result_row; } } r.write_no_lang(*new VTable(&result_table)); } static void _select(Request& r, MethodParams& params) { Value& vcondition=params.as_expression(0, "condition must be number, bool or expression"); Table& source_table=GET_SELF(r, VTable).table(); int limit=source_table.count(); int offset=0; bool reverse=false; if(params.count()>1) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=r.process_to_value(*vlimit).as_int(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=r.process_to_value(*voffset).as_int(); } if(Value* vreverse=options->get(table_reverse_name)) { valid_options++; reverse=r.process_to_value(*vreverse).as_bool(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } Table& result_table=*new Table(source_table.columns()); size_t size=source_table.count(); if(offset<0) offset+=size; if(size && limit>0 && offset>=0 && (size_t)offset (size_t)offset) // ...condition is true, adding to the result result_table+=source_table[row]; if(row==0) break; } } else { for(size_t row=0; row < size && result_table.count() < (size_t)limit; row++) { source_table.set_current(row); bool condition=r.process_to_value(vcondition, false/*don't intercept string*/).as_bool(); if(condition && ++appended > (size_t)offset) // ...condition is true, adding to the result result_table+=source_table[row]; } } source_table.set_current(saved_current); } r.write_no_lang(*new VTable(&result_table)); } // constructor MTable::MTable(): Methoded("table") { // ^table::create{data} // ^table::create[nameless]{data} // ^table::create[table] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 3); // old name for compatibility with <= v 1.141 2002/01/25 11:33:45 paf add_native_method("set", Method::CT_DYNAMIC, _create, 1, 3); // ^table::load[file] // ^table::load[nameless;file] add_native_method("load", Method::CT_DYNAMIC, _load, 1, 3); // ^table.save[file] // ^table.save[nameless;file] add_native_method("save", Method::CT_DYNAMIC, _save, 1, 3); // add_native_method("save_old", Method::CT_DYNAMIC, _save_old, 1, 3); // ^table.csv-string[] // ^table.csv-string[nameless] // ^table.csv-string[nameless;$.encloser["] $.separator[,]] add_native_method("csv-string", Method::CT_DYNAMIC, _csv_string, 0, 2); // ^table.count[] // ^table.count[rows] // ^table.count[columns] // ^table.count[cells] add_native_method("count", Method::CT_DYNAMIC, _count, 0, 1); // ^table.line[] add_native_method("line", Method::CT_DYNAMIC, _line, 0, 0); // ^table.offset[] // ^table.offset(offset) // ^table.offset[cur|set](offset) add_native_method("offset", Method::CT_DYNAMIC, _offset, 0, 2); // ^table.menu{code} // ^table.menu{code}[delim] add_native_method("menu", Method::CT_DYNAMIC, _menu, 1, 2); // ^table.hash[key field name] // ^table.hash[key field name][value field name(s) string/table] add_native_method("hash", Method::CT_DYNAMIC, _hash, 1, 3); // ^table.sort{string-key-maker} ^table.sort{string-key-maker}[desc|asc] // ^table.sort(numeric-key-maker) ^table.sort(numeric-key-maker)[desc|asc] add_native_method("sort", Method::CT_DYNAMIC, _sort, 1, 2); // ^table.locate[field;value] add_native_method("locate", Method::CT_DYNAMIC, _locate, 1, 3); // ^table.flip[] add_native_method("flip", Method::CT_DYNAMIC, _flip, 0, 0); // ^table.foreach[row-num;value]{code} // ^table.foreach[row-num;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 3, 4); // ^table.append{r{tab}e{tab}c{tab}o{tab}r{tab}d} add_native_method("append", Method::CT_DYNAMIC, _append, 1, 1); // ^table.join[table][$.limit(10) $.offset(1) $.offset[cur] ] add_native_method("join", Method::CT_DYNAMIC, _join, 1, 2); // ^table::sql[query] // ^table::sql[query][$.limit(1) $.offset(2)] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // ^table.columns[[column name]] add_native_method("columns", Method::CT_DYNAMIC, _columns, 0, 1); // ^table.select(expression) = table add_native_method("select", Method::CT_DYNAMIC, _select, 1, 2); } parser-3.4.3/src/classes/form.C000644 000000 000000 00000004330 11730603267 016414 0ustar00rootwheel000000 000000 /** @file Parser: @b form parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vform.h" volatile const char * IDENT_FORM_C="$Id: form.C,v 1.43 2012/03/16 09:24:07 moko Exp $"; /// $LIMITS.max_post_size default 10M const size_t MAX_POST_SIZE_DEFAULT=10*0x400*0x400; // class class MForm : public Methoded { public: // Methoded bool used_directly() { return false; } void configure_admin(Request& r); public: MForm(): Methoded("form") {} }; // global variable DECLARE_CLASS_VAR(form, 0/*fictive*/, new MForm); // defines for statics #define LIMITS_NAME "LIMITS" #define MAX_POST_SIZE_NAME "post_max_size" // statics static const String max_post_size_name(MAX_POST_SIZE_NAME); static const String limits_name(LIMITS_NAME); // methods // constructor & configurator void MForm::configure_admin(Request& r) { Value* limits=r.main_class.get_element(limits_name); if(r.request_info.method && StrStartFromNC(r.request_info.method, "post", true)) { // $limits.max_post_size default 10M Value* element=limits?limits->get_element(max_post_size_name) :0; size_t value=element?(size_t)element->as_double():0; size_t max_post_size=value?value:MAX_POST_SIZE_DEFAULT; if(r.request_info.content_length>max_post_size) throw Exception(PARSER_RUNTIME, 0, "posted content_length(%u) > $"LIMITS_NAME"."MAX_POST_SIZE_NAME"(%u)", r.request_info.content_length, max_post_size); // read POST data if(r.request_info.content_length) { char *post_data=new(PointerFreeGC) char[r.request_info.content_length+1/*terminating zero*/]; size_t post_size=SAPI::read_post(r.sapi_info, post_data, r.request_info.content_length); post_data[post_size]=0; // terminating zero r.request_info.post_data=post_data; r.request_info.post_size=post_size; } else { r.request_info.post_data=0; r.request_info.post_size=0; } if(r.request_info.post_size!=r.request_info.content_length) throw Exception(0, 0, "post_size(%u) != content_length(%u)", r.request_info.post_size, r.request_info.content_length); } } parser-3.4.3/src/classes/classes.awk000644 000000 000000 00000000707 11730603266 017511 0ustar00rootwheel000000 000000 # Parser: classes.inc generator # # Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) # Author: Alexander Petrosyan (http://design.ru/paf) # # $Id: classes.awk,v 1.9 2012/03/16 09:24:06 moko Exp $ /\.C$/ && !/(op|classes)/ { s=$0 c=substr(s,1,length(s)-2) printf "extern Methoded* %s_class; extern Methoded* %s_base_class; if(%s_class) *this+=%s_class; if(%s_base_class) *this+=%s_base_class;\n", c,c,c,c,c,c } parser-3.4.3/src/classes/classes.C000644 000000 000000 00000003011 11730603266 017100 0ustar00rootwheel000000 000000 /** @file Parser: @b Methoded and Methoded_array classes. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_request.h" volatile const char * IDENT_CLASSES_C="$Id: classes.C,v 1.25 2012/03/16 09:24:06 moko Exp $" IDENT_CLASSES_H; // Methoded void Methoded::register_directly_used(Request& r) { if(used_directly()) { r.classes().put(name(), this); } // prevent system classes from modification [calling set_method] // ^process[$string:CLASS]{@method} prohibited from now on... this->lock(); } // Methoded_array // global variable Methoded_array& methoded_array() { static Methoded_array* result=0; if(!result) result=new Methoded_array; return *result; } // methods Methoded_array::Methoded_array() { # include "classes.inc" } static void configure_admin_one(Methoded_array::element_type methoded, Request *r) { if(methoded) methoded->configure_admin(*r); } void Methoded_array::configure_admin(Request& r) { for_each(configure_admin_one, &r); } static void configure_user_one(Methoded_array::element_type methoded, Request *r) { if(methoded) methoded->configure_user(*r); } void Methoded_array::configure_user(Request& r) { for_each(configure_user_one, &r); } static void register_one(Methoded_array::element_type methoded, Request *r) { if(methoded) methoded->register_directly_used(*r); } void Methoded_array::register_directly_used(Request& r) { for_each(register_one, &r); } parser-3.4.3/src/classes/inet.C000644 000000 000000 00000004137 11744065151 016414 0ustar00rootwheel000000 000000 /** @file Parser: @b inet parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vmethod_frame.h" #include "pa_request.h" volatile const char * IDENT_INET_C="$Id: inet.C,v 1.6 2012/04/19 19:41:29 moko Exp $"; class MInet: public Methoded { public: MInet(); }; // global variables DECLARE_CLASS_VAR(inet, new MInet, 0); static void _ntoa(Request& r, MethodParams& params){ unsigned long l=(unsigned long)trunc(params.as_double(0, "parameter must be expression", r)); static const int ip_cstr_bufsize=3*4+3+1+1; char* ip_cstr=new(PointerFreeGC) char[ip_cstr_bufsize]; snprintf(ip_cstr, ip_cstr_bufsize, "%u.%u.%u.%u", (l>>24) & 0xFF, (l>>16) & 0xFF, (l>>8) & 0xFF, l & 0xFF); r.write_no_lang(*new String(ip_cstr)); } static void _aton(Request& r, MethodParams& params){ const String ip=params.as_string(0, PARAMETER_MUST_BE_STRING); if(ip.is_empty()) throw Exception(PARSER_RUNTIME, 0, "IP address must not be empty."); const char* ip_cstr=ip.cstr(); ulong result=0; uint byte_value=0; uint dot_cnt=0; bool byte_start=true; bool err=false; const char* p=ip_cstr; while(char c=*p++){ int digit=(int)(c-'0'); // assume ascii if(digit>=0 && digit<=9){ byte_start=false; if((byte_value=byte_value*10+(uint)digit) > 255){ err=true; break; } } else if(c=='.'){ if(byte_start){ // two dots in row or IP started with dot err=true; break; } else { byte_start=true; dot_cnt++; result=(result << 8)+(ulong)byte_value; byte_value=0; } } else { // invalid char err=true; break; } } if(err || dot_cnt!=3 || byte_start){ throw Exception(PARSER_RUNTIME, 0, "Invalid IP address '%s' specified.", ip_cstr); } else { result=(result << 8)+(ulong)byte_value; r.write_no_lang(*new VDouble(result)); } } // constructor MInet::MInet(): Methoded("inet") { add_native_method("ntoa", Method::CT_STATIC, _ntoa, 1, 1); add_native_method("aton", Method::CT_STATIC, _aton, 1, 1); // @todo: gethostbyname, gethostbyaddr } parser-3.4.3/src/classes/void.C000644 000000 000000 00000005354 11764362602 016423 0ustar00rootwheel000000 000000 /** @file Parser: @b VOID parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vvoid.h" #include "pa_sql_connection.h" volatile const char * IDENT_VOID_C="$Id: void.C,v 1.51 2012/06/08 11:44:02 misha Exp $"; // externs extern String sql_bind_name; // class class MVoid: public Methoded { public: MVoid(); }; // void is inherited from string, thus global variable declared in string.C // methods #ifndef DOXYGEN class Void_sql_event_handlers: public SQL_Driver_query_event_handlers { const String& statement_string; public: Void_sql_event_handlers(const String& astatement_string): statement_string(astatement_string) {} bool add_column(SQL_Error& /*error*/, const char* /*str*/, size_t /*length*/) { /* ignore */ return false; } bool before_rows(SQL_Error& error) { // there are some result rows, which is wrong error=SQL_Error(PARSER_RUNTIME, /*statement_string,*/ "must return nothing"); return true; } bool add_row(SQL_Error& /*error*/) { /* never */ return false; } bool add_row_cell(SQL_Error& /*error*/, const char* /*str*/, size_t /*length*/) { /* never */ return false; } }; #endif extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); Temp_lang temp_lang(r, String::L_SQL); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); Void_sql_event_handlers handlers(statement_string); r.connection()->query( statement_cstr, placeholders_count, placeholders, 0, SQL_NO_LIMIT, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); } // constructor MVoid::MVoid(): Methoded("void", string_class) { // ^void:sql{query} add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); // all other methods are inherinted from empty string } parser-3.4.3/src/classes/double.C000644 000000 000000 00000007467 12175501771 016742 0ustar00rootwheel000000 000000 /** @file Parser: @b double parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vbool.h" volatile const char * IDENT_DOUBLE_C="$Id: double.C,v 1.67 2013/07/29 15:02:17 moko Exp $" IDENT_PA_VDOUBLE_H; // externs void _string_format(Request& r, MethodParams&); // class class MDouble: public Methoded { public: MDouble(); }; // global variable DECLARE_CLASS_VAR(double, new MDouble, 0); // methods static void _int(Request& r, MethodParams&) { VDouble& vdouble=GET_SELF(r, VDouble); r.write_no_lang(*new VInt(vdouble.as_int())); } static void _double(Request& r, MethodParams&) { VDouble& vdouble=GET_SELF(r, VDouble); r.write_no_lang(*new VDouble(vdouble.as_double())); } static void _bool(Request& r, MethodParams&) { VDouble& vdouble=GET_SELF(r, VDouble); r.write_no_lang(VBool::get(vdouble.as_bool())); } typedef void (*vdouble_op_func_ptr)(VDouble& vdouble, double param); static void __inc(VDouble& vdouble, double param) { vdouble.inc(param); } static void __dec(VDouble& vdouble, double param) { vdouble.inc(-param); } static void __mul(VDouble& vdouble, double param) { vdouble.mul(param); } static void __div(VDouble& vdouble, double param) { vdouble.div(param); } static void __mod(VDouble& vdouble, double param) { vdouble.mod((int)param); } static void vdouble_op(Request& r, MethodParams& params, vdouble_op_func_ptr func) { VDouble& vdouble=GET_SELF(r, VDouble); double param=params.count()? params.as_double(0, "param must be double", r):1/*used in inc/dec*/; (*func)(vdouble, param); } static void _inc(Request& r, MethodParams& params) { vdouble_op(r, params, &__inc); } static void _dec(Request& r, MethodParams& params) { vdouble_op(r, params, &__dec); } static void _mul(Request& r, MethodParams& params) { vdouble_op(r, params, &__mul); } static void _div(Request& r, MethodParams& params) { vdouble_op(r, params, &__div); } static void _mod(Request& r, MethodParams& params) { vdouble_op(r, params, &__mod); } // from string.C extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); static void _sql(Request& r, MethodParams& params) { double val; Value* default_code; if(const String* string=sql_result_string(r, params, default_code)) val=string->as_double(); else if(default_code) val=r.process_to_value(*default_code).as_double(); else { throw Exception(PARSER_RUNTIME, 0, "produced no result, but no default option specified"); } r.write_no_lang(*new VDouble(val)); } // constructor MDouble::MDouble(): Methoded("double") { // ^double.int[] // ^double.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^double.double[] // ^double.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^double.bool[] // ^double.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); // ^double.inc[] // ^double.inc[offset] add_native_method("inc", Method::CT_DYNAMIC, _inc, 0, 1); // ^double.dec[] // ^double.dec[offset] add_native_method("dec", Method::CT_DYNAMIC, _dec, 0, 1); // ^double.mul[k] add_native_method("mul", Method::CT_DYNAMIC, _mul, 1, 1); // ^double.div[d] add_native_method("div", Method::CT_DYNAMIC, _div, 1, 1); // ^double.mod[offset] add_native_method("mod", Method::CT_DYNAMIC, _mod, 1, 1); // ^double.format{format} add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); // ^sql[query] // ^sql[query][$.limit(1) $.offset(2) $.default(0.0)] add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); } parser-3.4.3/src/classes/int.C000644 000000 000000 00000007131 12175501771 016246 0ustar00rootwheel000000 000000 /** @file Parser: @b int parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vbool.h" volatile const char * IDENT_INT_C="$Id: int.C,v 1.63 2013/07/29 15:02:17 moko Exp $" IDENT_PA_VINT_H; // externs void _string_format(Request& r, MethodParams&); // class class MInt: public Methoded { public: MInt(); }; // global variable DECLARE_CLASS_VAR(int, new MInt, 0); // methods static void _int(Request& r, MethodParams&) { VInt& vint=GET_SELF(r, VInt); r.write_no_lang(*new VInt(vint.get_int())); } static void _double(Request& r, MethodParams&) { VInt& vint=GET_SELF(r, VInt); r.write_no_lang(*new VDouble(vint.as_double())); } static void _bool(Request& r, MethodParams&) { VInt& vint=GET_SELF(r, VInt); r.write_no_lang(VBool::get(vint.as_bool())); } typedef void (*vint_op_func_ptr)(VInt& vint, double param); static void __inc(VInt& vint, double param) { vint.inc((int)param); } static void __dec(VInt& vint, double param) { vint.inc((int)-param); } static void __mul(VInt& vint, double param) { vint.mul(param); } static void __div(VInt& vint, double param) { vint.div(param); } static void __mod(VInt& vint, double param) { vint.mod((int)param); } static void vint_op(Request& r, MethodParams& params, vint_op_func_ptr func) { VInt& vint=GET_SELF(r, VInt); double param=params.count()?params.as_double(0, "param must be numerical", r):1; (*func)(vint, param); } static void _inc(Request& r, MethodParams& params) { vint_op(r, params, &__inc); } static void _dec(Request& r, MethodParams& params) { vint_op(r, params, &__dec); } static void _mul(Request& r, MethodParams& params) { vint_op(r, params, &__mul); } static void _div(Request& r, MethodParams& params) { vint_op(r, params, &__div); } static void _mod(Request& r, MethodParams& params) { vint_op(r, params, &__mod); } // from string.C extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); static void _sql(Request& r, MethodParams& params) { int val; Value* default_code=0; if(const String* string=sql_result_string(r, params, default_code)) val=string->as_int(); else if(default_code) val=r.process_to_value(*default_code).as_int(); else { throw Exception(PARSER_RUNTIME, 0, "produced no result, but no default option specified"); } r.write_no_lang(*new VInt(val)); } // constructor MInt::MInt(): Methoded("int") { // ^int.int[] // ^int.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^int.double[] // ^int.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^int.bool[] // ^int.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); // ^int.inc[] // ^int.inc[offset] add_native_method("inc", Method::CT_DYNAMIC, _inc, 0, 1); // ^int.dec[] // ^int.dec[offset] add_native_method("dec", Method::CT_DYNAMIC, _dec, 0, 1); // ^int.mul[k] add_native_method("mul", Method::CT_DYNAMIC, _mul, 1, 1); // ^int.div[d] add_native_method("div", Method::CT_DYNAMIC, _div, 1, 1); // ^int.mod[offset] add_native_method("mod", Method::CT_DYNAMIC, _mod, 1, 1); // ^int.format{format} add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); // ^sql[query] // ^sql[query][$.limit(1) $.offset(2) $.default(0)] add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); } parser-3.4.3/src/classes/bool.C000644 000000 000000 00000002637 12175501770 016414 0ustar00rootwheel000000 000000 /** @file Parser: @b int parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vbool.h" volatile const char * IDENT_BOOL_C="$Id: bool.C,v 1.6 2013/07/29 15:02:16 moko Exp $" IDENT_PA_VBOOL_H; // externs void _string_format(Request& r, MethodParams&); // class class MBool: public Methoded { public: MBool(); }; // global variable DECLARE_CLASS_VAR(bool, new MBool, 0); // methods static void _int(Request& r, MethodParams&) { VBool& vbool=GET_SELF(r, VBool); r.write_no_lang(*new VInt(vbool.as_bool())); } static void _double(Request& r, MethodParams&) { VBool& vbool=GET_SELF(r, VBool); r.write_no_lang(*new VDouble(vbool.as_bool())); } static void _bool(Request& r, MethodParams&) { r.write_no_lang(GET_SELF(r, VBool)); } // constructor MBool::MBool(): Methoded("bool") { // ^bool.int[] // ^bool.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^bool.double[] // ^bool.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^bool.bool[] // ^bool.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); } parser-3.4.3/src/classes/date.C000644 000000 000000 00000031244 12223104270 016356 0ustar00rootwheel000000 000000 /** @file Parser: @b date parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vdate.h" #include "pa_vtable.h" volatile const char * IDENT_DATE_C="$Id: date.C,v 1.92 2013/10/02 20:57:28 moko Exp $" IDENT_PA_VDATE_H; // class class MDate: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VDate(0); } public: MDate(); }; // global variable DECLARE_CLASS_VAR(date, new MDate, 0); // helpers class Date_calendar_table_template_columns: public ArrayString { public: Date_calendar_table_template_columns(): ArrayString(6+2) { for(int i=0; i<=6; i++) *this+=new String(i, "%d"); // .i column name *this+=new String("week"); *this+=new String("year"); } }; Table date_calendar_table_template(new Date_calendar_table_template_columns); // methods static void _now(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); time_t t=time(0); if(params.count()==1) // ^now(offset) t+=(time_t)round(params.as_double(0, "offset must be double", r)*SECS_PER_DAY); vdate.set_time(t); } static void _today(Request& r, MethodParams&) { VDate& vdate=GET_SELF(r, VDate); time_t t=time(0); tm today=*localtime(&t); today.tm_hour=0; today.tm_min=0; today.tm_sec=0; vdate.set_time(today); } /// shrinked range: 1970/1/1 to 2038/1/1 static int to_year(int iyear) { if(iyear<1970 || iyear>2038) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "year '%d' is out of valid range", iyear); return iyear; } static int to_month(int imonth) { return max(1, min(imonth, 12)) -1; } static int to_tm_year(int iyear) { return to_year(iyear)-1900; } // 2002-04-25 18:14:00 // 18:14:00 // 2002:04:25 [+maybe time] /*not static, used in image.C*/ tm cstr_to_time_t(char *cstr) { if( !cstr || !*cstr ) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "empty string is not valid datetime"); char *cur=cstr; char date_delim=isdigit((unsigned char)cur[0])&&isdigit((unsigned char)cur[1])&&isdigit((unsigned char)cur[2])&&isdigit((unsigned char)cur[3])&&cur[4]==':'?':' :'-'; const char* year=lsplit(&cur, date_delim); const char* month=lsplit(&cur, date_delim); const char* mday=lsplit(&cur, ' '); if(!month) cur=cstr; const char* hour=lsplit(&cur, ':'); const char* min=lsplit(&cur, ':'); const char* sec=lsplit(&cur, '.'); const char* msec=cur; tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_isdst=-1; if(!month) if(min) { year=mday=0; // HH:MM time_t t=time(0); tm *tmNow=localtime(&t); tmIn.tm_year=tmNow->tm_year; tmIn.tm_mon=tmNow->tm_mon; tmIn.tm_mday=tmNow->tm_mday; goto date_part_set; } else hour=min=sec=msec=0; // not YYYY- & not HH: = just YYYY tmIn.tm_year=to_tm_year(pa_atoi(year)); tmIn.tm_mon=month?pa_atoi(month)-1:0; tmIn.tm_mday=mday?pa_atoi(mday):1; date_part_set: tmIn.tm_hour=hour?pa_atoi(hour):0; tmIn.tm_min=min?pa_atoi(min):0; tmIn.tm_sec=sec?pa_atoi(sec):0; //tmIn.tm_[msec<cstrm())); } else { // ^create(float days) or ^create[date object] time_t t=(time_t)round(params.as_double(0, "float days must be double", r)*SECS_PER_DAY); if(t<0 || !localtime(&t)) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid datetime"); vdate.set_time(t); } } else { // ^create(y;m;d[;h[;m[;s]]]) assert(params.count()<=6); tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_isdst=-1; tmIn.tm_year=to_tm_year(params.as_int(0, "year must be int", r)); tmIn.tm_mon=params.as_int(1, "month must be int", r)-1; tmIn.tm_mday=params.count()>2?params.as_int(2, "mday must be int", r):1; int savedHour=0; if(params.count()>3) savedHour=tmIn.tm_hour=params.as_int(3, "hour must be int", r); if(params.count()>4) tmIn.tm_min=params.as_int(4, "minutes must be int", r); if(params.count()>5) tmIn.tm_sec=params.as_int(5, "seconds must be int", r); vdate.set_time(tmIn); }; } static void _sql_string(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); VDate::sql_string_type format = VDate::sql_string_datetime; if(params.count() > 0) { const String& what=params.as_string(0, "'type' must be string"); if(what.is_empty() || what == "datetime") format = VDate::sql_string_datetime; else if(what == "date") format=VDate::sql_string_date; else if(what == "time") format=VDate::sql_string_time; else throw Exception(PARSER_RUNTIME, &what, "'type' must be 'date', 'time' or 'datetime'"); } r.write_assign_lang(*vdate.get_sql_string(format)); } static void _gmt_string(Request& r, MethodParams&) { VDate& vdate=GET_SELF(r, VDate); r.write_assign_lang(*vdate.get_gmt_string()); } static void _roll(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); const String& what=params.as_string(0, "'what' must be string"); int oyear=0; int omonth=0; int oday=0; int *offset; if(what=="year") offset=&oyear; else if(what=="month") offset=&omonth; else if(what=="day") offset=&oday; else if(what=="TZ") { const String& argument_tz=params.as_string(1, "'TZ' must be string"); vdate.set_tz(&argument_tz); return; } else throw Exception(PARSER_RUNTIME, &what, "must be year|month|day|TZ"); *offset=params.as_int(1, "offset must be int", r); time_t self_time=vdate.get_time(); tm tmIn=*localtime(&self_time); tm tmSaved=tmIn; int adjust_day=0; time_t t_changed_date; while(true) { tmIn.tm_year+=oyear; tmIn.tm_mon+=omonth; tmIn.tm_mday+=oday+adjust_day; tmIn.tm_hour=24/2; tmIn.tm_min=0; tmIn.tm_sec=0; int saved_mon=(tmIn.tm_mon+12*100)%12; // crossing year boundary backwards t_changed_date=mktime/*normalizetime*/(&tmIn); if(t_changed_date<0) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "bad resulting time (rolled out of valid date range)"); if(oday==0 && tmIn.tm_mon!=saved_mon/*but it changed*/) { if(adjust_day <= -3/*31->28 max, so never, but...*/) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "bad resulting time (day hole still with %d day adjustment)", adjust_day ); tmIn=tmSaved; // restoring --adjust_day; //retrying with prev day } else break; } tm *tmOut=localtime(&t_changed_date); if(!tmOut) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "bad resulting time (seconds from epoch=%d)", t_changed_date); tmOut->tm_hour=tmSaved.tm_hour; tmOut->tm_min=tmSaved.tm_min; tmOut->tm_sec=tmSaved.tm_sec; tmOut->tm_isdst=-1; { time_t t_changed_time=mktime/*normalizetime*/(tmOut); /*autofix: in msk timezone last sunday of march hour hole: [2am->3am) if( tmOut->tm_hour!=tmSaved.tm_hour ||tmOut->tm_min!=tmSaved.tm_min) throw Exception(0, 0, "bad resulting time (hour hole)"); */ if(t_changed_time<0) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "bad resulting time (after reconstruction)"); vdate.set_time(t_changed_time); } } static Table& fill_month_days(Request& r, MethodParams& params, bool rus){ Table::Action_options table_options; Table& result=*new Table(date_calendar_table_template, table_options); int year=to_year(params.as_int(1, "year must be int", r)); int month=to_month(params.as_int(2, "month must be int", r)); tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_mday=1; tmIn.tm_mon=month; tmIn.tm_year=year-1900; time_t t=mktime(&tmIn); if(t<0) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid date"); tm *tmOut=localtime(&t); int weekDay1=tmOut->tm_wday; if(rus) weekDay1=weekDay1?weekDay1-1:6; //sunday last int monthDays=getMonthDays(year, month); for(int _day=1-weekDay1; _day<=monthDays;) { Table::element_type row(new ArrayString(7)); // calculating year week no [1..54] int weekyear=0; // surely would be assigned to, but to calm down compiler int weekno=0; // same // 0..6 week days-cells fill with month days for(int wday=0; wday<7; wday++, _day++) { *row+=(_day>=1 && _day<=monthDays)?new String(_day, "%02d"):new String(); if(wday==(rus?3:4)/*thursday*/) { tm tms; memset(&tms, 0, sizeof(tmIn)); tms.tm_mday=_day; tms.tm_mon=month; tms.tm_year=year-1900; /*normalize*/mktime(&tms); weekyear=tms.tm_year+1900; weekno=VDate::CalcWeek(tms).week; } } // appending week no *row+=new String(weekno, "%02d"); // appending week year *row+=new String(weekyear, "%04d"); result+=row; } return result; } static Table& fill_week_days(Request& r, MethodParams& params, bool rus){ Table::columns_type columns(new ArrayString(4)); *columns+=new String("year"); *columns+=new String("month"); *columns+=new String("day"); *columns+=new String("weekday"); Table& result=*new Table(columns); int year=to_year(params.as_int(1, "year must be int", r)); int month=to_month(params.as_int(2, "month must be int", r)); int day=params.as_int(3, "day must be int", r); tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_hour=18; tmIn.tm_mday=day; tmIn.tm_mon=month; tmIn.tm_year=year-1900; time_t t=mktime(&tmIn); if(t<0) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid date"); tm *tmOut=localtime(&t); int baseWeekDay=tmOut->tm_wday; if(rus) baseWeekDay=baseWeekDay?baseWeekDay-1:6; //sunday last t-=baseWeekDay*SECS_PER_DAY; for(int curWeekDay=0; curWeekDay<7; curWeekDay++, t+=SECS_PER_DAY) { tm *tmOut=localtime(&t); Table::element_type row(new ArrayString(4)); *row+=new String(1900+tmOut->tm_year, "%04d"); *row+=new String(1+tmOut->tm_mon, "%02d"); *row+=new String(tmOut->tm_mday, "%02d"); *row+=new String(tmOut->tm_wday, "%02d"); result+=row; } return result; } static void _calendar(Request& r, MethodParams& params) { const String& what=params.as_string(0, "format must be strig"); bool rus=false; if(what=="rus") rus=true; else if(what=="eng") rus=false; else throw Exception(PARSER_RUNTIME, &what, "must be rus|eng"); Table* table; if(params.count()==1+2) table=&fill_month_days(r, params, rus); else // 1+3 table=&fill_week_days(r, params, rus); r.write_no_lang(*new VTable(table)); } static void _unix_timestamp(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); if(params.count()==0) { // ^date.unix-timestamp[] r.write_no_lang(*new VInt((int)vdate.get_time())); } else { if(vdate.get_time()) throw Exception(PARSER_RUNTIME, 0, "date object already constructed"); // ^unix-timestamp(time_t) time_t t=(time_t)params.as_int(0, "Unix timestamp must be integer", r); vdate.set_time(t); } } static void _last_day(Request& r, MethodParams& params) { int year; int month; if(&r.get_self() == date_class) { if(params.count() != 2) throw Exception(PARSER_RUNTIME, 0, "year and month must be defined"); // ^date:lastday(year;month) year=to_year(params.as_int(0, "year must be int", r)); month=to_month(params.as_int(1, "month must be int", r)); } else { // ^date.lastday[] tm &tmIn=GET_SELF(r, VDate).get_localtime(); year=tmIn.tm_year+1900; month=tmIn.tm_mon; } r.write_no_lang(*new VInt(getMonthDays(year, month))); } // constructor MDate::MDate(): Methoded("date") { // ^date::now[] // ^date::now(offset float days) add_native_method("now", Method::CT_DYNAMIC, _now, 0, 1); // ^date::today[] add_native_method("today", Method::CT_DYNAMIC, _today, 0, 0); // ^date::create(float days) // ^date::create[date] // ^date::create(year;month;day[;hour[;minute[;sec]]]) // ^date::create[yyyy-mm-dd[ hh:mm:ss]] // ^date::create[hh:mm:ss] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 6); // old name for compatibility with <= v1.17 2002/2/18 12:13:42 paf add_native_method("set", Method::CT_DYNAMIC, _create, 1, 6); // ^date.sql-string[] add_native_method("sql-string", Method::CT_DYNAMIC, _sql_string, 0, 1); // ^date.gmt-string[] add_native_method("gmt-string", Method::CT_DYNAMIC, _gmt_string, 0, 0); // ^date:lastday(year;month) // ^date.lastday[] add_native_method("last-day", Method::CT_ANY, _last_day, 0, 2); // ^date.roll[year|month|day](+/- 1) add_native_method("roll", Method::CT_DYNAMIC, _roll, 2, 2); // ^date:calendar[rus|eng](year;month) = table // ^date:calendar[rus|eng](year;month;day) = table add_native_method("calendar", Method::CT_STATIC, _calendar, 3, 4); // ^date.unix-timestamp[] // ^date::unix-timestamp(timestamp) add_native_method("unix-timestamp", Method::CT_DYNAMIC, _unix_timestamp, 0, 1); } parser-3.4.3/src/classes/memcached.C000644 000000 000000 00000006464 12175501771 017372 0ustar00rootwheel000000 000000 /** @file Parser: memcached class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Ivan Poluyanov Artem Stepanov */ #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vstring.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_vmemcached.h" volatile const char * IDENT_MEMCACHED_C="$Id: memcached.C,v 1.10 2013/07/29 15:02:17 moko Exp $"; class MMemcached: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VMemcached(); } public: MMemcached(); }; DECLARE_CLASS_VAR(memcached, new MMemcached, 0); static void _open(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); Value& param_value=params.as_no_junction(0, PARAM_MUST_NOT_BE_CODE); time_t ttl=params.count()>1 ? params.as_int(1, "default expiration must be int", r) : 0; if(HashStringValue* options=param_value.get_hash()){ String result; for(HashStringValue::Iterator i(*options); i; i.next()){ if(Value *b=i.value()->as("bool")){ if(b->as_bool()) result << (result.is_empty() ? "--" : " --") << i.key(); } else { const String& value=i.value()->as_string(); if(!value.is_empty()) result << (result.is_empty() ? "--" : " --") << i.key() << "=" << value; } } self.open(result, ttl); } else { const String& connect_string=params.as_string(0, "param must be connection string or options hash"); self.open_parse(connect_string, ttl); } } static void _clear(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); time_t ttl=(params.count()>0) ? params.as_int(0, "expiration must be int", r) : 0; self.flush(ttl); } static void _mget(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); Value& param=params.as_no_junction(0, PARAM_MUST_NOT_BE_CODE); if(param.is_string()){ ArrayString keys(params.count()); for(size_t i=0; icount()); for(size_t i=0; icount(); i++) { keys+=table->get(i)->get(0); } r.write_no_lang(self.mget(keys)); } } static void _add(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); const String& key=params.as_string(0, "key must be string"); r.write_no_lang(VBool::get(self.add(key, ¶ms.as_no_junction(1, PARAM_MUST_NOT_BE_CODE)))); } static void _delete(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); const String& key=params.as_string(0, "key must be string"); self.remove(key); } static void _release(Request& r, MethodParams&) { VMemcached& self=GET_SELF(r, VMemcached); self.quit(); } MMemcached::MMemcached() : Methoded("memcached") { add_native_method("open", Method::CT_DYNAMIC, _open, 1, 2); add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 1); add_native_method("mget", Method::CT_DYNAMIC, _mget, 1, 1000); add_native_method("add", Method::CT_DYNAMIC, _add, 2, 2); add_native_method("delete", Method::CT_DYNAMIC, _delete, 1, 1); add_native_method("release", Method::CT_DYNAMIC, _release, 0, 0); } parser-3.4.3/src/classes/xnode.h000644 000000 000000 00000002756 11730603270 016637 0ustar00rootwheel000000 000000 /** @file Parser: @b dnode methods class - MDnode class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef XNODE_H #define XNODE_H #define IDENT_XNODE_H "$Id: xnode.h,v 1.31 2012/03/16 09:24:08 moko Exp $" class MXnode: public Methoded { public: // Value /// MXnode: +$const Value* get_element(const String& aname) { // $method if(Value* result=Methoded::get_element(aname)) return result; // $const if(Value* result=consts.get(aname)) return result; return 0; } public: // VStateless_class Value* create_new_value(Pool&) { throw Exception(PARSER_RUNTIME, 0, "no constructors available, use CreateXXX DOM methods to create nodes instead"); } public: MXnode(const char* aname=0, VStateless_class* abase=0); public: // Methoded bool used_directly() { return true; } private: HashStringValue consts; }; xmlNode& as_node(MethodParams& params, int index, const char* msg); xmlChar* as_xmlchar(Request& r, MethodParams& params, int index, const char* msg); xmlChar* as_xmlqname(Request& r, MethodParams& params, int index, const char* msg=0); xmlChar* as_xmlncname(Request& r, MethodParams& params, int index, const char* msg=0); xmlChar* as_xmlname(Request& r, MethodParams& params, int index, const char* msg=0); xmlChar* as_xmlnsuri(Request& r, MethodParams& params, int index); xmlNs& pa_xmlMapNs(xmlDoc& doc, const xmlChar* href, const xmlChar* prefix); #endif parser-3.4.3/src/classes/hash.C000644 000000 000000 00000035210 12230056040 016360 0ustar00rootwheel000000 000000 /** @file Parser: @b hash parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vhash.h" #include "pa_vvoid.h" #include "pa_sql_connection.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_vmethod_frame.h" volatile const char * IDENT_HASH_C="$Id: hash.C,v 1.118 2013/10/17 21:52:32 moko Exp $"; // class class MHash: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VHash(); } public: MHash(); }; // global variable DECLARE_CLASS_VAR(hash, new MHash, 0); // methods #ifndef DOXYGEN class Hash_sql_event_handlers: public SQL_Driver_query_event_handlers { const String& statement_string; const char* statement_cstr; bool distinct; HashStringValue& rows_hash; Value* row_value; int column_index; ArrayString& columns; bool one_bool_column; static VBool only_one_column_value; Table2hash_value_type value_type; int columns_count; public: Table* empty; public: Hash_sql_event_handlers( const String& astatement_string, const char* astatement_cstr, bool adistinct, HashStringValue& arows_hash, Table2hash_value_type avalue_type) : statement_string(astatement_string), statement_cstr(astatement_cstr), distinct(adistinct), rows_hash(arows_hash), value_type(avalue_type), row_value(0), column_index(0), one_bool_column(false), columns(*new ArrayString), empty(0) { } bool add_column(SQL_Error& error, const char* str, size_t ) { try { columns+=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */); return false; } catch(...) { error=SQL_Error("exception occured in Hash_sql_event_handlers::add_column"); return true; } } bool before_rows(SQL_Error& error) { if(columns.count()<1) { error=SQL_Error(PARSER_RUNTIME, "no columns"); return true; } switch(value_type){ case C_STRING: { if(columns.count()>2){ error=SQL_Error(PARSER_RUNTIME, "only 2 columns allowed for $.type[string]."); return true; } } case C_TABLE: { // create empty table which we'll copy later empty=new Table(&columns); columns_count=columns.count(); } case C_HASH: { one_bool_column=columns.count()==1; } } return false; } bool add_row(SQL_Error& /*error*/) { column_index=0; return false; } bool add_row_cell(SQL_Error& error, const char *str, size_t ) { try { const String& cell=str?*new String(str, String::L_TAINTED /* no length as 0x00 can be inside */):String::Empty; bool duplicate=false; if(one_bool_column) { duplicate=rows_hash.put_dont_replace(cell, &only_one_column_value); // put. existed? } else if(column_index==0) { switch(value_type){ case C_HASH: { VHash* row_vhash=new VHash; row_value=row_vhash; duplicate=rows_hash.put_dont_replace(cell, row_vhash); // put. existed? break; } case C_STRING: { VString* row_vstring=new VString(); row_value=row_vstring; duplicate=rows_hash.put_dont_replace(cell, row_vstring); // put. existed? break; } case C_TABLE: { VTable* vtable=(VTable*)rows_hash.get(cell); Table* table; if(vtable) { // table with this key exist? if(!distinct) { duplicate=true; break; } table=vtable->get_table(); } else { // no? creating table of same structure as source Table::Action_options table_options(0, 0); table=new Table(*empty, table_options/*no rows, just structure*/); vtable=new VTable(table); rows_hash.put(cell, vtable); // put } ArrayString* row=new ArrayString(columns_count); row_value=(Value*)row; *row+=&cell; *table+=row; break; } } } else { switch(value_type) { case C_HASH: { row_value->get_hash()->put(*columns[column_index], new VString(cell)); break; } case C_STRING: { VString* row_string=(VString*)row_value; row_string->set_string(cell); break; } case C_TABLE: { ArrayString* row=(ArrayString*)row_value; *row+=&cell; break; } } } if(duplicate & !distinct) { error=SQL_Error(PARSER_RUNTIME, "duplicate key"); return true; } column_index++; return false; } catch(...) { error=SQL_Error("exception occured in Hash_sql_event_handlers::add_row_cell"); return true; } } }; VBool Hash_sql_event_handlers::only_one_column_value(true); #endif static void _create_or_add(Request& r, MethodParams& params) { if(params.count()) { Value& vsrc=params.as_no_junction(0, PARAM_MUST_BE_HASH); VHash& self=GET_SELF(r, VHash); HashStringValue* src_hash; HashStringValue* self_hash=&(self.hash()); if(VHash* src=static_cast(vsrc.as(VHASH_TYPE))) { src_hash=&(src->hash_ro()); if(src_hash==self_hash) // same: doing nothing return; if(Value* vdefault=src->get_default()) if(vdefault->is_defined()) self.set_default(vdefault); } else { src_hash=vsrc.get_hash(); } if(src_hash) src_hash->for_each(copy_all_overwrite_to, self_hash); } } static void _sub(Request& r, MethodParams& params) { if(HashStringValue* src=params.as_hash(0, "param")) { HashStringValue* self=&(GET_SELF(r, VHash).hash()); if(src==self) { // same: clearing self->clear(); return; } src->for_each(remove_key_from, self); } } static void copy_all_dontoverwrite_to( HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue* dest) { dest->put_dont_replace(key, value); } static void _union(Request& r, MethodParams& params) { // dest = copy of self Value& result=*new VHash(GET_SELF(r, VHash).hash()); // dest += b if(HashStringValue* src=params.as_hash(0, "param")) src->for_each(copy_all_dontoverwrite_to, result.get_hash()); // return result r.write_no_lang(result); } #ifndef DOXYGEN struct Copy_intersection_to_info { HashStringValue* b; HashStringValue* dest; }; #endif static void copy_intersection_to( HashStringValue::key_type key, HashStringValue::value_type value, Copy_intersection_to_info *info) { if(info->b->get(key)) info->dest->put_dont_replace(key, value); } static void _intersection(Request& r, MethodParams& params) { Value& result=*new VHash; // dest += b if(HashStringValue* b=params.as_hash(0, "param")) { Copy_intersection_to_info info={b, result.get_hash()}; GET_SELF(r, VHash).hash().for_each(copy_intersection_to, &info); } // return result r.write_no_lang(result); } static bool intersects( HashStringValue::key_type key, HashStringValue::value_type /*value*/, HashStringValue* b) { return b->get(key)!=0; } static void _intersects(Request& r, MethodParams& params) { bool result=false; if(HashStringValue* b=params.as_hash(0, "param")) result=GET_SELF(r, VHash).hash().first_that(intersects, b)!=0; // return result r.write_no_lang(VBool::get(result)); } extern String sql_bind_name; extern String sql_limit_name; extern String sql_offset_name; extern String sql_default_name; extern String sql_distinct_name; extern String sql_value_type_name; extern Table2hash_value_type get_value_type(Value& vvalue_type); extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; bool distinct=false; Table2hash_value_type value_type=C_HASH; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process_to_value(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process_to_value(*voffset).as_double(); } if(Value* vdistinct=options->get(sql_distinct_name)) { valid_options++; distinct=r.process_to_value(*vdistinct).as_bool(); } if(Value* vvalue_type=options->get(sql_value_type_name)) { valid_options++; value_type=get_value_type(r.process_to_value(*vvalue_type)); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); Temp_lang temp_lang(r, String::L_SQL); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); HashStringValue& hash=GET_SELF(r, VHash).hash(); hash.clear(); Hash_sql_event_handlers handlers( statement_string, statement_cstr, distinct, hash, value_type); r.connection()->query( statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); } static void keys_collector( HashStringValue::key_type key, HashStringValue::value_type, Table *table) { Table::element_type row(new ArrayString(1)); *row+=new String(key, String::L_TAINTED); *table+=row; } static void _keys(Request& r, MethodParams& params) { const String* keys_column_name; if(params.count()>0) keys_column_name=¶ms.as_string(0, COLUMN_NAME_MUST_BE_STRING); else keys_column_name=new String("key"); Table::columns_type columns(new ArrayString(1)); *columns+=keys_column_name; Table* table=new Table(columns); GET_SELF(r, VHash).hash_ro().for_each(keys_collector, table); r.write_no_lang(*new VTable(table)); } static void _count(Request& r, MethodParams&) { r.write_no_lang(*new VInt(GET_SELF(r, VHash).hash_ro().count())); } static void _delete(Request& r, MethodParams& params) { GET_SELF(r, VHash).hash().remove(params.as_string(0, "key must be string")); } static void _contains(Request& r, MethodParams& params) { bool result=GET_SELF(r, VHash).hash_ro().contains(params.as_string(0, "key must be string")); r.write_no_lang(VBool::get(result)); } #ifndef DOXYGEN struct Foreach_info { Request *r; const String* key_var_name; const String* value_var_name; Value* body_code; Value* delim_maybe_code; Value* var_context; bool need_delim; }; #endif static bool one_foreach_cycle( HashStringValue::key_type akey, HashStringValue::value_type avalue, Foreach_info *info) { Value& var_context=*info->var_context; if(info->key_var_name){ VString* vkey=new VString(*new String(akey, String::L_TAINTED)); info->r->put_element(var_context, *info->key_var_name, vkey); } if(info->value_var_name) info->r->put_element(var_context, *info->value_var_name, avalue); if(info->delim_maybe_code){ // delimiter set StringOrValue sv_processed=info->r->process(*info->body_code); Request::Skip lskip=info->r->get_skip(); info->r->set_skip(Request::SKIP_NOTHING); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(info->need_delim) // need delim & iteration produced string? info->r->write_pass_lang(info->r->process(*info->delim_maybe_code)); else info->need_delim=true; } info->r->write_pass_lang(sv_processed); return lskip==Request::SKIP_BREAK; } else { info->r->process_write(*info->body_code); Request::Skip lskip=info->r->get_skip(); info->r->set_skip(Request::SKIP_NOTHING); return lskip==Request::SKIP_BREAK; } } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String& key_var_name=params.as_string(0, "key-var name must be string"); const String& value_var_name=params.as_string(1, "value-var name must be string"); Foreach_info info={ &r, key_var_name.is_empty()? 0 : &key_var_name, value_var_name.is_empty()? 0 : &value_var_name, ¶ms.as_junction(2, "body must be code"), /*delimiter*/params.count()>3?params.get(3):0, /*var_context*/r.get_method_frame()->caller(), false }; VHash& self=GET_SELF(r, VHash); HashStringValue& hash=self.hash_ro(); VHash_lock lock(self); hash.first_that(one_foreach_cycle, &info); } static void _at(Request& r, MethodParams& params) { HashStringValue& hash=GET_SELF(r, VHash).hash_ro(); size_t count=hash.count(); int pos=0; Value& vwhence=*params.get(0); if(vwhence.is_string()){ const String& swhence=*vwhence.get_string(); if(swhence == "last") pos=count-1; else if(swhence != "first") throw Exception(PARSER_RUNTIME, &swhence, "whence must be 'first', 'last' or expression"); } else { pos=r.process_to_value(vwhence).as_int(); if(pos < 0) pos+=count; } if(count && pos >= 0 && (size_t)pos < count){ if(pos == 0) r.write_assign_lang(*hash.first_value()); else if((size_t)pos == count-1) r.write_assign_lang(*hash.last_value()); else for(HashStringValue::Iterator i(hash); i; i.next(), pos-- ) if(!pos){ r.write_assign_lang(*i.value()); break; } } } // constructor MHash::MHash(): Methoded("hash") { // ^hash::create[[copy_from]] add_native_method("create", Method::CT_DYNAMIC, _create_or_add, 0, 1); // ^hash.add[add_from] add_native_method("add", Method::CT_DYNAMIC, _create_or_add, 1, 1); // ^hash.sub[sub_from] add_native_method("sub", Method::CT_DYNAMIC, _sub, 1, 1); // ^a.union[b] = hash add_native_method("union", Method::CT_DYNAMIC, _union, 1, 1); // ^a.intersection[b] = hash add_native_method("intersection", Method::CT_DYNAMIC, _intersection, 1, 1); // ^a.intersects[b] = bool add_native_method("intersects", Method::CT_DYNAMIC, _intersects, 1, 1); // ^a.delete[key] add_native_method("delete", Method::CT_DYNAMIC, _delete, 1, 1); // ^a.contains[key] add_native_method("contains", Method::CT_DYNAMIC, _contains, 1, 1); // backward add_native_method("contain", Method::CT_DYNAMIC, _contains, 1, 1); // ^hash::sql[query][options hash] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // ^hash._keys[[column name]] add_native_method("_keys", Method::CT_DYNAMIC, _keys, 0, 1); // ^hash._count[] add_native_method("_count", Method::CT_DYNAMIC, _count, 0, 0); // ^hash.foreach[key;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 2+1, 2+1+1); // ^hash._at[first|last] // ^hash._at([-]offset) add_native_method("_at", Method::CT_DYNAMIC, _at, 1, 1); } parser-3.4.3/src/classes/xdoc.C000644 000000 000000 00000060771 12227605261 016417 0ustar00rootwheel000000 000000 /** @file Parser: @b xdoc parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "libxml/tree.h" #include "libxml/HTMLtree.h" #include "libxslt/xsltInternals.h" #include "libxslt/transform.h" #include "libxslt/xsltutils.h" #include "libxslt/variables.h" #include "libxslt/imports.h" #include "pa_vmethod_frame.h" #include "pa_stylesheet_manager.h" #include "pa_request.h" #include "pa_vxdoc.h" #include "pa_charset.h" #include "pa_vfile.h" #include "pa_xml_exception.h" #include "xnode.h" #include "pa_charsets.h" volatile const char * IDENT_XDOC_C="$Id: xdoc.C,v 1.180 2013/10/16 21:52:49 moko Exp $"; // defines #define XDOC_CLASS_NAME "xdoc" // class class MXdoc: public MXnode { public: // VStateless_class Value* create_new_value(Pool&) { return new VXdoc(); } public: MXdoc(); }; // global variable DECLARE_CLASS_VAR(xdoc, new MXdoc, 0); // helper classes class xmlOutputBuffer_auto_ptr { public: explicit xmlOutputBuffer_auto_ptr(xmlOutputBuffer *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlOutputBuffer_auto_ptr(const xmlOutputBuffer_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlOutputBuffer_auto_ptr& operator=(const xmlOutputBuffer_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xmlOutputBufferClose(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xmlOutputBuffer_auto_ptr() {if (_Owns && _Ptr) xmlOutputBufferClose(_Ptr); } xmlOutputBuffer& operator*() const {return (*get()); } xmlOutputBuffer *operator->() const {return (get()); } xmlOutputBuffer *get() const {return (_Ptr); } xmlOutputBuffer *release() const {((xmlOutputBuffer_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xmlOutputBuffer *_Ptr; }; class xsltTransformContext_auto_ptr { public: explicit xsltTransformContext_auto_ptr(xsltTransformContext *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xsltTransformContext_auto_ptr(const xsltTransformContext_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xsltTransformContext_auto_ptr& operator=(const xsltTransformContext_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xsltFreeTransformContext(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xsltTransformContext_auto_ptr() {if (_Owns && _Ptr) xsltFreeTransformContext(_Ptr); } xsltTransformContext& operator*() const {return (*get()); } xsltTransformContext *operator->() const {return (get()); } xsltTransformContext *get() const {return (_Ptr); } xsltTransformContext *release() const {((xsltTransformContext_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xsltTransformContext *_Ptr; }; class xsltStylesheet_auto_ptr { public: explicit xsltStylesheet_auto_ptr(xsltStylesheet *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xsltStylesheet_auto_ptr(const xsltStylesheet_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xsltStylesheet_auto_ptr& operator=(const xsltStylesheet_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xsltFreeStylesheet(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xsltStylesheet_auto_ptr() {if (_Owns && _Ptr) xsltFreeStylesheet(_Ptr); } xsltStylesheet& operator*() const {return (*get()); } xsltStylesheet *operator->() const {return (get()); } xsltStylesheet *get() const {return (_Ptr); } xsltStylesheet *release() const {((xsltStylesheet_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xsltStylesheet *_Ptr; }; // methods static void writeNode(Request& r, VXdoc& xdoc, xmlNode* node) { if(!node) throw Exception(PARSER_RUNTIME, 0, "error creating node"); // OOM, bad name, things like that // write out result r.write_no_lang(xdoc.wrap(*node)); } struct IdsIteratorInfo { xmlChar *elementId; xmlNode *element; }; /* Hash Scanner function for pa_getElementById */ extern "C" void // switching to calling convetion of libxml idsHashScanner (void *payload, void *data, xmlChar *name) { IdsIteratorInfo *priv = (IdsIteratorInfo *)data; if (priv->element == NULL && xmlStrEqual (name, priv->elementId)) { xmlNode* parent=((xmlID *)payload)->attr->parent; assert(parent); priv->element=parent; } } static xmlNode* pa_getElementById(xmlDoc& xmldoc, xmlChar* elementId) { xmlHashTable *ids = (xmlHashTable *)xmldoc.ids; IdsIteratorInfo iter={elementId, NULL}; xmlHashScan(ids, idsHashScanner, &iter); return iter.element; } /* static xmlNode * pa_importNode (xmlDoc& xmldoc, xmlNode& importedNode, bool deep) { xmlNode *result = NULL; switch (importedNode.type) { case XML_ATTRIBUTE_NODE: result = (xmlNode *)xmlCopyProp(xmldoc, (xmlAttr *)importedNode); result.parent=0; // no idea break; case XML_DOCUMENT_FRAG_NODE: case XML_ELEMENT_NODE: case XML_ENTITY_REF_NODE: case XML_PI_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: result = xmlCopyNode (importedNode->n, deep); xmlSetTreeDoc (result, priv->n); break; default: *exc = GDOME_NOT_SUPPORTED_ERR; } return result; } */ // Element createElement(in DOMString tagName) raises(DOMException); static void _createElement(Request& r, MethodParams& params) { xmlChar* tagName=as_xmlname(r, params, 0, "tagName must be string"); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocNode(&xmldoc, NULL, tagName, NULL); writeNode(r, vdoc, node); } // Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); static void _createElementNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); xmlChar* qualifiedName=as_xmlqname(r, params, 1); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlChar* prefix=0; xmlChar* localName=xmlSplitQName2(qualifiedName, &prefix); xmlNode *node; if(localName) { xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, prefix); node=xmlNewDocNode(&xmldoc, &ns, localName, NULL); } else node=xmlNewDocNode(&xmldoc, NULL, qualifiedName/*unqualified, actually*/, NULL); writeNode(r, vdoc, node); } // DocumentFragment createDocumentFragment() static void _createDocumentFragment(Request& r, MethodParams&) { VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocFragment(&xmldoc); writeNode(r, vdoc, node); } // Text createTextNode(in DOMString data); static void _createTextNode(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocText(&xmldoc, data); writeNode(r, vdoc, node); } // Comment createComment(in DOMString data) static void _createComment(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlNode *node=xmlNewComment(data); writeNode(r, vdoc, node); } // CDATASection createCDATASection(in DOMString data) raises(DOMException); static void _createCDATASection(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewCDataBlock(&xmldoc, data, strlen((const char*)data)); writeNode(r, vdoc, node); } // ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data) raises(DOMException); static void _createProcessingInstruction(Request& r, MethodParams& params) { xmlChar* target=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); xmlChar* data=as_xmlchar(r, params, 1, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocPI(&xmldoc, target, data); writeNode(r, vdoc, node); } // Attr createAttribute(in DOMString name) raises(DOMException); static void _createAttribute(Request& r, MethodParams& params) { xmlChar* name=as_xmlname(r, params, 0); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=(xmlNode*)xmlNewDocProp(&xmldoc, name, 0); writeNode(r, vdoc, node); } // Attr createAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); static void _createAttributeNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); xmlChar* qualifiedName=as_xmlqname(r, params, 1); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlChar* prefix=0; xmlChar* localName=xmlSplitQName2(qualifiedName, &prefix); xmlNode *node; if(localName) { xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, prefix); node=(xmlNode*)xmlNewDocProp(&xmldoc, localName, NULL); xmlSetNs(node, &ns); } else node=(xmlNode*)xmlNewDocProp(&xmldoc, qualifiedName/*unqualified, actually*/, NULL); writeNode(r, vdoc, node); } // EntityReference createEntityReference(in DOMString name) raises(DOMException); static void _createEntityReference(Request& r, MethodParams& params) { xmlChar* name=as_xmlname(r, params, 0); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewReference(&xmldoc, name); writeNode(r, vdoc, node); } static void _getElementById(Request& r, MethodParams& params) { xmlChar* elementId=as_xmlname(r, params, 0, "elementID must be string"); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); if(xmlNode *node=pa_getElementById(xmldoc, elementId)) writeNode(r, vdoc, node); } static void _importNode(Request& r, MethodParams& params) { xmlNode& importedNode=as_node(params, 0, "importedNode must be node"); bool deep=params.as_bool(1, "deep must be bool", r); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlDocCopyNode(&importedNode, &xmldoc, deep?1: 0); writeNode(r, vdoc, node); } /* GdomeElement *gdome_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeAttr *gdome_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); */ static void _create(Request& r, MethodParams& params) { Charset& source_charset=r.charsets.source(); VXdoc& vdoc=GET_SELF(r, VXdoc); Value& param=params[params.count()-1]; xmlDoc* xmldoc; bool set_encoding=false; if(param.get_junction()) { // {...} Temp_lang temp_lang(r, String::L_XML); const String& xml=r.process_to_string(param); String::Body sbody=xml.cstr_to_string_body_untaint(r.flang, r.connection(false), &r.charsets); xmldoc=xmlParseMemory(sbody.cstr(), sbody.length()); //printf("document=0x%p\n", document); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0, r); // must be last action in if, see after if} } else { // [localName] if(const String* value = param.get_string()){ xmlChar* localName=r.transcode(*value); if(xmlValidateNCName(localName, 0) != 0) throw XmlException(0, XML_INVALID_LOCAL_NAME, localName); #if 0 GdomeDocumentType *documentType=gdome_di_createDocumentType ( docimpl, r.transcode(qualifiedName), 0/*publicId*/, 0/*systemId*/, &exc); if(!documentType || exc || xmlHaveGenericErrors()) throw Exception( method_name, exc); /// +xalan createXMLDecl ? #endif xmldoc=xmlNewDoc(0); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0, r); xmlNode* node=xmlNewChild((xmlNode*)xmldoc, NULL, localName, NULL); if(!node || xmlHaveGenericErrors()) throw XmlException(0, r); set_encoding=true; // must be last action in if, see after if} } else { VFile* vfile=param.as_vfile(String::L_AS_IS); xmldoc=xmlParseMemory(vfile->value_ptr(), vfile->value_size()); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0, r); } } // must be first action after if} // replace any previous parsed source vdoc.set_xmldoc(r.charsets, *xmldoc); // URI const char* URI_cstr; if(params.count()>1) { // absolute(param) const String& URI=params.as_string(0, "URI must be string"); URI_cstr=r.absolute(URI).cstr(); } else // default = disk path to requested document URI_cstr=r.request_info.path_translated; if(URI_cstr) xmldoc->URL=source_charset.transcode_buf2xchar(URI_cstr, strlen(URI_cstr)); if(set_encoding) { const char* source_charset_name=source_charset.NAME().cstr(); xmldoc->encoding=source_charset.transcode_buf2xchar(source_charset_name, strlen(source_charset_name)); } } static void _load(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); // filespec const String* uri=¶ms.as_string(0, "URI must be string"); const char* uri_cstr; if(uri->pos("://")==STRING_NOT_FOUND) // disk path uri_cstr=r.absolute(*uri).taint_cstr(String::L_FILE_SPEC); else // xxx:// uri_cstr=uri->taint_cstr(String::L_AS_IS); // leave as-is for xmlParseFile to handle /// @todo!! add SAFE MODE!! xmlDoc* xmldoc=xmlParseFile(uri_cstr); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(uri, r); // must be first action after if} // replace any previous parsed source vdoc.set_xmldoc(r.charsets, *xmldoc); } String::C xdoc2buf(Request& r, VXdoc& vdoc, XDocOutputOptions& oo, const String* file_spec, bool use_source_charset_to_render_and_client_charset_to_write_to_header=false) { Charset* render=0; Charset* header=0; if(use_source_charset_to_render_and_client_charset_to_write_to_header) { render=&r.charsets.source(); header=&r.charsets.client(); } else { header=render=&charsets.get(oo.encoding->change_case(r.charsets.source(), String::CC_UPPER)); } const char* render_encoding=render->NAME_CSTR(); const char* header_encoding=header->NAME_CSTR(); xmlCharEncodingHandler *renderer=xmlFindCharEncodingHandler(render_encoding); // UTF-8 renderer contains empty input/output converters, // which is wrong for xmlOutputBufferCreateIO // while zero renderer goes perfectly if(render->isUTF8()) renderer=0; xmlOutputBuffer_auto_ptr outputBuffer(xmlAllocOutputBuffer(renderer)); xsltStylesheet_auto_ptr stylesheet(xsltNewStylesheet()); if(!stylesheet.get()) throw Exception(0, 0, "xsltNewStylesheet failed"); #define OOSTRING2STYLE(name) \ stylesheet->name=oo.name?BAD_CAST xmlMemStrdup((const char*)r.transcode(*oo.name)):0 #define OOBOOL2STYLE(name) \ if(oo.name>=0) stylesheet->name=oo.name OOSTRING2STYLE(method); OOSTRING2STYLE(encoding); OOSTRING2STYLE(mediaType); // OOSTRING2STYLE(doctypeSystem); // OOSTRING2STYLE(doctypePublic); OOBOOL2STYLE(indent); OOSTRING2STYLE(version); OOBOOL2STYLE(standalone); OOBOOL2STYLE(omitXmlDeclaration); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmldoc.encoding=BAD_CAST xmlMemStrdup(render_encoding); if(header_encoding) stylesheet->encoding=BAD_CAST xmlMemStrdup(header_encoding); if(xsltSaveResultTo(outputBuffer.get(), &xmldoc, stylesheet.get())<0 || xmlHaveGenericErrors()) throw XmlException(0, r); // write out result char *gnome_str; size_t gnome_length; #ifdef LIBXML2_NEW_BUFFER if(outputBuffer->conv) { gnome_length=xmlBufUse(outputBuffer->conv); gnome_str=(char *)xmlBufContent(outputBuffer->conv); } else { gnome_length=xmlOutputBufferGetSize(&(*outputBuffer)); gnome_str=(char *)xmlOutputBufferGetContent(&(*outputBuffer)); } #else if(outputBuffer->conv) { gnome_length=outputBuffer->conv->use; gnome_str=(char *)outputBuffer->conv->content; } else { gnome_length=outputBuffer->buffer->use; gnome_str=(char *)outputBuffer->buffer->content; } #endif if(file_spec){ file_write(r.charsets, *file_spec, gnome_str, gnome_length, true/*as_text*/); return String::C(); // actually, we don't need this output at all } else return String::C(gnome_length ? pa_strdup(gnome_str, gnome_length) : 0, gnome_length); } inline HashStringValue* get_options(MethodParams& params, size_t index){ return (params.count()>index) ? params.as_hash(index) : 0; } static void _file(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 0), true/* $.name[filename] could be specified by user */); String::C buf=xdoc2buf(r, vdoc, oo, 0/*file_name. not to file, to memory*/); VFile& vfile=*new VFile; VHash& vhcontent_type=*new VHash; vhcontent_type.hash().put( value_name, new VString(*oo.mediaType)); vhcontent_type.hash().put( String::Body("charset"), new VString(*oo.encoding)); vfile.set_binary(false/*not tainted*/, buf.str?buf.str:""/*to distinguish from stat-ed file*/, buf.length, oo.filename, &vhcontent_type); // write out result r.write_no_lang(vfile); } static void _save(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); const String& file_spec=r.absolute(params.as_string(0, FILE_NAME_MUST_BE_STRING)); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 1)); xdoc2buf(r, vdoc, oo, &file_spec); } static void _string(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 0)); String::C buf=xdoc2buf(r, vdoc, oo, 0/*file_name. not to file, to memory*/, true/*use source charset to render, client charset to put to header*/); // write out result r.write_no_lang(String(buf, String::L_AS_IS)); } #ifndef DOXYGEN struct Add_xslt_param_info { Request* r; Array* strings; const xmlChar** current_transform_param; }; #endif static void add_xslt_param( HashStringValue::key_type attribute, HashStringValue::value_type meaning, Add_xslt_param_info* info) { xmlChar* s; *info->current_transform_param++=(s=info->r->transcode(attribute)); *info->strings+=s; *info->current_transform_param++=(s=info->r->transcode(meaning->as_string())); *info->strings+=s; } static VXdoc& _transform(Request& r, const String* stylesheet_source, VXdoc& vdoc, xsltStylesheetPtr stylesheet, const xmlChar** transform_params) { xmlDoc& xmldoc=vdoc.get_xmldoc(); xsltTransformContext_auto_ptr transformContext( xsltNewTransformContext(stylesheet, &xmldoc)); // make params literal if (transformContext->globalVars == NULL) // strangly not initialized by xsltNewTransformContext transformContext->globalVars = xmlHashCreate(20); xsltQuoteUserParams(transformContext.get(), (const char**)transform_params); // do transform xmlDoc *transformed=xsltApplyStylesheetUser( stylesheet, &xmldoc, 0/*already quoted-inserted transform_params*/, 0/*const char* output*/, 0/*FILE *profile*/, transformContext.get()); if(!transformed || xmlHaveGenericErrors()) throw XmlException(stylesheet_source, r); //gdome_xml_doc_mkref dislikes XML_HTML_DOCUMENT_NODE type, fixing transformed->type=XML_DOCUMENT_NODE; // constructing result VXdoc& result=*new VXdoc(r.charsets, *transformed); /* grabbing options */ XDocOutputOptions& oo=result.output_options; oo.method=stylesheet->method?&r.transcode(stylesheet->method):0; oo.encoding=stylesheet->encoding?&r.transcode(stylesheet->encoding):0; oo.mediaType=stylesheet->mediaType?&r.transcode(stylesheet->mediaType):0; oo.indent=stylesheet->indent; oo.version=stylesheet->version?&r.transcode(stylesheet->version):0; oo.standalone=stylesheet->standalone; oo.omitXmlDeclaration=stylesheet->omitXmlDeclaration; // return return result; } static void _transform(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); // params Array transform_strings; const xmlChar** transform_params=0; if(params.count()>1) if(HashStringValue* hash=params.as_hash(1, "transform options")) { transform_params=new(UseGC) const xmlChar*[hash->count()*2+1]; Add_xslt_param_info info={ &r, &transform_strings, transform_params }; hash->for_each(add_xslt_param, &info); transform_params[hash->count()*2]=0; } VXdoc* result; if(Value *vxdoc=params[0].as(VXDOC_TYPE)) { // stylesheet (xdoc) xmlDoc& stylesheetdoc=static_cast(vxdoc)->get_xmldoc(); // compile xdoc stylesheet xsltStylesheet_auto_ptr stylesheet_ptr(xsltParseStylesheetDoc(&stylesheetdoc)); if(xmlHaveGenericErrors()) throw XmlException(0, r); if(!stylesheet_ptr.get()) throw Exception("xml", 0, "stylesheet failed to compile"); // strange thing - xsltParseStylesheetDoc records document and destroys it in stylesheet destructor // we don't need that stylesheet_ptr->doc=0; // transform! result=&_transform(r, 0, vdoc, stylesheet_ptr.get(), transform_params); } else { // stylesheet (file name) // extablish stylesheet connection const String& stylesheet_filespec= r.absolute(params.as_string(0, "stylesheet must be file name (string) or DOM document (xdoc)")); Stylesheet_connection_ptr connection=stylesheet_manager->get_connection(stylesheet_filespec); // load and compile file to stylesheet [or get cached if any] // transform! result=&_transform(r, &stylesheet_filespec, vdoc, connection->stylesheet(), transform_params); } // write out result r.write_no_lang(*result); } // constructor /// @test how to create empty type html? MXdoc::MXdoc(): MXnode(XDOC_CLASS_NAME, xnode_class) { /// DOM1 // Element createElement(in DOMString tagName) raises(DOMException); add_native_method("createElement", Method::CT_DYNAMIC, _createElement, 1, 1); // DocumentFragment createDocumentFragment(); add_native_method("createDocumentFragment", Method::CT_DYNAMIC, _createDocumentFragment, 0, 0); // Text createTextNode(in DOMString data); add_native_method("createTextNode", Method::CT_DYNAMIC, _createTextNode, 1, 1); // Comment createComment(in DOMString data); add_native_method("createComment", Method::CT_DYNAMIC, _createComment, 1, 1); // CDATASection createCDATASection(in DOMString data) raises(DOMException); add_native_method("createCDATASection", Method::CT_DYNAMIC, _createCDATASection, 1, 1); // ProcessingInstruction createProcessingInstruction(in DOMString target, in DOMString data) raises(DOMException); add_native_method("createProcessingInstruction", Method::CT_DYNAMIC, _createProcessingInstruction, 2, 2); // Attr createAttribute(in DOMString name) raises(DOMException); add_native_method("createAttribute", Method::CT_DYNAMIC, _createAttribute, 1, 1); // EntityReference createEntityReference(in DOMString name) raises(DOMException); add_native_method("createEntityReference", Method::CT_DYNAMIC, _createEntityReference, 1, 1); /// DOM2 // ^xdoc.getElementById[elementId] add_native_method("getElementById", Method::CT_DYNAMIC, _getElementById, 1, 1); // Node (in Node importedNode, in boolean deep) raises(DOMException) add_native_method("importNode", Method::CT_DYNAMIC, _importNode, 2, 2); // Attr createAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); add_native_method("createAttributeNS", Method::CT_DYNAMIC, _createAttributeNS, 2, 2); // Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); add_native_method("createElementNS", Method::CT_DYNAMIC, _createElementNS, 2, 2); /// parser // ^xdoc::create{qualifiedName} // ^xdoc::create[xml] // ^xdoc::create[URI][xml] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 2); // for backward compatibility with <=v 1.82 2002/01/31 11:51:46 paf add_native_method("set", Method::CT_DYNAMIC, _create, 1, 1); // ^xdoc::load[some.xml] add_native_method("load", Method::CT_DYNAMIC, _load, 1, 1); // ^xdoc.save[some.xml] // ^xdoc.save[some.xml;options hash] add_native_method("save", Method::CT_DYNAMIC, _save, 1, 2); // ^xdoc.string[] // ^xdoc.string[options hash] add_native_method("string", Method::CT_DYNAMIC, _string, 0, 1); // ^xdoc.file[] file with "" // ^xdoc.file[options hash] file with "" add_native_method("file", Method::CT_DYNAMIC, _file, 0, 1); // ^xdoc.transform[stylesheet file_name/xdoc] // ^xdoc.transform[stylesheet file_name/xdoc;params hash] add_native_method("transform", Method::CT_DYNAMIC, _transform, 1, 2); } # else #include "classes.h" // global variable DECLARE_CLASS_VAR(xdoc, 0, 0); // fictive #endif parser-3.4.3/src/classes/string.C000644 000000 000000 00000057220 12230056040 016750 0ustar00rootwheel000000 000000 /** @file Parser: @b string parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_string.h" #include "pa_sql_connection.h" #include "pa_dictionary.h" #include "pa_vmethod_frame.h" #include "pa_vregex.h" #include "pa_charsets.h" volatile const char * IDENT_STRING_C="$Id: string.C,v 1.211 2013/10/17 21:52:32 moko Exp $"; // class class MString: public Methoded { public: MString(); }; // global variable DECLARE_CLASS_VAR(string, new MString, 0); // void class, inherited from string and thus should be inited afterwards class MVoid: public Methoded { public: MVoid(); }; // void global variable should be after string global variable DECLARE_CLASS_VAR(void, new MVoid, 0); // defines for statics #define MATCH_VAR_NAME "match" #define TRIM_START_OPTION "left" #define TRIM_END_OPTION "right" #define TRIM_BOTH_OPTION "both" #define MODE_APPEND "append" // statics static const String match_var_name(MATCH_VAR_NAME); // methods static void _length(Request& r, MethodParams&) { double result=GET_SELF(r, VString).string().length(r.charsets.source()); r.write_no_lang(*new VDouble(result)); } static void _int(Request& r, MethodParams& params) { const String& self_string=GET_SELF(r, VString).string(); int converted; if(self_string.is_empty()) { if(params.count()>0) converted=params.as_int(0, "default must be int", r); // (default) else throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); } else { try { converted=self_string.as_int(); } catch(...) { // convert problem if(params.count()>0) converted=params.as_int(0, "default must be int", r); // (default) else rethrow; // we have a problem when no default } } r.write_no_lang(*new VInt(converted)); } static void _double(Request& r, MethodParams& params) { const String& self_string=GET_SELF(r, VString).string(); double converted; if(self_string.is_empty()) { if(params.count()>0) converted=params.as_double(0, "default must be double", r); // (default) else throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); } else { try { converted=self_string.as_double(); } catch(...) { // convert problem if(params.count()>0) converted=params.as_double(0, "default must be double", r); // (default) else rethrow; // we have a problem when no default } } r.write_no_lang(*new VDouble(converted)); } static void _bool(Request& r, MethodParams& params) { const String& self_string=GET_SELF(r, VString).string(); bool converted; const char *str=self_string.cstr(); if(self_string.is_empty()) { if(params.count()>0) converted=params.as_bool(0, "default must be bool", r); // (default) else throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); } else if( (str[0]=='T' || str[0]=='t') && (str[1]=='R' || str[1]=='r') && (str[2]=='U' || str[2]=='u') && (str[3]=='E' || str[3]=='e') && str[4]==0 ) { // "true" converted=true; } else if( (str[0]=='F' || str[0]=='f') && (str[1]=='A' || str[1]=='a') && (str[2]=='L' || str[2]=='l') && (str[3]=='S' || str[3]=='s') && (str[4]=='E' || str[4]=='e') && str[5]==0 ) { // "false" converted=false; } else { try { converted=self_string.as_bool(); } catch(...) { // convert problem if(params.count()>0) converted=params.as_bool(0, "default must be bool", r); // (default) else rethrow; // we have a problem when no default } } r.write_no_lang(VBool::get(converted)); } /*not static*/void _string_format(Request& r, MethodParams& params) { Value& fmt_maybe_code=params[0]; // for some time due to stupid {} in original design const String& fmt=r.process_to_string(fmt_maybe_code); const char* buf=format(r.get_self().as_double(), fmt.trim().cstrm()); r.write_no_lang(String(buf)); } static void _left(Request& r, MethodParams& params) { ssize_t sn=params.as_int(0, "n must be int", r); if(sn<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", sn); size_t n=(size_t)sn; const String& string=GET_SELF(r, VString).string(); r.write_assign_lang(string.mid(r.charsets.source(), 0, n)); } static void _right(Request& r, MethodParams& params) { ssize_t sn=(size_t)params.as_int(0, "n must be int", r); if(sn<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", sn); size_t n=(size_t)sn; const String& string=GET_SELF(r, VString).string(); size_t length=string.length(r.charsets.source()); r.write_assign_lang(n=0", sbegin); size_t begin=(size_t)sbegin; size_t end; size_t length=0; if(params.count()>1) { ssize_t sn=params.as_int(1, "n must be int", r); if(sn<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", sn); end=begin+(size_t)sn; } else { length=string.length(r.charsets.source()); end=length; } r.write_assign_lang(string.mid(r.charsets.source(), begin, end, length)); } static void _pos(Request& r, MethodParams& params) { Value& substr=params.as_no_junction(0, "substr must not be code"); const String& string=GET_SELF(r, VString).string(); ssize_t offset=0; if(params.count()>1){ offset=params.as_int(1, "n must be int", r); if(offset<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", offset); } r.write_no_lang(*new VInt((int)string.pos(r.charsets.source(), substr.as_string(), (size_t)offset))); } static void split_list(MethodParams& params, int paramIndex, const String& string, ArrayString& result) { Value& delim_value=params.as_no_junction(paramIndex, "delimiter must not be code"); size_t pos_after=0; string.split(result, pos_after, delim_value.as_string()); } #define SPLIT_LEFT 0x0001 #define SPLIT_RIGHT 0x0010 #define SPLIT_HORIZONTAL 0x0100 #define SPLIT_VERTICAL 0x1000 static int split_options(const String* options) { struct Split_option { const char* keyL; const char* keyU; int setBit; int checkBit; } split_option[]={ {"l", "L", SPLIT_LEFT, SPLIT_RIGHT}, // 0xVHRL {"r", "R", SPLIT_RIGHT, SPLIT_LEFT}, {"h", "H", SPLIT_HORIZONTAL, SPLIT_VERTICAL}, {"v", "V", SPLIT_VERTICAL, SPLIT_HORIZONTAL}, {0, 0, 0, 0} }; int result=0; if(options) { for(Split_option *o=split_option; o->keyL; o++) if(options->pos(o->keyL)!=STRING_NOT_FOUND || (o->keyU && options->pos(o->keyU)!=STRING_NOT_FOUND)) { if(result & o->checkBit) throw Exception(PARSER_RUNTIME, options, "conflicting split options"); result |= o->setBit; } } return result; } static Table& split_vertical(ArrayString& pieces, bool right, const String* column_name) { Table::columns_type columns(new ArrayString); *columns+=column_name; Table& table=*new Table(columns, pieces.count()); if(right) { // right for(int i=pieces.count(); --i>=0; ) { Table::element_type row(new ArrayString); *row+=pieces[i]; table+=row; } } else { // left Array_iterator i(pieces); while(i.has_next()) { Table::element_type row(new ArrayString); *row+=i.next(); table+=row; } } return table; } static Table& split_horizontal(ArrayString& pieces, bool right) { Table& table=*new Table(Table::columns_type(0) /* nameless */); Table::element_type row(new ArrayString(pieces.count())); if(right) { // right for(int i=pieces.count(); --i>=0; ) *row+=pieces[i]; } else { // left for(Array_iterator i(pieces); i.has_next(); ) *row+=i.next(); } table+=row; return table; } static void split_with_options(Request& r, MethodParams& params, int bits) { const String& string=GET_SELF(r, VString).string(); size_t params_count=params.count(); ArrayString pieces; split_list(params, 0, string, pieces); if(!bits) { const String* options=0; if(params_count>1) options=¶ms.as_string(1, OPTIONS_MUST_NOT_BE_CODE); bits=split_options(options); } bool right=(bits & SPLIT_RIGHT) != 0; bool horizontal=(bits & SPLIT_HORIZONTAL) !=0; const String* column_name=0; if(params_count>2){ column_name=¶ms.as_string(2, COLUMN_NAME_MUST_BE_STRING); if (horizontal && !column_name->is_empty()) throw Exception(PARSER_RUNTIME, column_name, "column name can't be specified with horisontal split"); } if(!column_name || column_name->is_empty()) column_name=new String("piece"); Table& table=horizontal?split_horizontal(pieces, right):split_vertical(pieces, right, column_name); r.write_no_lang(*new VTable(&table)); } static void _split(Request& r, MethodParams& params) { split_with_options(r, params, 0 /* maybe-determine from param #2 */); } static void _lsplit(Request& r, MethodParams& params) { split_with_options(r, params, SPLIT_LEFT); } static void _rsplit(Request& r, MethodParams& params) { split_with_options(r, params, SPLIT_RIGHT); } static void search_action(Table& table, Table::element_type row, int, int, int, int, void *) { if(row) table+=row; } #ifndef DOXYGEN struct Replace_action_info { Request* request; const String* src; String* dest; VTable* vtable; Value* replacement_code; }; #endif /// @todo they can do $global[$result] there, getting pointer to later-invalid local var, kill this static void replace_action(Table& table, ArrayString* row, int prestart, int prefinish, int poststart, int postfinish, void *info) { Replace_action_info& ai=*static_cast(info); if(row) { // begin&middle // piece from last match['prestart'] to beginning of this match['prefinish'] if(prestart!=prefinish) *ai.dest << ai.src->mid(prestart, prefinish);//ai.dest->APPEND_CONST("-"); // store found parts in one-record VTable if(table.count()) // middle table.put(0, row); else // begin table+=row; { // execute 'replacement_code' in 'table' context if(ai.replacement_code){ ai.vtable->set_table(table); *ai.dest << ai.request->process_to_string(*ai.replacement_code); } } } else // end *ai.dest << ai.src->mid(poststart, postfinish); } static void _match(Request& r, MethodParams& params) { size_t params_count=params.count(); Value& regexp=params.as_no_junction(0, "regexp must not be code"); Value* options=(params_count>1)?¶ms.as_no_junction(1, OPTIONS_MUST_NOT_BE_CODE):0; VRegex* vregex; VRegexCleaner vrcleaner; if(Value* value=regexp.as(VREGEX_TYPE)){ if(options && options->is_defined()) throw Exception(PARSER_RUNTIME, 0, "you can not specify regex-object and options together" ); vregex=static_cast(value); } else { vregex=new VRegex(r.charsets.source(), ®exp.as_string(), (options)?(&options->as_string()):0); vregex->study(); vrcleaner.vregex=vregex; } Temp_lang temp_lang(r, String::L_PASS_APPENDED); const String& src=GET_SELF(r, VString).string(); int matches_count=0; if(params_count<3) { // search Table* table=src.match(vregex, search_action, 0, matches_count); if(table){ r.write_no_lang(*new VTable(table)); } else { r.write_no_lang(*new VInt(matches_count)); } } else { // replace Value* replacement_code=0; bool is_junction=false; Value* replacement=¶ms[2]; if(replacement->get_junction()){ replacement_code=replacement; is_junction=true; } else if(replacement->is_string()){ if(replacement->is_defined()) replacement_code=replacement; } else if(!replacement->is_void()) throw Exception(PARSER_RUNTIME, 0, "replacement option should be junction or string"); Value* default_code=(params_count==4)?¶ms.as_junction(3, "default value must be code"):0; String result; VTable* vtable=new VTable; Replace_action_info info={ &r, &src, &result, vtable, replacement_code }; if(is_junction){ Temp_value_element temp(r, *replacement_code->get_junction()->method_frame, match_var_name, vtable); src.match(vregex, replace_action, &info, matches_count); } else { src.match(vregex, replace_action, &info, matches_count); } if(!matches_count && default_code) r.process_write(*default_code); else r.write_assign_lang(result); } } static void change_case(Request& r, MethodParams&, String::Change_case_kind kind) { const String& src=GET_SELF(r, VString).string(); r.write_assign_lang(src.change_case(r.charsets.source(), kind)); } static void _upper(Request& r, MethodParams& params) { change_case(r, params, String::CC_UPPER); } static void _lower(Request& r, MethodParams& params) { change_case(r, params, String::CC_LOWER); } #ifndef DOXYGEN class String_sql_event_handlers: public SQL_Driver_query_event_handlers { const String& statement_string; const char* statement_cstr; bool got_column; public: bool got_cell; const String* result; public: String_sql_event_handlers( const String& astatement_string, const char* astatement_cstr): statement_string(astatement_string), statement_cstr(astatement_cstr), got_column(false), got_cell(false), result(&String::Empty) {} bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { if(got_column) { error=SQL_Error(PARSER_RUNTIME, //statement_string, "result must contain exactly one column"); return true; } got_column=true; return false; } bool before_rows(SQL_Error& /*error*/ ) { /* ignore */ return false; } bool add_row(SQL_Error& /*error*/) { /* ignore */ return false; } bool add_row_cell(SQL_Error& error, const char* str, size_t) { if(got_cell) { error=SQL_Error(PARSER_RUNTIME, //statement_string, "result must not contain more then one row"); return true; } try { got_cell=true; result=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */ ); return false; } catch(...) { error=SQL_Error("exception occured in String_sql_event_handlers::add_row_cell"); return true; } } }; #endif extern String sql_bind_name; extern String sql_limit_name; extern String sql_offset_name; extern String sql_default_name; extern String sql_distinct_name; extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; default_code=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process_to_value(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process_to_value(*voffset).as_double(); } if((default_code=options->get(sql_default_name))) { valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); Temp_lang temp_lang(r, String::L_SQL); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); String_sql_event_handlers handlers(statement_string, statement_cstr); r.connection()->query( statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); if(!handlers.got_cell) return 0; // no lines, caller should return second param[default value] return handlers.result; } static void _sql(Request& r, MethodParams& params) { Value* default_code; const String* string=sql_result_string(r, params, default_code); if(!string) { if(default_code) { string=&r.process_to_string(*default_code); } else throw Exception(PARSER_RUNTIME, 0, "produced no result, but no default option specified"); } r.write_assign_lang(*string); } static void _replace(Request& r, MethodParams& params) { const String& src=GET_SELF(r, VString).string(); if(params.count()==1) { // ^string.replace[table] Table* table=params.as_table(0, "param"); Dictionary dict(*table); r.write_assign_lang(src.replace(dict)); } else { // ^string.replace[from-string;to-string] Dictionary dict( params.as_string(0, "from must be string"), params.as_string(1, "to must be string") ); r.write_assign_lang(src.replace(dict)); } } static void _save(Request& r, MethodParams& params) { bool do_append=false; Charset* asked_charset=0; size_t file_name_index=0; if(params.count()>1) if(HashStringValue* options=params.as_no_junction(1, "second parameter should be string or hash").get_hash()){ // ^file.save[filespec;$.charset[] $.append(true)] int valid_options=0; if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ asked_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); valid_options++; } if(Value* vappend=options->get(MODE_APPEND)){ do_append=vappend->as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } else { // ^file.save[append;filespec] const String& mode=params.as_string(0, "mode must be string"); if(mode==MODE_APPEND){ do_append=true; file_name_index++; } else throw Exception(PARSER_RUNTIME, &mode, "unknown mode, must be 'append'"); } const String& file_name=params.as_string(file_name_index, FILE_NAME_MUST_BE_STRING); const String& src=GET_SELF(r, VString).string(); String::Body sbody=src.cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets); // write file_write(r.charsets, r.absolute(file_name), sbody.cstr(), sbody.length(), true, do_append, asked_charset); } static void _normalize(Request& r, MethodParams&) { const String& src=GET_SELF(r, VString).string(); r.write_assign_lang(src); } static void _trim(Request& r, MethodParams& params) { const String& src=GET_SELF(r, VString).string(); String::Trim_kind kind=String::TRIM_BOTH; size_t params_count=params.count(); const char* chars=0; if(params_count>0) { const String& skind=params.as_string(0, "'where' must be string"); if(!skind.is_empty()) if(skind==TRIM_BOTH_OPTION) kind=String::TRIM_BOTH; else if(skind==TRIM_START_OPTION || skind=="start") kind=String::TRIM_START; else if(skind==TRIM_END_OPTION || skind=="end") kind=String::TRIM_END; else throw Exception(PARSER_RUNTIME, &skind, "'kind' must be one of "TRIM_START_OPTION", "TRIM_BOTH_OPTION", "TRIM_END_OPTION); if(params_count>1) { const String& schars=params.as_string(1, "'chars' must be string"); if(!schars.is_empty()) chars=schars.cstr(); } } r.write_assign_lang(src.trim(kind, chars, &r.charsets.source())); } static void _base64(Request& r, MethodParams& params) { if(params.count()) { // decode: ^string:base64[encoded[;$.strict(true|false)]] const char* cstr=params.as_string(0, PARAMETER_MUST_BE_STRING).cstr(); char* decoded=0; size_t length=0; bool strict=false; if(params.count() > 1) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; if(Value* vstrict=options->get(BASE64_STRICT_OPTION_NAME)) { strict=r.process_to_value(*vstrict).as_bool(); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } pa_base64_decode(cstr, strlen(cstr), decoded, length, strict); if(decoded && length){ if(memchr((const char*)decoded, 0, length)) throw Exception(PARSER_RUNTIME, 0, "Invalid \\x00 character found while decode to string. Decode it to file instead."); fix_line_breaks(decoded, length); if(length) r.write_assign_lang(*new String(decoded, String::L_TAINTED)); } } else { // encode: ^str.base64[] VString& self=GET_SELF(r, VString); const char* cstr=self.string().cstr(); const char* encoded=pa_base64_encode(cstr, strlen(cstr)); r.write_assign_lang(*new String(encoded, String::L_TAINTED/*once ?param=base64(something) was needed*/)); } } static void _escape(Request& r, MethodParams&){ const String& src=GET_SELF(r, VString).string(); r.write_assign_lang(src.escape(r.charsets.source())); } static void _unescape(Request& r, MethodParams& params){ const String& src=params.as_string(0, PARAMETER_MUST_BE_STRING); if(const char* result=unescape_chars(src.cstr(), src.length(), &r.charsets.source(), true)) r.write_assign_lang(*new String(result)); } // constructor MString::MString(): Methoded("string") { // ^string.length[] add_native_method("length", Method::CT_DYNAMIC, _length, 0, 0); // ^string.int[] // ^string.int(default) add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^string.double[] // ^string.double(default) add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^void.bool[] // ^void.bool(default) add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); // ^string.format[format] add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); // ^string.left(n) add_native_method("left", Method::CT_DYNAMIC, _left, 1, 1); // ^string.right(n) add_native_method("right", Method::CT_DYNAMIC, _right, 1, 1); // ^string.mid(p) // ^string.mid(p;n) add_native_method("mid", Method::CT_DYNAMIC, _mid, 1, 2); // ^string.pos[substr] // ^string.pos[substr](n) add_native_method("pos", Method::CT_DYNAMIC, _pos, 1, 2); // ^string.split[delim] // ^string.split[delim][options] // ^string.split[delim][options][column name] add_native_method("split", Method::CT_DYNAMIC, _split, 1, 3); // old names for backward compatibility // ^string.lsplit[delim] add_native_method("lsplit", Method::CT_DYNAMIC, _lsplit, 1, 1); // ^string.rsplit[delim] add_native_method("rsplit", Method::CT_DYNAMIC, _rsplit, 1, 1); // ^string.match[regexp][options] // ^string.match[regexp][options]{replacement-code} // ^string.match[regexp][options]{replacement-code}{code-if-nothing-is-found} add_native_method("match", Method::CT_DYNAMIC, _match, 1, 4); // ^string.upper[] add_native_method("upper", Method::CT_DYNAMIC, _upper, 0, 0); // ^string.lower[] add_native_method("lower", Method::CT_DYNAMIC, _lower, 0, 0); // ^string:sql{query} // ^string:sql{query}[options hash] add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); // ^string.replace[table] add_native_method("replace", Method::CT_DYNAMIC, _replace, 1, 2); // ^string.save[append][file] // ^string.save[file] // ^string.save[file][$.append(true) $.charset[...]] add_native_method("save", Method::CT_DYNAMIC, _save, 1, 2); // ^string.normalize[] add_native_method("normalize", Method::CT_DYNAMIC, _normalize, 0, 0); // ^string.trim[[start|both|end][;chars]] add_native_method("trim", Method::CT_DYNAMIC, _trim, 0, 2); // ^string.base64[] << encode // ^string:base64[encoded string] << decode add_native_method("base64", Method::CT_ANY, _base64, 0, 2); // ^string.js-escape[] add_native_method("js-escape", Method::CT_ANY, _escape, 0, 0); // ^string:js-unescape[escaped%uXXXXstring] add_native_method("js-unescape", Method::CT_STATIC, _unescape, 1, 1); } parser-3.4.3/src/classes/file.C000644 000000 000000 00000113043 12207106461 016364 0ustar00rootwheel000000 000000 /** @file Parser: @b file parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_table.h" #include "pa_vint.h" #include "pa_exec.h" #include "pa_vdate.h" #include "pa_dir.h" #include "pa_vtable.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_sql_connection.h" #include "pa_md5.h" #include "pa_vregex.h" #include "pa_version.h" volatile const char * IDENT_FILE_C="$Id: file.C,v 1.229 2013/08/27 11:27:45 moko Exp $"; // defines #define STDIN_EXEC_PARAM_NAME "stdin" #define CHARSET_EXEC_PARAM_NAME "charset" #define NAME_NAME "name" #define KEEP_EMPTY_DIRS_NAME "keep-empty-dirs" #define SUPPRESS_EXCEPTION_NAME "exception" // externs extern String sql_limit_name; extern String sql_offset_name; // helpers class File_list_table_template_columns: public ArrayString { public: File_list_table_template_columns() { *this+=new String("name"); *this+=new String("dir"); *this+=new String("size"); *this+=new String("cdate"); *this+=new String("mdate"); *this+=new String("adate"); } }; Table file_list_table_template(new File_list_table_template_columns); // class class MFile: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VFile(); } public: MFile(); }; // global variable DECLARE_CLASS_VAR(file, new MFile, 0); // consts /// from apache-1.3|src|support|suexec.c static const char* suexec_safe_env_lst[]={ "AUTH_TYPE", "CONTENT_LENGTH", "CONTENT_TYPE", "DATE_GMT", "DATE_LOCAL", "DOCUMENT_NAME", "DOCUMENT_PATH_INFO", "DOCUMENT_ROOT", "DOCUMENT_URI", "FILEPATH_INFO", "GATEWAY_INTERFACE", "LAST_MODIFIED", "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING", "QUERY_STRING_UNESCAPED", "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_IDENT", "REMOTE_PORT", "REMOTE_USER", "REDIRECT_QUERY_STRING", "REDIRECT_STATUS", "REDIRECT_URL", "REQUEST_METHOD", "REQUEST_URI", "SCRIPT_FILENAME", "SCRIPT_NAME", "SCRIPT_URI", "SCRIPT_URL", "SERVER_ADMIN", "SERVER_NAME", "SERVER_ADDR", "SERVER_PORT", "SERVER_PROTOCOL", "SERVER_SOFTWARE", "UNIQUE_ID", "USER_NAME", "TZ", NULL }; // statics static const String::Body adate_name("adate"); static const String::Body mdate_name("mdate"); static const String::Body cdate_name("cdate"); // methods static void _save(Request& r, MethodParams& params) { bool is_text=VFile::is_text_mode(params.as_string(0, MODE_MUST_NOT_BE_CODE)); Value& vfile_name=params.as_no_junction(1, FILE_NAME_MUST_NOT_BE_CODE); Charset* asked_charset=0; if(params.count()>2) if(HashStringValue* options=params.as_hash(2)){ int valid_options=0; if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ asked_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // save GET_SELF(r, VFile).save(r.charsets, r.absolute(vfile_name.as_string()), is_text, asked_charset); } static void _delete(Request& r, MethodParams& params) { const String& file_name=params.as_string(0, FILE_NAME_MUST_NOT_BE_CODE); bool keep_empty_dirs=false; bool fail_on_problem=true; if(params.count()>1) if(HashStringValue* options=params.as_hash(1)){ int valid_options=0; if(Value* vkeep_empty_dirs=options->get(KEEP_EMPTY_DIRS_NAME)){ keep_empty_dirs=r.process_to_value(*vkeep_empty_dirs).as_bool(); valid_options++; } if(Value* vsuppress_exception=options->get(SUPPRESS_EXCEPTION_NAME)){ fail_on_problem=r.process_to_value(*vsuppress_exception).as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // unlink file_delete(r.absolute(file_name), fail_on_problem, keep_empty_dirs); } static void _move(Request& r, MethodParams& params) { Value& vfrom_file_name=params.as_no_junction(0, "from file name must not be code"); Value& vto_file_name=params.as_no_junction(1, "to file name must not be code"); bool keep_empty_dirs=false; if(params.count()>2) if(HashStringValue* options=params.as_hash(2)){ int valid_options=0; if(Value* vkeep_empty_dirs=options->get(KEEP_EMPTY_DIRS_NAME)){ keep_empty_dirs=r.process_to_value(*vkeep_empty_dirs).as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // move file_move( r.absolute(vfrom_file_name.as_string()), r.absolute(vto_file_name.as_string()), keep_empty_dirs); } static void copy_process_source( struct stat& , int from_file, const String& , const char* /*fname*/, bool, void *context) { int& to_file=*static_cast(context); int nCount=0; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(from_file, buffer, sizeof(buffer)); int written=write(to_file, buffer, nCount); if( written < 0 ) throw Exception("file.access", 0, "write failed: %s (%d)", strerror(errno), errno); } while(nCount > 0); } static void copy_open_target(int f, void *from_spec) { String& file_spec=*static_cast(from_spec); file_read_action_under_lock(file_spec, "copy", copy_process_source, &f); }; static void _copy(Request& r, MethodParams& params) { Value& vfrom_file_name=params.as_no_junction(0, "from file name must not be code"); Value& vto_file_name=params.as_no_junction(1, "to file name must not be code"); String from_spec = r.absolute(vfrom_file_name.as_string()); const String& to_spec = r.absolute(vto_file_name.as_string()); file_write_action_under_lock( to_spec, "copy", copy_open_target, &from_spec); } static void _load_pass_param( HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue *dest) { dest->put(key, value); } static void _load(Request& r, MethodParams& params) { bool as_text=VFile::is_text_mode(params.as_string(0, MODE_MUST_NOT_BE_CODE)); const String& lfile_name=r.absolute(params.as_string(1, FILE_NAME_MUST_NOT_BE_CODE)); size_t param_index=params.count()-1; Value* param_value=param_index>1?¶ms.as_no_junction(param_index, "file name or options must not be code"):0; HashStringValue* options=0; const String* user_file_name=0; if(param_value){ options=param_value->get_hash(); if(options || param_index>2) param_index--; if(param_index>1){ const String& luser_file_name=params.as_string(param_index, FILE_NAME_MUST_BE_STRING); if(!luser_file_name.is_empty()) user_file_name=&luser_file_name; } } if(!user_file_name) user_file_name=&lfile_name; size_t offset=0; size_t limit=0; if(options){ options=new HashStringValue(*options); if(Value *voffset=(Value *)options->get(sql_offset_name)){ offset=r.process_to_value(*voffset).as_int(); } if(Value *vlimit=(Value *)options->get(sql_limit_name)){ limit=r.process_to_value(*vlimit).as_int(); } // no check on options count here, see file_read } File_read_result file=file_load(r, lfile_name, as_text, options, true, 0, offset, limit ); Value* vcontent_type=0; if(file.headers){ if(Value* remote_content_type=file.headers->get(HTTP_CONTENT_TYPE_UPPER)) vcontent_type=new VString(*new String(remote_content_type->as_string().cstr())); } VFile& self=GET_SELF(r, VFile); self.set(true/*tainted*/, as_text, file.str, file.length, user_file_name, vcontent_type, &r); if(file.headers){ file.headers->for_each(_load_pass_param, &self.fields()); } else { size_t size; time_t atime, mtime, ctime; file_stat(lfile_name, size, atime, mtime, ctime); HashStringValue& ff=self.fields(); ff.put(adate_name, new VDate(atime)); ff.put(mdate_name, new VDate(mtime)); ff.put(cdate_name, new VDate(ctime)); } } static void _create(Request& r, MethodParams& params) { const String* mode=0; const String* file_name=0; bool is_text=true; // new format: ^file::create[string-or-file-content[;$.mode[text|binary] $.name[...] $.content-type[...] $.charset[...] ]] size_t content_index=0; size_t options_index=1; bool extended_options=true; if(params.count()>=3){ // old format: ^file::create[text|binary;file-name;string-or-file-content[;options]] mode=¶ms.as_string(0, MODE_MUST_NOT_BE_CODE); is_text=VFile::is_text_mode(*mode); file_name=¶ms.as_string(1, FILE_NAME_MUST_NOT_BE_CODE); content_index=2; options_index=3; extended_options=false; } VString* vcontent_type=0; Charset* asked_charset=0; if(params.count()>options_index) if(HashStringValue* options=params.as_hash(options_index)) { int valid_options=0; if(extended_options) { if(Value* vmode=options->get(MODE_NAME)) { mode=&vmode->as_string(); is_text=VFile::is_text_mode(*mode); valid_options++; } if(Value* vfile_name=options->get(NAME_NAME)) { file_name=&vfile_name->as_string(); valid_options++; } } if(Value* vcharset_name=options->get(PA_CHARSET_NAME)) { asked_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); valid_options++; } if(Value* value=options->get(CONTENT_TYPE_NAME)) { vcontent_type=new VString(value->as_string()); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } Value& vcontent=params.as_no_junction(content_index, "content must be string or file"); VFile& self=GET_SELF(r, VFile); if(const String* content_str=vcontent.get_string()){ String::Body body=content_str->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets); // explode content, honor tainting changes if(asked_charset && is_text) body=Charset::transcode(body, r.charsets.source(), *asked_charset); self.set(true/*tainted*/, is_text, body.cstrm(), body.length(), file_name, vcontent_type, &r); } else { if(asked_charset) throw Exception(PARSER_RUNTIME, 0, "charset option can not be used with file-content"); self.set(*vcontent.as_vfile(String::L_AS_IS), mode != 0, is_text, file_name, vcontent_type, &r); } } static void _stat(Request& r, MethodParams& params) { const String& lfile_name=params.as_string(0, FILE_NAME_MUST_NOT_BE_CODE); size_t size; time_t atime, mtime, ctime; file_stat(r.absolute(lfile_name), size, atime, mtime, ctime); VFile& self=GET_SELF(r, VFile); self.set_binary(true/*tainted*/, 0/*no bytes*/, size, &lfile_name, 0, &r); HashStringValue& ff=self.fields(); ff.put(adate_name, new VDate(atime)); ff.put(mdate_name, new VDate(mtime)); ff.put(cdate_name, new VDate(ctime)); } static bool is_safe_env_key(const char* key) { for(const char* validator=key; *validator; validator++) { char c=*validator; if(!(c>='A' && c<='Z' || c>='0' && c<='9' || c=='_' || c=='-')) return false; } #ifdef PA_SAFE_MODE if(strncasecmp(key, "HTTP_", 5)==0) return true; if(strncasecmp(key, "CGI_", 4)==0) return true; for(int i=0; suexec_safe_env_lst[i]; i++) { if(strcasecmp(key, suexec_safe_env_lst[i])==0) return true; } return false; #else return true; #endif } #ifndef DOXYGEN struct Append_env_pair_info { Request_charsets* charsets; HashStringString* env; Value* vstdin; }; #endif static void append_env_pair( HashStringValue::key_type akey, HashStringValue::value_type avalue, Append_env_pair_info *info) { if(akey==STDIN_EXEC_PARAM_NAME) { info->vstdin=avalue; } else if(akey==CHARSET_EXEC_PARAM_NAME) { // ignore, already processed } else { if(!is_safe_env_key(akey.cstr())) throw Exception(PARSER_RUNTIME, new String(akey, String::L_TAINTED), "not safe environment variable"); info->env->put(akey, avalue->as_string().cstr_to_string_body_untaint(String::L_AS_IS, 0, info->charsets)); } } #ifndef DOXYGEN struct Pass_cgi_header_attribute_info { Charset* charset; HashStringValue* fields; Value* content_type; }; #endif static void pass_cgi_header_attribute( ArrayString::element_type astring, Pass_cgi_header_attribute_info* info) { size_t colon_pos=astring->pos(':'); if(colon_pos!=STRING_NOT_FOUND) { const String& key=astring->mid(0, colon_pos).change_case( *info->charset, String::CC_UPPER); Value* value=new VString(astring->mid(colon_pos+1, astring->length()).trim()); info->fields->put(key, value); if(key==HTTP_CONTENT_TYPE_UPPER) info->content_type=value; } } static void append_to_argv(Request& r, ArrayString& argv, const String* str){ if(!str->is_empty()) argv+=new String(str->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets), String::L_AS_IS); } /// @todo fix `` in perl - they produced flipping consoles and no output to perl static void _exec_cgi(Request& r, MethodParams& params, bool cgi) { bool is_text=true; size_t param_index=0; const String& mode=params.as_string(0, FIRST_ARG_MUST_NOT_BE_CODE); if(VFile::is_valid_mode(mode)) { is_text=VFile::is_text_mode(mode); param_index++; } if(param_index>=params.count()) throw Exception(PARSER_RUNTIME, 0, FILE_NAME_MUST_BE_SPECIFIED); const String& script_name=r.absolute(params.as_string(param_index++, FILE_NAME_MUST_NOT_BE_CODE)); HashStringString env; #define ECSTR(name, value_cstr) \ if(value_cstr) \ env.put( \ String::Body(#name), \ String::Body(*value_cstr?value_cstr:0)); \ // passing SAPI::environment if(const char *const *pairs=SAPI::environment(r.sapi_info)) { while(const char* pair=*pairs++) if(const char* eq_at=strchr(pair, '=')) if(eq_at[1]) // has value env.put( pa_strdup(pair, eq_at-pair), pa_strdup(eq_at+1)); } // const ECSTR(GATEWAY_INTERFACE, "CGI/1.1"); ECSTR("PARSER_VERSION", PARSER_VERSION); // from Request.info ECSTR(DOCUMENT_ROOT, r.request_info.document_root); ECSTR(PATH_TRANSLATED, r.request_info.path_translated); ECSTR(REQUEST_METHOD, r.request_info.method); ECSTR(QUERY_STRING, r.request_info.query_string); ECSTR(REQUEST_URI, r.request_info.uri); ECSTR(CONTENT_TYPE, r.request_info.content_type); ECSTR(CONTENT_LENGTH, format(r.request_info.content_length, "%u")); // SCRIPT_* env.put(String::Body("SCRIPT_NAME"), script_name); //env.put(String::Body("SCRIPT_FILENAME"), ??&script_name); // environment & stdin from param String *in=new String(); Charset *charset=0; // default script works raw_in 'source' charset = no transcoding needed if(param_index < params.count()) { if(HashStringValue* user_env=params.as_hash(param_index++, "env")) { // $.charset [previewing to handle URI pieces] if(Value* vcharset=user_env->get(CHARSET_EXEC_PARAM_NAME)) charset=&charsets.get(vcharset->as_string() .change_case(r.charsets.source(), String::CC_UPPER)); // $.others Append_env_pair_info info={&r.charsets, &env, 0}; { // influence tainting // main target -- $.QUERY_STRING -- URLencoding of tainted pieces to String::L_URI lang Temp_client_charset temp(r.charsets, charset? *charset: r.charsets.source()); user_env->for_each(append_env_pair, &info); } // $.stdin if(info.vstdin) { if(const String* sstdin=info.vstdin->get_string()) { // untaint stdin in = new String(sstdin->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets), String::L_AS_IS); } else if(VFile* vfile=static_cast(info.vstdin->as("file"))) in->append_know_length((const char* )vfile->value_ptr(), vfile->value_size(), String::L_TAINTED); else throw Exception(PARSER_RUNTIME, 0, STDIN_EXEC_PARAM_NAME " parameter must be string or file"); } } } // argv from params ArrayString argv; if(param_index < params.count()) { // influence tainting Temp_client_charset temp(r.charsets, charset? *charset: r.charsets.source()); for(size_t i=param_index; icount(); i++) { append_to_argv(r, argv, table->get(i)->get(0)); } } else { throw Exception(PARSER_RUNTIME, 0, "param must be string or table"); } } } } } // transcode if necessary if(charset) { Charset::transcode(env, r.charsets.source(), *charset); Charset::transcode(argv, r.charsets.source(), *charset); in=&Charset::transcode(*in, r.charsets.source(), *charset); } // @todo // ifdef WIN32 do OEM->ANSI transcode on some(.cmd?) programs to // match silent conversion in OS // exec! PA_exec_result execution=pa_exec(false/*forced_allow*/, script_name, &env, argv, *in); File_read_result *file_out=&execution.out; String *real_err=&execution.err; // transcode err if necessary (@todo: need fix line breaks in err as well ) if(charset) real_err=&Charset::transcode(*real_err, *charset, r.charsets.source()); if(file_out->length && is_text){ fix_line_breaks(file_out->str, file_out->length); // treat output as string String *real_out = new String(file_out->str); // transcode out if necessary if(charset) real_out=&Charset::transcode(*real_out, *charset, r.charsets.source()); // FIXME: unsafe cast file_out->str=const_cast(real_out->cstr()); // hacking a little file_out->length = real_out->length(); } VFile& self=GET_SELF(r, VFile); if(cgi) { // ^file::cgi const char* eol_marker=0; size_t eol_marker_size; // construct with 'out' body and header size_t dos_pos=(file_out->length)?strpos(file_out->str, "\r\n\r\n"):STRING_NOT_FOUND; size_t unix_pos=(file_out->length)?strpos(file_out->str, "\n\n"):STRING_NOT_FOUND; bool unix_header_break; switch((dos_pos!=STRING_NOT_FOUND?10:00) + (unix_pos!=STRING_NOT_FOUND?01:00)) { case 10: // dos unix_header_break=false; break; case 01: // unix unix_header_break=true; break; case 11: // dos & unix unix_header_break=unix_poslength, (file_out->length) ? (file_out->str) : "", real_err->length(), real_err->cstr()); break; //never reached } size_t header_break_pos; if(unix_header_break) { header_break_pos=unix_pos; eol_marker="\n"; eol_marker_size=1; } else { header_break_pos=dos_pos; eol_marker="\r\n"; eol_marker_size=2; } file_out->str[header_break_pos] = 0; String *header=new String(file_out->str); unsigned long headersize = header_break_pos+eol_marker_size*2; file_out->str += headersize; file_out->length -= headersize; // $body self.set(false/*not tainted*/, is_text, file_out->str, file_out->length); // $fields << header if(header) { ArrayString rows; size_t pos_after=0; header->split(rows, pos_after, eol_marker); Pass_cgi_header_attribute_info info={0, 0, 0}; info.charset=&r.charsets.source(); info.fields=&self.fields(); rows.for_each(pass_cgi_header_attribute, &info); if(info.content_type) self.fields().put(content_type_name, info.content_type); } } else { // ^file::exec // $body self.set(false/*not tainted*/, is_text, file_out->str, file_out->length); } // $status self.fields().put(file_status_name, new VInt(execution.status)); // $stderr if(!real_err->is_empty()) self.fields().put( String::Body("stderr"), new VString(*real_err)); } static void _exec(Request& r, MethodParams& params) { _exec_cgi(r, params, false); } static void _cgi(Request& r, MethodParams& params) { _exec_cgi(r, params, true); } static void _list(Request& r, MethodParams& params) { Value& relative_path=params.as_no_junction(0, "path must not be code"); bool stat=false; VRegex* vregex=0; VRegexCleaner vrcleaner; if(params.count()>1){ Value& voption=params.as_no_junction(1, "option must not be code"); if(voption.is_defined()) { Value* vfilter=0; if(HashStringValue* options=voption.get_hash()) { int valid_options=0; if(Value* vstat=options->get("stat")) { stat=r.process_to_value(*vstat).as_bool(); valid_options++; } if(Value* value=options->get("filter")) { vfilter=value; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } else { vfilter=&voption; } if(vfilter) if(Value* value=vfilter->as(VREGEX_TYPE)) { vregex=static_cast(value); } else if(vfilter->is_string()) { if(!vfilter->get_string()->trim().is_empty()) { vregex=new VRegex(r.charsets.source(), &vfilter->as_string(), 0/*options*/); vregex->study(); vrcleaner.vregex=vregex; } } else { throw Exception(PARSER_RUNTIME, 0, "filter must be regex or string"); } } } const char* absolute_path_cstr=r.absolute(relative_path.as_string()).taint_cstr(String::L_FILE_SPEC); Table::Action_options table_options; Table& table=*new Table(file_list_table_template, table_options); const int ovector_size=(1/*match*/)*3; int ovector[ovector_size]; LOAD_DIR(absolute_path_cstr, const char* file_name_cstr=ffblk.ff_name; size_t file_name_size=strlen(file_name_cstr); if(!vregex || vregex->exec(ffblk.ff_name, file_name_size, ovector, ovector_size)>=0) { Table::element_type row(new ArrayString); *row+=new String(pa_strdup(file_name_cstr, file_name_size), String::L_TAINTED); *row+=new String(String::Body::Format(ffblk.is_dir() ? 1 : 0), String::L_CLEAN); if(stat) { ffblk.stat_file(); *row+=VDouble(ffblk.size()).get_string(); *row+=new String(String::Body::Format(ffblk.c_timestamp()), String::L_CLEAN); *row+=new String(String::Body::Format(ffblk.m_timestamp()), String::L_CLEAN); *row+=new String(String::Body::Format(ffblk.a_timestamp()), String::L_CLEAN); } table+=row; } ); // write out result r.write_no_lang(*new VTable(&table)); } #ifndef DOXYGEN struct Lock_execute_body_info { Request* r; Value* body_code; }; #endif static void lock_execute_body(int , void *ainfo) { Lock_execute_body_info& info=*static_cast(ainfo); // execute body info.r->write_assign_lang(info.r->process(*info.body_code)); }; static void _lock(Request& r, MethodParams& params) { const String& file_spec=r.absolute(params.as_string(0, FILE_NAME_MUST_BE_STRING)); Lock_execute_body_info info={ &r, ¶ms.as_junction(1, "body must be code") }; file_write_action_under_lock( file_spec, "lock", lock_execute_body, &info); } static size_t afterlastslash(const String& str) { size_t pos=str.strrpbrk("/\\"); return pos!=STRING_NOT_FOUND?pos+1:0; } static size_t afterlastslash(const String& str, size_t right) { size_t pos=str.strrpbrk("/\\", 0, right); return pos!=STRING_NOT_FOUND?pos+1:0; } static void _find(Request& r, MethodParams& params) { const String& file_name=params.as_string(0, FILE_NAME_MUST_NOT_BE_CODE); Value* not_found_code=(params.count()==2)?¶ms.as_junction(1, "not-found param must be code"):0; const String* file_spec; if(file_name.first_char()=='/') file_spec=&file_name; else file_spec=&r.relative(r.request_info.uri, file_name); // easy way if(file_exist(r.absolute(*file_spec))) { r.write_assign_lang(*file_spec); return; } // monkey way size_t last_slash=file_spec->strrpbrk("/\\"); const String& dirname=file_spec->mid(0, last_slash!=STRING_NOT_FOUND?last_slash:0); const String& basename=file_spec->mid(last_slash!=STRING_NOT_FOUND?last_slash+1:0, file_spec->length()); size_t rpos=dirname.is_empty()?0:dirname.length()-1; while((rpos=dirname.rskipchars("/\\", 0, rpos))!=STRING_NOT_FOUND){ size_t slash=dirname.strrpbrk("/\\", 0, rpos); if(slash==STRING_NOT_FOUND) break; String test_name; test_name << dirname.mid(0, slash+1); test_name << basename; if(file_exist(r.absolute(test_name))) { r.write_assign_lang(test_name); return; } rpos=slash; } // no way, not found if(not_found_code) r.write_pass_lang(r.process(*not_found_code)); } static void _dirname(Request& r, MethodParams& params) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); // works as *nix dirname // empty > . // / > / // /a > / // /a/ > / // /a/some.tar.gz > /a // /a/b/ > /a // /a///b/ > /a // /a/b/// > /a // file > . if(file_spec.is_empty()) { r.write_assign_lang(String(".")); return; } size_t p; size_t slash; if((p=file_spec.rskipchars("/\\"))==STRING_NOT_FOUND) r.write_assign_lang(String("/")); else { if((slash=file_spec.strrpbrk("/\\", 0, p))!=STRING_NOT_FOUND) { if((p=file_spec.rskipchars("/\\", 0, slash))==STRING_NOT_FOUND) p=slash; r.write_assign_lang(file_spec.mid(0, p+1)); return; } r.write_assign_lang(String(".")); } } static void _basename(Request& r, MethodParams& params) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); // works as *nix basename // empty > . // / > / // /a > a // /a/ > a // /a/some.tar.gz > some.tar.gz // /a/b/ > b // /a///b/ > b // /a/b/// > b // file > file if(file_spec.is_empty()) { r.write_assign_lang(String(".")); return; } size_t p=file_spec.rskipchars("/\\"); if(p==STRING_NOT_FOUND) r.write_assign_lang(String("/")); else r.write_assign_lang(file_spec.mid(afterlastslash(file_spec, p), p+1)); } static void _justname(Request& r, MethodParams& params) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); // /a/some.tar.gz > some.tar // /a/b.c/ > empty // /a/b.c > b size_t pos=afterlastslash(file_spec); size_t dotpos=file_spec.strrpbrk(".", pos); r.write_assign_lang(file_spec.mid(pos, dotpos!=STRING_NOT_FOUND?dotpos:file_spec.length())); } static void _justext(Request& r, MethodParams& params) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); // /a/some.tar.gz > gz // /a/b.c/ > empty size_t pos=afterlastslash(file_spec); size_t dotpos=file_spec.strrpbrk(".", pos); if(dotpos!=STRING_NOT_FOUND) r.write_assign_lang(file_spec.mid(dotpos+1, file_spec.length())); } static void _fullpath(Request& r, MethodParams& params) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); const String* result; if(file_spec.first_char()=='/') result=&file_spec; else { // /some/page.html: ^file:fullpath[a.gif] => /some/a.gif const String& full_disk_path=r.absolute(file_spec); size_t document_root_length=strlen(r.request_info.document_root); if(document_root_length>0) { char last_char=r.request_info.document_root[document_root_length-1]; if(last_char == '/' || last_char == '\\') --document_root_length; } result=&full_disk_path.mid(document_root_length, full_disk_path.length()); } r.write_assign_lang(*result); } static void _sql_string(Request& r, MethodParams&) { VFile& self=GET_SELF(r, VFile); const char *quoted=r.connection()->quote(self.value_ptr(), self.value_size()); r.write_assign_lang(*new String(quoted)); } #ifndef DOXYGEN class File_sql_event_handlers: public SQL_Driver_query_event_handlers { const String& statement_string; const char* statement_cstr; int got_columns; int got_cells; public: String::C value; const String* user_file_name; const String* user_content_type; public: File_sql_event_handlers( const String& astatement_string, const char* astatement_cstr): statement_string(astatement_string), statement_cstr(astatement_cstr), got_columns(0), got_cells(0), user_file_name(0), user_content_type(0) {} bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { if(got_columns++==3) { error=SQL_Error(PARSER_RUNTIME, "result must contain not more then 3 columns"); return true; } return false; } bool before_rows(SQL_Error& /*error*/ ) { /* ignore */ return false; } bool add_row(SQL_Error& /*error*/) { /* ignore */ return false; } bool add_row_cell(SQL_Error& error, const char* str, size_t length) { try { switch(got_cells++) { case 0: value=String::C(str, length); break; case 1: if(!user_file_name) // user not specified? user_file_name=new String(str, String::L_TAINTED); break; case 2: if(!user_content_type) // user not specified? user_content_type=new String(str, String::L_TAINTED); break; default: error=SQL_Error(PARSER_RUNTIME, "result must not contain more then one row, three columns"); return true; } return false; } catch(...) { error=SQL_Error("exception occured in File_sql_event_handlers::add_row_cell"); return true; } } }; #endif static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); Temp_lang temp_lang(r, String::L_SQL); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); File_sql_event_handlers handlers(statement_string, statement_cstr); ulong limit=SQL_NO_LIMIT; ulong offset=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vfilename=options->get(NAME_NAME)) { valid_options++; handlers.user_file_name=&vfilename->as_string(); } if(Value* vcontent_type=options->get(CONTENT_TYPE_NAME)) { valid_options++; handlers.user_content_type=&vcontent_type->as_string(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process_to_value(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process_to_value(*voffset).as_double(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } r.connection()->query( statement_cstr, 0, 0, offset, limit, handlers, statement_string); if(!handlers.value) throw Exception(PARSER_RUNTIME, 0, "produced no result"); VFile& self=GET_SELF(r, VFile); self.set_binary(true/*tainted*/, handlers.value.str, handlers.value.length, handlers.user_file_name , handlers.user_content_type ? new VString(*handlers.user_content_type) : 0 , &r); } static void _base64(Request& r, MethodParams& params) { bool dynamic=!(&r.get_self() == file_class); if(dynamic) { VFile& self=GET_SELF(r, VFile); if(params.count()) { // decode: // ^file::base64[encoded] // backward // ^file::base64[mode;user-file-name;encoded[;$.content-type[...] $.strict(true|false)]] bool is_text=false; bool strict=false; VString* vcontent_type=0; const String* user_file_name=0; size_t param_index=0; if(params.count() > 1) { if(params.count() < 3) throw Exception(PARSER_RUNTIME, 0, "constructor can not have less then 3 parameters (has %d parameters)", params.count()); // actually it accepts 1 parameter (backward) is_text=VFile::is_text_mode(params.as_string(0, MODE_MUST_NOT_BE_CODE)); user_file_name=¶ms.as_string(1, FILE_NAME_MUST_BE_STRING); if(params.count() == 4) if(HashStringValue* options=params.as_hash(3)) { int valid_options=0; if(Value* value=options->get(CONTENT_TYPE_NAME)) { vcontent_type=new VString(value->as_string()); valid_options++; } if(Value* vstrict=options->get(BASE64_STRICT_OPTION_NAME)) { strict=r.process_to_value(*vstrict).as_bool(); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } param_index=2; } const char* encoded=params.as_string(param_index, PARAMETER_MUST_BE_STRING).cstr(); char* decoded=0; size_t length=0; pa_base64_decode(encoded, strlen(encoded), decoded, length, strict); self.set(true/*tainted*/, is_text, decoded, length, user_file_name, vcontent_type, &r); } else { // encode: ^f.base64[] const char* encoded=pa_base64_encode(self.value_ptr(), self.value_size()); r.write_assign_lang(*new String(encoded, String::L_TAINTED/*once ?param=base64(something) was needed**/)); } } else { // encode: ^file:base64[filespec] const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); const char* encoded=pa_base64_encode(r.absolute(file_spec)); r.write_assign_lang(*new String(encoded, String::L_TAINTED/*once ?param=base64(something) was needed*/)); } } static void _crc32(Request& r, MethodParams& params) { unsigned long crc32 = 0; if(&r.get_self() == file_class) { // ^file:crc32[file-name] if(params.count()) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); crc32=pa_crc32(r.absolute(file_spec)); } else { throw Exception(PARSER_RUNTIME, 0, FILE_NAME_MUST_BE_SPECIFIED); } } else { // ^file.crc32[] VFile& self=GET_SELF(r, VFile); crc32=pa_crc32(self.value_ptr(), self.value_size()); } r.write_no_lang(*new VInt(crc32)); } static void file_md5_file_action( struct stat& finfo, int f, const String& , const char* /*fname*/, bool, void *context) { PA_MD5_CTX& md5context=*static_cast(context); if(finfo.st_size) { int nCount=0; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(f, buffer, sizeof(buffer)); if ( nCount ){ pa_MD5Update(&md5context, (const unsigned char*)buffer, nCount); } } while(nCount > 0); } } const char* pa_md5(const String& file_spec) { PA_MD5_CTX context; unsigned char digest[16]; pa_MD5Init(&context); file_read_action_under_lock(file_spec, "md5", file_md5_file_action, &context); pa_MD5Final(digest, &context); return hex_string(digest, sizeof(digest), false); } const char* pa_md5(const char *in, size_t in_size) { PA_MD5_CTX context; unsigned char digest[16]; pa_MD5Init(&context); pa_MD5Update(&context, (const unsigned char*)in, in_size); pa_MD5Final(digest, &context); return hex_string(digest, sizeof(digest), false); } static void _md5(Request& r, MethodParams& params) { const char* md5; if(&r.get_self() == file_class) { // ^file:md5[file-name] if(params.count()) { const String& file_spec=params.as_string(0, FILE_NAME_MUST_BE_STRING); md5=pa_md5(r.absolute(file_spec)); } else { throw Exception(PARSER_RUNTIME, 0, FILE_NAME_MUST_BE_SPECIFIED); } } else { // ^file.md5[] VFile& self=GET_SELF(r, VFile); md5=pa_md5(self.value_ptr(), self.value_size()); } r.write_no_lang(*new String(md5)); } // constructor MFile::MFile(): Methoded("file") { // ^file::create[text|binary;file-name;string-or-file[;options hash]] // ^file::create[string-or-file[;options hash]] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 4); // ^file.save[mode;file-name] // ^file.save[mode;file-name;$.charset[...]] add_native_method("save", Method::CT_DYNAMIC, _save, 2, 3); // ^file:delete[file-name] // ^file:delete[file-name;$.keep-empty-dir(true)$.exception(false)] add_native_method("delete", Method::CT_STATIC, _delete, 1, 2); // ^file:move[from-file-name;to-file-name] // ^file:move[from-file-name;to-file-name;$.keep-empty-dir(true)] add_native_method("move", Method::CT_STATIC, _move, 2, 3); // ^file::load[mode;disk-name] // ^file::load[mode;disk-name;user-name] // ^file::load[mode;disk-name;user-name;options hash] // ^file::load[mode;disk-name;options hash] add_native_method("load", Method::CT_DYNAMIC, _load, 2, 4); // ^file::stat[disk-name] add_native_method("stat", Method::CT_DYNAMIC, _stat, 1, 1); // ^file::cgi[mode;file-name] // ^file::cgi[mode;file-name;env hash] // ^file::cgi[mode;file-name;env hash;1cmd;2line;3ar;4g;5s] add_native_method("cgi", Method::CT_DYNAMIC, _cgi, 1, 3+50); // ^file::exec[mode;file-name] // ^file::exec[mode;file-name;env hash] // ^file::exec[mode;file-name;env hash;1cmd;2line;3ar;4g;5s] add_native_method("exec", Method::CT_DYNAMIC, _exec, 1, 3+50); // ^file:list[path] // ^file:list[path][regexp] // ^file:list[path][$.filter[regexp] $.stat(true)] add_native_method("list", Method::CT_STATIC, _list, 1, 2); // ^file:lock[path]{code} add_native_method("lock", Method::CT_STATIC, _lock, 2, 2); // ^file:find[file-name] // ^file:find[file-name]{when-not-found} add_native_method("find", Method::CT_STATIC, _find, 1, 2); // ^file:dirname[/a/some.tar.gz]=/a // ^file:dirname[/a/b/]=/a add_native_method("dirname", Method::CT_STATIC, _dirname, 1, 1); // ^file:basename[/a/some.tar.gz]=some.tar.gz add_native_method("basename", Method::CT_STATIC, _basename, 1, 1); // ^file:justname[/a/some.tar.gz]=some.tar add_native_method("justname", Method::CT_STATIC, _justname, 1, 1); // ^file:justext[/a/some.tar.gz]=gz add_native_method("justext", Method::CT_STATIC, _justext, 1, 1); // /some/page.html: ^file:fullpath[a.gif] => /some/a.gif add_native_method("fullpath", Method::CT_STATIC, _fullpath, 1, 1); // ^file.sql-string[] add_native_method("sql-string", Method::CT_DYNAMIC, _sql_string, 0, 0); // ^file::sql{} // ^file::sql{}[options hash] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // encode: // ^file.base64[] // ^file:base64[file-name] // decode: // ^file::base64[encoded] // backward // ^file::base64[mode;user-file-name;encoded] // ^file::base64[mode;user-file-name;encoded;$.content-type[...]] add_native_method("base64", Method::CT_ANY, _base64, 0, 4); // ^file.crc32[] // ^file:crc32[file-name] add_native_method("crc32", Method::CT_ANY, _crc32, 0, 1); // ^file.md5[] // ^file:md5[file-name] add_native_method("md5", Method::CT_ANY, _md5, 0, 1); // ^file:copy[from-file-name;to-file-name] add_native_method("copy", Method::CT_STATIC, _copy, 2, 2); } parser-3.4.3/src/classes/classes.h000644 000000 000000 00000003543 11730603266 017157 0ustar00rootwheel000000 000000 /** @file Parser: @b Methoded class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef CLASSES_H #define CLASSES_H #define IDENT_CLASSES_H "$Id: classes.h,v 1.34 2012/03/16 09:24:06 moko Exp $" // include #include "pa_vstateless_class.h" #include "pa_array.h" /** Pure virtual base for configurable Methoded descendants @see Methoded_array */ class Methoded: public VStateless_class { public: // Methoded /** should Methoded_array::register_directly_used register this class in Request::classes() or not. if not - global variable with Methoded descendant is used in VStateless_class parameter */ virtual bool used_directly() { return true; } /// use this method to read parameters from root "auto.p"; access r.main_class virtual void configure_admin(Request& ) {} /// use this method to read parameters from 'MAIN' class; access r.main_class virtual void configure_user(Request& ) {} /// use it to construct static variables. check some static so that would be only ONCE! virtual void construct_statics() {} public: // usage Methoded(const char* aname, VStateless_class* abase=0): VStateless_class(new String(aname), abase) { } void register_directly_used(Request& r); }; /// all Methoded registered here in autogenerated classes.C class Methoded_array: public Array { public: Methoded_array(); public: // Methoded for_each-es /// @see Methoded::configure_admin void configure_admin(Request& r); /// @see Methoded::configure_user void configure_user(Request& r); /// @see Methoded::register_directly_used void register_directly_used(Request& r); }; // globals Methoded_array& methoded_array(); // defines #define DECLARE_CLASS_VAR(name, self, base) \ Methoded* name##_class=self; \ Methoded* name##_base_class=base #endif parser-3.4.3/src/classes/mail.C000644 000000 000000 00000014101 12176224577 016400 0ustar00rootwheel000000 000000 /** @file Parser: @b mail parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_exec.h" #include "pa_charsets.h" #include "pa_charset.h" #include "pa_uue.h" #include "pa_vmail.h" #include "smtp.h" volatile const char * IDENT_MAIL_C="$Id: mail.C,v 1.121 2013/07/31 15:13:03 moko Exp $"; // defines #define MAIL_CLASS_NAME "mail" #define SENDMAIL_NAME "sendmail" // consts const int ATTACHMENT_WEIGHT=100; // class class MMail: public Methoded { public: // Methoded bool used_directly() { return false; } void configure_user(Request& r); public: MMail(); }; // global variable DECLARE_CLASS_VAR(mail, 0/*fictive*/, new MMail); // defines for statics #define MAIL_NAME "MAIL" // statics static const String mail_name(MAIL_NAME); static const String mail_sendmail_name(SENDMAIL_NAME); // helpers static void sendmail( Value* #ifndef WIN32 vmail_conf #endif , Value* smtp_server_port, const String& message, const String* from, const String* to, const String* #ifndef WIN32 options #endif ) { const char* exception_type="email.format"; if(!from) // we use in sendmail -f {from} && SMTP MAIL from: {from} throw Exception(exception_type, 0, "parameter does not specify 'from' header field"); const char* message_cstr=message.untaint_cstr(String::L_AS_IS); if(smtp_server_port) { if(!to) // we use only in SMTP RCPT to: {to} throw Exception(exception_type, 0, "parameter does not specify 'to' header field"); SMTP smtp; char* server=smtp_server_port->as_string().cstrm(); const char* port=rsplit(server, ':'); if(!port) port="25"; smtp.Send(server, port, message_cstr, from->cstrm(), to->cstrm()); return; } #ifdef WIN32 // win32 without SMTP server configured throw Exception(PARSER_RUNTIME, 0, "$"MAIN_CLASS_NAME":"MAIL_NAME".SMTP not defined"); #else // unix // $MAIN:MAIL.sendmail["/usr/sbin/sendmail -t -i -f postmaster"] default // $MAIN:MAIL.sendmail["/usr/lib/sendmail -t -i -f postmaster"] default String* sendmail_command=new String; if(vmail_conf) { #ifdef PA_FORCED_SENDMAIL throw Exception(PARSER_RUNTIME, 0, "Parser was configured with --with-sendmail="PA_FORCED_SENDMAIL " key, to change sendmail you should reconfigure and recompie it"); #else if(Value* sendmail_value=vmail_conf->get_hash()->get(mail_sendmail_name)) *sendmail_command<as_string(); else throw Exception(PARSER_RUNTIME, 0, "$"MAIN_CLASS_NAME":"MAIL_NAME"."SENDMAIL_NAME" not defined"); #endif } else { #ifdef PA_FORCED_SENDMAIL *sendmail_command<pos("postmaster"); if(at_postmaster!=STRING_NOT_FOUND) { String& reconstructed=sendmail_command->mid(0, at_postmaster); reconstructed << *from; reconstructed << sendmail_command->mid(at_postmaster+10/*postmaster*/, sendmail_command->length()); sendmail_command=&reconstructed; } // execute it ArrayString argv; const String* file_spec; size_t after_file_spec=sendmail_command->pos(' '); if(after_file_spec==STRING_NOT_FOUND || after_file_spec==0) file_spec=sendmail_command; else { size_t pos_after=after_file_spec; file_spec=&sendmail_command->mid(0, pos_after++); sendmail_command->split(argv, pos_after, " ", String::L_AS_IS); } if(!file_executable(*file_spec)) throw Exception("email.send", file_spec, "is not executable." #ifdef PA_FORCED_SENDMAIL " Use configure key \"--with-sendmail=appropriate sendmail command\"" #else " Set $"MAIN_CLASS_NAME":"MAIL_NAME"."SENDMAIL_NAME" to appropriate sendmail command" #endif ); String in(message_cstr); PA_exec_result exec=pa_exec( // forced_allow #ifdef PA_FORCED_SENDMAIL true #else false #endif , *file_spec, 0 /* pass env */, argv, in); if(exec.status || exec.err.length()) throw Exception("email.send", 0, "'%s' reported problem: %s (%d)", file_spec->cstr(), exec.err.length()?exec.err.cstr():"UNKNOWN", exec.status); #endif //WIN32 } // methods static void _send(Request& r, MethodParams& params) { HashStringValue* hash=params.as_hash(0, "message"); if(!hash || !hash->count()) return; // todo@ check if enough options are specified. // now ^mail:send[^hash::create[]] and ^mail:send[$.print-debug(1)] "work". const String* soptions=0; if(Value* voptions=hash->get(MAIL_OPTIONS_NAME)) soptions=&voptions->as_string(); bool print_debug=false; if(Value* vdebug=hash->get(MAIL_DEBUG_NAME)) print_debug=vdebug->as_bool(); Value* vmail_conf=static_cast(r.classes_conf.get(mail_base_class->name())); Value* smtp_server_port=0; if(vmail_conf) { // $MAIN:MAIL.SMTP[mail.yourdomain.ru[:port]] smtp_server_port=vmail_conf->get_hash()->get(String::Body("SMTP")); } const String* from=0; String* to=0; const String& message= GET_SELF(r, VMail).message_hash_to_string(r, hash, 0, from, smtp_server_port?true:false /*send by SMTP=strip to?*/, to); if(print_debug) r.write_pass_lang(message); else sendmail(vmail_conf, smtp_server_port, message, from, to, soptions); } // constructor & configurator MMail::MMail(): Methoded(MAIL_CLASS_NAME) { // ^mail:send{hash} add_native_method("send", Method::CT_STATIC, _send, 1, 1); } void MMail::configure_user(Request& r) { // $MAIN:MAIL[$SMTP[mail.design.ru]] if(Value* mail_element=r.main_class.get_element(mail_name)) if(mail_element->get_hash()) r.classes_conf.put(name(), mail_element); else if( !mail_element->is_string() ) throw Exception(PARSER_RUNTIME, 0, "$" MAIL_CLASS_NAME ":" MAIL_NAME " is not hash"); } parser-3.4.3/src/classes/op.C000644 000000 000000 00000070030 12230062002 016045 0ustar00rootwheel000000 000000 /** @file Parser: parser @b operators. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_os.h" #include "pa_request.h" #include "pa_vint.h" #include "pa_sql_connection.h" #include "pa_vdate.h" #include "pa_vmethod_frame.h" #include "pa_vclass.h" #include "pa_charset.h" volatile const char * IDENT_OP_C="$Id: op.C,v 1.218 2013/10/17 22:26:10 moko Exp $"; // limits #define MAX_LOOPS 20000 // defines #define CASE_DEFAULT_VALUE "DEFAULT" // class class VClassMAIN: public VClass { public: VClassMAIN(); }; // defines for statics #define SWITCH_DATA_NAME "SWITCH-DATA" #define CACHE_DATA_NAME "CACHE-DATA" #define EXCEPTION_VAR_NAME "exception" // statics //^switch ^case static const String switch_data_name(SWITCH_DATA_NAME); //^cache static const String cache_data_name(CACHE_DATA_NAME); static const String exception_var_name(EXCEPTION_VAR_NAME); // local defines #define CACHE_EXCEPTION_HANDLED_CACHE_NAME "cache" // helpers class Untaint_lang_name2enum: public HashString { public: Untaint_lang_name2enum() { #define ULN(name, LANG) \ put(String::Body(name), (value_type)(String::L_##LANG)); ULN("clean", CLEAN); ULN("as-is", AS_IS); ULN("optimized-as-is", AS_IS|String::L_OPTIMIZE_BIT); ULN("file-spec", FILE_SPEC); ULN("http-header", HTTP_HEADER); ULN("mail-header", MAIL_HEADER); ULN("uri", URI); ULN("sql", SQL); ULN("js", JS); ULN("xml", XML); ULN("optimized-xml", XML|String::L_OPTIMIZE_BIT); ULN("html", HTML); ULN("optimized-html", HTML|String::L_OPTIMIZE_BIT); ULN("regex", REGEX); ULN("parser-code", PARSER_CODE); ULN("json", JSON); #undef ULN } } untaint_lang_name2enum; // methods static void _if(Request& r, MethodParams& params) { size_t max_param=params.count()-1; size_t i=0; do { bool condition=params.as_bool(i, "condition must be expression", r); if(condition) { r.process_write(*params.get(i+1)); return; } i+=2; } while (i < max_param); if(i == max_param) r.process_write(*params.get(i)); } String::Language get_untaint_lang(const String& lang_name){ String::Language lang=untaint_lang_name2enum.get(lang_name); if(!lang) throw Exception(PARSER_RUNTIME, &lang_name, "invalid taint language"); return lang; } static void _untaint(Request& r, MethodParams& params) { String::Language lang; if(params.count()==1) lang=String::L_AS_IS; // mark as simply 'as-is'. useful in html from sql else lang=get_untaint_lang(params.as_string(0, "lang must be string")); { Value& vbody=params.as_junction(params.count()-1, "body must be code"); Temp_lang temp_lang(r, lang); // set temporarily specified ^untaint[language; StringOrValue result=r.process(vbody); // process marking tainted with that lang r.write_assign_lang(result); } } static void _taint(Request& r, MethodParams& params) { String::Language lang; if(params.count()==1) lang=String::L_TAINTED; // mark as simply 'tainted'. useful in table:create else lang=get_untaint_lang(params.as_string(0, "lang must be string")); { Value& vbody=params.as_no_junction(params.count()-1, "body must not be code"); String result(vbody.as_string(), lang); // force result language to specified r.write_assign_lang(result); } } static void _apply_taint(Request& r, MethodParams& params) { String::Language lang=params.count()==1 ? String::L_AS_IS : get_untaint_lang(params.as_string(0, "lang must be string")); const String &sbody=params.as_string(params.count()-1, "body must be string"); String::Body result_body=sbody.cstr_to_string_body_untaint(lang, r.connection(false), &r.charsets); r.write_pass_lang(*new String(result_body, String::L_AS_IS)); } static void _process(Request& r, MethodParams& params) { Method* main_method; size_t index=0; Value* target_self; Value& maybe_target_self=params[index]; if(maybe_target_self.get_string() || maybe_target_self.get_junction()) target_self=&r.get_method_frame()->caller()->self(); else { target_self=&maybe_target_self; index++; } { VStateless_class *target_class=target_self->get_class(); if(!target_class) throw Exception(PARSER_RUNTIME, 0, "no target class"); // temporary remove language change Temp_lang temp_lang(r, String::L_PARSER_CODE); // temporary zero @main so to maybe-replace it in processed code Temp_method temp_method_main(*target_class, main_method_name, 0); // temporary zero @auto so it wouldn't be auto-called in Request::use_buf Temp_method temp_method_auto(*target_class, auto_method_name, 0); const String* main_alias=0; const String* file_alias=0; int line_no_alias_offset=0; bool allow_class_replace=false; size_t options_index=index+1; if(options_indexas_string(); } else if(key == "file") { valid_options++; file_alias=&value->as_string(); } else if(key == "lineno") { valid_options++; line_no_alias_offset=value->as_int(); } else if(key == "replace") { valid_options++; allow_class_replace=r.process_to_value(*value).as_bool(); } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } uint processe_file_no=file_alias? r.register_file(r.absolute(*file_alias)) : pseudo_file_no__process; // process...{string} Value& vjunction=params.as_junction(index, "body must be code"); // evaluate source to process const String& source=r.process_to_string(vjunction); Temp_class_replace class_replace(r, allow_class_replace); r.use_buf(*target_class, source.untaint_cstr(String::L_AS_IS, r.connection(false)), main_alias, processe_file_no, line_no_alias_offset); // main_method main_method=target_class->get_method(main_method_name); } // after restoring current-request-lang // maybe-execute @main[] if(main_method) { VMethodFrame frame(*main_method, r.get_method_frame()->caller(), *target_self); frame.empty_params(); r.op_call(frame); r.write_pass_lang(frame.result()); } } static void _rem(Request&, MethodParams& params) { params.as_junction(0, "body must be code"); } static void _while(Request& r, MethodParams& params) { InCycle temp(r); Value& vcondition=params.as_expression(0, "condition must be number, bool or expression"); Value& body_code=params.as_junction(1, "body must be code"); Value* delim_maybe_code=params.count()>2?¶ms[2]:0; // while... int endless_loop_count=0; if(delim_maybe_code){ // delimiter set bool need_delim=false; while(true) { if(++endless_loop_count>=MAX_LOOPS) // endless loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); if(!r.process_to_value(vcondition, false/*don't intercept string*/).as_bool()) break; StringOrValue sv_processed=r.process(body_code); Request::Skip lskip=r.get_skip(); r.set_skip(Request::SKIP_NOTHING); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write_pass_lang(r.process(*delim_maybe_code)); else need_delim=true; } r.write_pass_lang(sv_processed); if(lskip==Request::SKIP_BREAK) break; } } else { while(true) { if(++endless_loop_count>=MAX_LOOPS) // endless loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); if(!r.process_to_value(vcondition, false/*don't intercept string*/).as_bool()) break; r.process_write(body_code); Request::Skip lskip=r.get_skip(); r.set_skip(Request::SKIP_NOTHING); if(lskip==Request::SKIP_BREAK) break; } } } static void _use(Request& r, MethodParams& params) { Value& vfile=params.as_no_junction(0, FILE_NAME_MUST_NOT_BE_CODE); bool allow_class_replace=false; if(params.count()==2) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "replace") { valid_options++; allow_class_replace=r.process_to_value(*value).as_bool(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } } Temp_class_replace class_replace(r, allow_class_replace); // _use could be called from the parser3 method only, so caller is always defined r.use_file(r.main_class, vfile.as_string(), r.get_method_filename(&r.get_method_frame()->caller()->method)); } static void set_skip(Request& r, Request::Skip askip) { if(!r.get_in_cycle()) throw Exception(askip==Request::SKIP_BREAK?"parser.break":"parser.continue", 0, "without cycle"); r.set_skip(askip); } static void _break(Request& r, MethodParams&) { set_skip(r, Request::SKIP_BREAK); } static void _continue(Request& r, MethodParams&) { set_skip(r, Request::SKIP_CONTINUE); } static void _for(Request& r, MethodParams& params) { InCycle temp(r); const String& var_name=params.as_string(0, "var name must be string"); int from=params.as_int(1, "from must be int", r); int to=params.as_int(2, "to must be int", r); Value& body_code=params.as_junction(3, "body must be code"); Value* delim_maybe_code=params.count()>4?¶ms[4]:0; if(to-from>=MAX_LOOPS) // too long loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); VInt* vint=new VInt(0); VMethodFrame& caller=*r.get_method_frame()->caller(); r.put_element(caller, var_name, vint); if(delim_maybe_code){ // delimiter set bool need_delim=false; for(int i=from; i<=to; i++) { vint->set_int(i); StringOrValue sv_processed=r.process(body_code); Request::Skip lskip=r.get_skip(); r.set_skip(Request::SKIP_NOTHING); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write_pass_lang(r.process(*delim_maybe_code)); else need_delim=true; } r.write_pass_lang(sv_processed); if(lskip==Request::SKIP_BREAK) break; } } else { for(int i=from; i<=to; i++) { vint->set_int(i); r.process_write(body_code); Request::Skip lskip=r.get_skip(); r.set_skip(Request::SKIP_NOTHING); if(lskip==Request::SKIP_BREAK) break; } } } static void _eval(Request& r, MethodParams& params) { Value& expr=params.as_junction(0, "need expression"); // evaluate expresion Value& value_result=r.process_to_value(expr, false/*don't intercept string*/).as_expr_result(); if(params.count()>1) { const String& fmt=params.as_string(1, "fmt must be string").trim(); if(fmt.is_empty()){ r.write_no_lang(value_result); } else { r.write_no_lang(String(format(value_result.as_double(), fmt.cstrm()))); } } else r.write_no_lang(value_result); } static void _connect(Request& r, MethodParams& params) { Value& url=params.as_no_junction(0, "url must not be code"); Value& body_code=params.as_junction(1, "body must be code"); Table* protocol2driver_and_client=0; if(Value* sql=r.main_class.get_element(String(MAIN_SQL_NAME))) { if(Value* element=sql->get_element(String(MAIN_SQL_DRIVERS_NAME))) { protocol2driver_and_client=element->get_table(); } } // connect SQL_Connection* connection=SQL_driver_manager->get_connection(url.as_string(), protocol2driver_and_client, r.charsets.source().NAME().cstr(), r.request_info.document_root); Temp_connection temp_connection(r, connection); // execute body try { r.process_write(body_code); connection->commit(); connection->close(); } catch(...) { // process problem connection->rollback(); connection->close(); rethrow; } } #ifndef DOXYGEN class Switch_data: public PA_Object { public: Request& r; const String* searching_string; double searching_double; bool searching_bool; Value* found; Value* _default; public: Switch_data(Request& ar, Value& asearching): r(ar) { if(asearching.is_string() || asearching.is_void()){ searching_string=&asearching.as_string(); searching_double=0; searching_bool=false; } else { searching_string=0; searching_double=asearching.as_double(); searching_bool=asearching.is_bool(); } } }; #endif static void _switch(Request& r, MethodParams& params) { Switch_data* data=new Switch_data(r, r.process_to_value(params[0])); Temp_hash_value, void*> switch_data_setter(&r.classes_conf, switch_data_name, data); Value& cases_code=params.as_junction(1, "switch cases must be code"); // execution of found ^case[...]{code} must be in context of ^switch[...]{code} // because of stacked WWrapper used there as wcontext r.process(cases_code, true/*intercept_string*/); if(Value* selected_code=data->found? data->found: data->_default) r.write_pass_lang(r.process(*selected_code)); } static void _case(Request& r, MethodParams& params) { Switch_data* data=static_cast(r.classes_conf.get(switch_data_name)); if(!data) throw Exception(PARSER_RUNTIME, 0, "without switch"); if(data->found) // matches already was found return; int count=params.count(); Value* code=¶ms.as_expression(--count, "case result must be code"); #ifdef USE_DESTRUCTORS Junction *j=code->get_junction(); if (j){ code=new VJunction(j->self,j->method,j->method_frame,j->rcontext,j->wcontext,j->code); if (j->wcontext) j->wcontext->attach_junction((VJunction *)code); } #endif for(int i=0; i_default=code; continue; } bool matches; if(data->searching_string) matches=(*data->searching_string) == value.as_string(); else if(data->searching_bool || value.is_bool()) matches=(data->searching_double != 0) == value.as_bool(); else matches=data->searching_double == value.as_double(); if(matches){ data->found=code; break; } } } #ifndef DOXYGEN struct Try_catch_result { StringOrValue processed_code; const String* exception_should_be_handled; Try_catch_result(): exception_should_be_handled(0) {} }; #endif /// used by ^try and ^cache, @returns $exception.handled[string] if any template static Try_catch_result try_catch(Request& r, StringOrValue body_code(Request&, I), I info, Value* catch_code, bool could_be_handled_by_caller=false) { Try_catch_result result; if(!catch_code) { result.processed_code=body_code(r, info); return result; } // taking snapshot of try-context Request_context_saver try_context(r); try { result.processed_code=body_code(r, info); } catch(const Exception& e) { Request_context_saver throw_context(r); // taking snapshot of throw-context [stack trace contains error] Request::Exception_details details=r.get_details(e); try_context.restore(); // restoring try-context to perform catch-code Junction* junction=catch_code->get_junction(); Value* method_frame=junction->method_frame; Value* saved_exception_var_value=method_frame->get_element(exception_var_name); VMethodFrame& frame=*junction->method_frame; frame.put_element(exception_var_name, &details.vhash); result.processed_code=r.process(*catch_code); // retriving $exception.handled, restoring $exception var Value* vhandled=details.vhash.hash().get(exception_handled_part_name); frame.put_element(exception_var_name, saved_exception_var_value); bool bhandled=false; if(vhandled) { if(vhandled->is_string()) { // not simple $exception.handled(1/0)? if(could_be_handled_by_caller) { // and we can possibly handle it result.exception_should_be_handled=vhandled->get_string(); // considering 'recovered' and let the caller recover return result; } bhandled=false; } else bhandled=vhandled->as_bool(); } if(!bhandled) { throw_context.restore(); // restoring throw-context [exception were not handled] rethrow; } } return result; } // cache-- // consts const int DATA_STRING_SERIALIZED_VERSION=0x0006; // helper types #ifndef DOXYGEN struct Data_string_serialized_prolog { int version; time_t expires; }; #endif void cache_delete(const String& file_spec) { file_delete(file_spec, false/*fail_on_problem*/); } #ifndef DOXYGEN struct Cache_scope { public: time_t expires; const String* body_from_disk; }; struct Locked_process_and_cache_put_action_info { Request *r; Cache_scope *scope; Value* body_code; Value* catch_code; const String* processed_code; }; #endif static StringOrValue process_cache_body_code(Request& r, Value* body_code) { return StringOrValue(r.process_to_string(*body_code)); } /* @todo maybe network order worth spending some effort? don't bothering myself with network byte order, am not planning to be able to move resulting file across platforms */ static void locked_process_and_cache_put_action(int f, void *context) { Locked_process_and_cache_put_action_info& info= *static_cast(context); const String* body_from_disk=info.scope->body_from_disk; // body->process Try_catch_result result=try_catch(*info.r, process_cache_body_code, info.body_code, info.catch_code, body_from_disk!=0 /*we have something old=we can handle=recover later*/); if(result.exception_should_be_handled) { if(*result.exception_should_be_handled==CACHE_EXCEPTION_HANDLED_CACHE_NAME) { assert(body_from_disk); info.processed_code=body_from_disk; } else throw Exception(PARSER_RUNTIME, result.exception_should_be_handled, "$"EXCEPTION_VAR_NAME"."EXCEPTION_HANDLED_PART_NAME" value must be " "either boolean or string '"CACHE_EXCEPTION_HANDLED_CACHE_NAME"'"); } else info.processed_code=&result.processed_code.as_string(); // expiration time not spoiled by ^cache(0) or something? if(info.scope->expires > time(0)) { // string -serialize> buffer String::Cm serialized=info.processed_code->serialize( sizeof(Data_string_serialized_prolog)); Data_string_serialized_prolog& prolog= *reinterpret_cast(serialized.str); prolog.version=DATA_STRING_SERIALIZED_VERSION; prolog.expires=info.scope->expires; // buffer -write> file write(f, serialized.str, serialized.length); } else // expired! info.scope->expires=0; // flag it so that could be easily checked by caller } const String* locked_process_and_cache_put(Request& r, Value& body_code, Value* catch_code, Cache_scope& scope, const String& file_spec) { Locked_process_and_cache_put_action_info info={&r, &scope, &body_code, catch_code, 0}; const String* result=file_write_action_under_lock( file_spec, "cache_put", locked_process_and_cache_put_action, &info, false/*as_text*/, false/*do_append*/, false/*block == don't wait till other thread release lock*/, false/*dun throw exception if lock failed*/) ? info.processed_code: 0; time_t now=time(0); if(scope.expires<=now) cache_delete(file_spec); return result; } #ifndef DOXYGEN struct Cache_get_result { const String* body; bool expired; }; #endif static Cache_get_result cache_get(Request_charsets& charsets, const String& file_spec, time_t now) { Cache_get_result result={0, false}; File_read_result file=file_read(charsets, file_spec, false/*as_text*/, 0, //no params false/*fail_on_read_problem*/); if(file.success && file.length/* ignore reads which are empty due to non-unary open+lockEX conflict with lockSH */) { Data_string_serialized_prolog& prolog= *reinterpret_cast(file.str); String* body=new String; if( file.length>=sizeof(Data_string_serialized_prolog) && prolog.version==DATA_STRING_SERIALIZED_VERSION) { if(body->deserialize(sizeof(Data_string_serialized_prolog), file.str, file.length)) { result.body=body; result.expired=prolog.expires <= now; } } } return result; } static time_t as_expires(Request& r, MethodParams& params, int index, time_t now) { time_t result; if(Value* vdate=params[index].as(VDATE_TYPE)) result=static_cast(vdate)->get_time(); else result=now+(time_t)params.as_double(index, "lifespan must be date or number", r); return result; } static const String& as_file_spec(Request& r, MethodParams& params, int index) { return r.absolute(params.as_string(index, "filespec must be string")); } static void _cache(Request& r, MethodParams& params) { if(params.count()==0) { // ^cache[] -- return current expiration time Cache_scope* scope=static_cast(r.classes_conf.get(cache_data_name)); if(!scope) throw Exception(PARSER_RUNTIME, 0, "expire-time get without cache"); r.write_no_lang(*new VDate(scope->expires)); return; } time_t now=time(0); if(params.count()==1) { // ^cache[filename] ^cache(seconds) ^cache[expires date] if(params[0].is_string()) { // filename? cache_delete(as_file_spec(r, params, 0)); return; } // secods|expires date Cache_scope* scope=static_cast(r.classes_conf.get(cache_data_name)); if(!scope) throw Exception(PARSER_RUNTIME, 0, "expire-time reducing instruction without cache"); time_t expires=as_expires(r, params, 0, now); if(expires < scope->expires) scope->expires=expires; return; } else if(params.count()<3) throw Exception(PARSER_RUNTIME, 0, "invalid number of parameters"); // file_spec, expires, body code const String& file_spec=as_file_spec(r, params, 0); Cache_scope scope={as_expires(r, params, 1, now), 0}; Temp_hash_value, void*> cache_scope_setter(&r.classes_conf, cache_data_name, &scope); Value& body_code=params.as_junction(2, "body_code must be code"); Value* catch_code=0; if(params.count()>3) catch_code=¶ms.as_junction(3, "catch_code must be code"); if(scope.expires>now) { Cache_get_result cached=cache_get(r.charsets, file_spec, now); if(cached.body) { // have cached copy if(cached.expired) { scope.body_from_disk=cached.body; // storing for user to retrive it with ^cache[] } else { // and it's not expired yet write it out r.write_assign_lang(*cached.body); // happy with it return; } } // no cached info or it's already expired // trying to process it under lock and store result in file const String* processed_body=locked_process_and_cache_put(r, body_code, catch_code, scope, file_spec); if(processed_body){ // write it out r.write_assign_lang(*processed_body); // happy with it return; } else { // we fail while get exclusive lock. nvm, we just execute body_code a bit later } } else { // instructed not to cache; forget cached copy cache_delete(file_spec); } // process without cacheing const String& processed_body=r.process_to_string(body_code); // write it out r.write_assign_lang(processed_body); } static StringOrValue process_try_body_code(Request& r, Value* body_code) { return r.process(*body_code); } static void _try_operator(Request& r, MethodParams& params) { Value& body_code=params.as_junction(0, "body_code must be code"); Value& catch_code=params.as_junction(1, "catch_code must be code"); Value* finally_code=(params.count()==3) ? ¶ms.as_junction(2, "finally_code must be code") : 0; Try_catch_result result; StringOrValue finally_result; try{ result=try_catch(r, process_try_body_code, &body_code, &catch_code); if(result.exception_should_be_handled) throw Exception(PARSER_RUNTIME, result.exception_should_be_handled, "catch block must set $exception.handled to some boolean value, not string"); } catch(...){ if(finally_code) finally_result=r.process(*finally_code); rethrow; } if(finally_code) finally_result=r.process(*finally_code); // write out processed body_code or catch_code r.write_pass_lang(result.processed_code); // write out processed finally code if(finally_code) r.write_pass_lang(finally_result); } static void _throw_operator(Request&, MethodParams& params) { if(params.count()==1 && !params[0].is_string()) { if(HashStringValue *hash=params[0].get_hash()) { const char* type=0; if(Value* value=hash->get(exception_type_part_name)) type=value->as_string().cstr(); const String* source=0; if(Value* value=hash->get(exception_source_part_name)) source=&value->as_string(); const char* comment=0; if(Value* value=hash->get(exception_comment_part_name)) comment=value->as_string().cstr(); throw Exception(type, source?source:0, "%s", comment?comment:""); } else throw Exception(PARSER_RUNTIME, 0, "one-param version has hash or string param"); } else { const char* type=params.as_string(0, "type must be string").cstr(); const String* source=params.count()>1? ¶ms.as_string(1, "source must be string"):0; const char* comment=params.count()>2? params.as_string(2, "comment must be string").cstr():0; throw Exception(type, source, "%s", comment?comment:""); } } static void _sleep_operator(Request& r, MethodParams& params) { double seconds=params.as_double(0, "seconds must be double", r); if(seconds>0) pa_sleep((int)trunc(seconds), (int)trunc((seconds-trunc(seconds))*1000000)); } #if defined(WIN32) && defined(_DEBUG) # define PA_BPT static void _bpt(Request&, MethodParams&) { _asm int 3; } #endif // constructor VClassMAIN::VClassMAIN(): VClass() { set_name(*new String(MAIN_CLASS_NAME)); #ifdef PA_BPT // ^bpt[] add_native_method("bpt", Method::CT_ANY, _bpt, 0, 0); #endif // ^if(condition){code-when-true} // ^if(condition){code-when-true}{code-when-false} // ^if(condition){code-when-true} (another condition){code-when-true} ... {code-when-false} add_native_method("if", Method::CT_ANY, _if, 2, 10000, Method::CO_WITHOUT_FRAME); // ^untaint[as-is|uri|sql|js|html|html-typo|regex|parser-code]{code} add_native_method("untaint", Method::CT_ANY, _untaint, 1, 2, Method::CO_WITHOUT_FRAME); // ^taint[as-is|uri|sql|js|html|html-typo|regex|parser-code]{code} add_native_method("taint", Method::CT_ANY, _taint, 1, 2, Method::CO_WITHOUT_FRAME); // ^apply-taint[untaint lang][string] add_native_method("apply-taint", Method::CT_ANY, _apply_taint, 1, 2, Method::CO_WITHOUT_FRAME); // ^process{code} // ^process[context]{code}[options hash] add_native_method("process", Method::CT_ANY, _process, 1, 3); // ^rem{code} add_native_method("rem", Method::CT_ANY, _rem, 1, 10000, Method::CO_WITHOUT_FRAME); // ^while(condition){code} add_native_method("while", Method::CT_ANY, _while, 2, 3, Method::CO_WITHOUT_FRAME); // ^use[file[;options hash]] add_native_method("use", Method::CT_ANY, _use, 1, 2); // ^break[] add_native_method("break", Method::CT_ANY, _break, 0, 0, Method::CO_WITHOUT_FRAME); // ^continue[] add_native_method("continue", Method::CT_ANY, _continue, 0, 0, Method::CO_WITHOUT_FRAME); // ^for[i](from-number;to-number-inclusive){code}[delim] add_native_method("for", Method::CT_ANY, _for, 3+1, 3+1+1, Method::CO_WITHOUT_WCONTEXT); // ^eval(expr) // ^eval(expr)[format] add_native_method("eval", Method::CT_ANY, _eval, 1, 2, Method::CO_WITHOUT_FRAME); // ^connect[protocol://user:pass@host[:port]/database]{code with ^sql-s} add_native_method("connect", Method::CT_ANY, _connect, 2, 2); // ^cache[file_spec](time){code}[{catch code}] time=0 no cache // ^cache[file_spec] delete cache // ^cache[] get current expiration time add_native_method("cache", Method::CT_ANY, _cache, 0, 4); // switch // ^switch[value]{cases} add_native_method("switch", Method::CT_ANY, _switch, 2, 2, Method::CO_WITHOUT_FRAME); // ^case[value]{code} add_native_method("case", Method::CT_ANY, _case, 2, 10000, Method::CO_WITHOUT_FRAME); // try-catch // ^try{code}{catch code} add_native_method("try", Method::CT_ANY, _try_operator, 2, 3, Method::CO_WITHOUT_FRAME); // ^throw[$exception hash] // ^throw[type;source;comment] add_native_method("throw", Method::CT_ANY, _throw_operator, 1, 3); add_native_method("sleep", Method::CT_ANY, _sleep_operator, 1, 1); } // constructor & configurator VStateless_class& VClassMAIN_create() { return *new VClassMAIN; } parser-3.4.3/src/classes/reflection.C000644 000000 000000 00000026757 12120240242 017604 0ustar00rootwheel000000 000000 /** @file Parser: @b reflection parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vbool.h" volatile const char * IDENT_REFLECTION_C="$Id: reflection.C,v 1.29 2013/03/14 03:14:42 misha Exp $"; static const String class_type_methoded("methoded"); static const String method_type_native("native"); static const String method_type_parser("parser"); static const String method_call_type("call_type"); static const String method_inherited("inherited"); static const String method_overridden("overridden"); static const String method_call_type_static("static"); static const String method_call_type_dynamic("dynamic"); static const String method_min_params("min_params"); static const String method_max_params("max_params"); static const String method_extra_param("extra_param"); // class class MReflection: public Methoded { public: MReflection(); }; // global variable DECLARE_CLASS_VAR(reflection, new MReflection, 0); // methods static void _create(Request& r, MethodParams& params) { const String& class_name=params.as_string(0, "class_name must be string"); Value* class_value=r.get_class(class_name); if(!class_value) throw Exception(PARSER_RUNTIME, &class_name, "class is undefined"); const String& constructor_name=params.as_string(1, "constructor_name must be string"); Value* constructor_value=class_value->get_element(constructor_name); if(!constructor_value || !constructor_value->get_junction()) throw Exception(PARSER_RUNTIME, &constructor_name, "constructor must be declared in class '%s'", class_value->get_class()->name_cstr()); Junction* junction=constructor_value->get_junction(); const Method* method=junction->method; int nparams=params.count()-2; int max_params_count; if(method->native_code){ if(method->call_type==Method::CT_STATIC) throw Exception(PARSER_RUNTIME, &constructor_name, "native method of class '%s' (%s) is not allowed to be called dynamically", class_value->get_class()->name_cstr(), class_value->type()); if(nparamsmin_numbered_params_count) throw Exception(PARSER_RUNTIME, &constructor_name, "native method of class '%s' (%s) accepts minimum %d parameter(s) (%d passed)", class_value->get_class()->name_cstr(), class_value->type(), method->min_numbered_params_count, nparams); max_params_count=method->max_numbered_params_count; } else { max_params_count=method->params_names?method->params_names->count():0; } if(nparams>max_params_count) throw Exception(PARSER_RUNTIME, &constructor_name, "method of class '%s' (%s) accepts maximum %d parameter(s) (%d passed)", class_value->get_class()->name_cstr(), class_value->type(), max_params_count, nparams); Value &object = r.construct(*class_value, *method); VConstructorFrame frame(*method, r.get_method_frame(), object); Value* v[100]; if(nparams>0){ for(int i=0; iget_class()) v=new VString(class_type_methoded); else v=VVoid::get(); result->put(key, v); } static void _classes(Request& r, MethodParams&) { VHash& result=*new VHash; r.classes().for_each(store_vlass_info, result.get_hash()); r.write_no_lang(result); } static Value* get_class(Value* value){ if(VStateless_class* result=value->get_class()) return result; else // classes with fields only, like env & console return value; } static const String* get_class_name(Value* value){ if(VStateless_class* lclass=value->get_class()) return &lclass->name(); else // classes with fields only, like env & console return new String(value->type()); } static void _class(Request& r, MethodParams& params) { r.write_no_lang(*get_class(¶ms[0])); } static void _class_name(Request& r, MethodParams& params) { r.write_no_lang(*get_class_name(¶ms[0])); } static void _base(Request& r, MethodParams& params) { if(VStateless_class* lclass=params[0].get_class()) if(Value* base=lclass->base()){ r.write_no_lang(*get_class(base)); return; } // classes with fields only, like env & console or without base r.write_no_lang(*VVoid::get()); } static void _base_name(Request& r, MethodParams& params) { if(VStateless_class* lclass=params[0].get_class()) if(Value* base=lclass->base()) r.write_no_lang(*get_class_name(base)); } static void store_method_info( HashStringMethod::key_type key, HashStringMethod::value_type method, HashStringValue* result ) { result->put(key, new VString(method->native_code?method_type_native:method_type_parser)); } static void _methods(Request& r, MethodParams& params) { const String& class_name=params.as_string(0, "class_name must be string"); Value* class_value=r.get_class(class_name); if(!class_value) throw Exception(PARSER_RUNTIME, &class_name, "class is undefined"); VHash& result=*new VHash; if(VStateless_class* lclass=class_value->get_class()) { HashStringMethod methods=lclass->get_methods(); methods.for_each(store_method_info, result.get_hash()); } else { // class which does not have methods (env, console, etc) } r.write_no_lang(result); } static void _method(Request& r, MethodParams& params) { Value& o=params.as_no_junction(0, "first param must be object or class, not junction"); const String& name=params.as_string(1, "method name must be string"); if(VStateless_class* lclass=o.get_class()) { if(Method* method=lclass->get_method(name)) r.write_no_lang(*method->get_vjunction(o)); } else { // class which does not have methods (env, console, etc) } } static void _fields(Request& r, MethodParams& params) { Value& o=params.as_no_junction(0, "param must be object or class, not junction"); if(HashStringValue* fields=o.get_fields()) { VHash& result=*new VHash(*fields); r.write_no_lang(result); } else r.write_no_lang(*new VHash()); } static void _field(Request& r, MethodParams& params) { Value& o=params.as_no_junction(0, "first param must be object or class, not junction"); const String& name=params.as_string(1, "field name must be string"); if(HashStringValue* fields=o.get_fields()) if(Value* value=fields->get(name)) r.write_no_lang(*value); } static void _method_info(Request& r, MethodParams& params) { const String& class_name=params.as_string(0, "class_name must be string"); Value* class_value=r.get_class(class_name); if(!class_value) throw Exception(PARSER_RUNTIME, &class_name, "class is undefined"); VStateless_class* lclass=class_value->get_class(); if(!lclass) throw Exception(PARSER_RUNTIME, &class_name, "class does not have methods"); const String& method_name=params.as_string(1, "method_name must be string"); Method* method=lclass->get_method(method_name); if(!method) throw Exception(PARSER_RUNTIME, &method_name, "method not found in class %s", class_name.cstr()); VHash& result=*new VHash; HashStringValue* hash=result.get_hash(); VStateless_class* c=lclass; Method* base_method; if(c->base() && (base_method=c->base()->get_method(method_name))){ c=c->base()->get_class(); while(c->base() && base_method==c->base()->get_method(method_name)) c=c->base()->get_class(); hash->put((base_method==method) ? method_inherited : method_overridden, new VString(c->name())); } Value* call_type=0; switch(method->call_type){ case Method::CT_DYNAMIC: call_type=new VString(method_call_type_dynamic); break; case Method::CT_STATIC: call_type=new VString(method_call_type_static); break; } if(call_type) hash->put(method_call_type, call_type); if(method->native_code){ // native code hash->put(method_min_params, new VInt(method->min_numbered_params_count)); hash->put(method_max_params, new VInt(method->max_numbered_params_count)); } else { // parser code const String* filespec = r.get_method_filename(method); if( filespec ) hash->put("file", new VString(*filespec)); hash->put(method_max_params, new VInt(method->params_names ? method->params_names->count() : 0)); if(method->params_names) for(size_t i=0; iparams_names->count(); i++) hash->put(String::Body::Format(i), new VString(*method->params_names->get(i))); if(method->extra_params) hash->put(method_extra_param, new VString(*method->extra_params)); } r.write_no_lang(result); } static void _dynamical(Request& r, MethodParams& params) { if(params.count()){ r.write_no_lang(VBool::get(params[0].get_class() != ¶ms[0])); } else { VMethodFrame* caller=r.get_method_frame()->caller(); r.write_no_lang(VBool::get(caller && caller->get_class() != &caller->self())); } } static void _copy(Request& r, MethodParams& params) { HashStringValue* src=params.as_no_junction(0, "source must not be code").get_hash(); if(src==NULL) throw Exception(PARSER_RUNTIME, 0, "source must have hash representation"); Value& dst=params.as_no_junction(1, "destination must not be code"); for(HashStringValue::Iterator i(*src); i; i.next()) r.put_element(dst, *new String(i.key(), String::L_TAINTED), i.value()); } static void _uid(Request& r, MethodParams& params) { Value& obj=params.as_no_junction(0, "object must not be code"); char local_buf[MAX_NUMBER]; int size=snprintf(local_buf, sizeof(local_buf), "%p", &obj); r.write_pass_lang(*new String(pa_strdup(local_buf, (size_t)size), String::L_CLEAN, size)); } static void _delete(Request&, MethodParams& params) { const String& key=params.as_string(1, "field name must be string"); if(HashStringValue* fields=params[0].get_fields()){ fields->remove(key); } } // constructor MReflection::MReflection(): Methoded("reflection") { // ^reflection:create[class_name;constructor_name[;param1[;param2[;...]]]] add_native_method("create", Method::CT_STATIC, _create, 2, 102); // ^reflection:classes[] add_native_method("classes", Method::CT_STATIC, _classes, 0, 0); // ^reflection:class[object] add_native_method("class", Method::CT_STATIC, _class, 1, 1); // ^reflection:class_name[object] add_native_method("class_name", Method::CT_STATIC, _class_name, 1, 1); // ^reflection:base_class[object] add_native_method("base", Method::CT_STATIC, _base, 1, 1); // ^reflection:base_class_name[object] add_native_method("base_name", Method::CT_STATIC, _base_name, 1, 1); // ^reflection:methods[class_name] add_native_method("methods", Method::CT_STATIC, _methods, 1, 1); // ^reflection:method[object or class;method_name] add_native_method("method", Method::CT_STATIC, _method, 2, 2); // ^reflection:method_info[class_name;method_name] add_native_method("method_info", Method::CT_STATIC, _method_info, 2, 2); // ^reflection:fields[object or class] add_native_method("fields", Method::CT_STATIC, _fields, 1, 1); // ^reflection:field[object or class;field_name] add_native_method("field", Method::CT_STATIC, _field, 2, 2); // ^reflection:dynamical[[object or class, caller if absent]] add_native_method("dynamical", Method::CT_STATIC, _dynamical, 0, 1); // ^reflection:copy[src;dst] add_native_method("copy", Method::CT_STATIC, _copy, 2, 2); // ^reflection:uid[object or class] add_native_method("uid", Method::CT_STATIC, _uid, 1, 1); // ^reflection:delete[object or class;field_name] add_native_method("delete", Method::CT_STATIC, _delete, 2, 2); } parser-3.4.3/src/classes/regex.C000644 000000 000000 00000003045 11730603270 016557 0ustar00rootwheel000000 000000 /** @file Parser: @b int parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vint.h" #include "pa_vregex.h" volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.7 2012/03/16 09:24:08 moko Exp $"; // class class MRegex: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VRegex(); } public: MRegex(); }; // global variable DECLARE_CLASS_VAR(regex, new MRegex, 0); // methods static void _create(Request& r, MethodParams& params) { const String& pattern=params.as_string(0, "regexp must not be code"); VRegex& vregex=GET_SELF(r, VRegex); vregex.set(r.charsets.source(), &pattern, params.count()>1?¶ms.as_string(1, OPTIONS_MUST_NOT_BE_CODE):0); vregex.compile(); vregex.study(); } static void _size(Request& r, MethodParams&) { VRegex& vregex=GET_SELF(r, VRegex); r.write_no_lang(*new VInt(vregex.get_info_size())); } static void _study_size(Request& r, MethodParams&) { VRegex& vregex=GET_SELF(r, VRegex); r.write_no_lang(*new VInt(vregex.get_study_size())); } // constructor MRegex::MRegex(): Methoded("regex") { // ^regex::create[string[;options]] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 2); // ^regex.info_size[] add_native_method("size", Method::CT_DYNAMIC, _size, 0, 0); // ^regex.study_size[] add_native_method("study_size", Method::CT_DYNAMIC, _study_size, 0, 0); } parser-3.4.3/src/classes/math.C000644 000000 000000 00000042661 12207106461 016405 0ustar00rootwheel000000 000000 /** @file Parser: @b math parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) portions from gen_uuid.c, Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. */ #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_vint.h" #include "pa_vmath.h" #include "pa_vfile.h" #include "pa_request.h" #include "pa_md5.h" #include "pa_sha2.h" #include "pa_random.h" #ifdef HAVE_CRYPT extern "C" char *crypt(const char* , const char* ); #endif volatile const char * IDENT_MATH_C="$Id: math.C,v 1.72 2013/08/27 11:27:45 moko Exp $"; // defines #define MAX_SALT 8 // class class MMath: public Methoded { public: MMath(); public: // Methoded bool used_directly() { return false; } }; // global variables DECLARE_CLASS_VAR(math, 0 /*fictive*/, new MMath); // methods static void _random(Request& r, MethodParams& params) { double top=params.as_double(0, "range must be expression", r); if(top<=0 || top>MAX_UINT) throw Exception(PARSER_RUNTIME, 0, "top(%g) must be [1..%u]", top, MAX_UINT); r.write_no_lang(*new VInt(_random(uint(top)))); } typedef double(*math1_func_ptr)(double); static double frac(double param) { return param-trunc(param); } static double degrees(double param) { return param /PI *180; } static double radians(double param) { return param /180 *PI; } static void math1(Request& r, MethodParams& params, math1_func_ptr func) { double param=params.as_double(0, "parameter must be expression", r); double result=func(param); r.write_no_lang(*new VDouble(result)); } #define MATH1(name) \ static void _##name(Request& r, MethodParams& params) {\ math1(r, params, &name);\ } #define MATH1P(name_parser, name_c) \ static void _##name_parser(Request& r, MethodParams& params) {\ math1(r, params, &name_c);\ } MATH1(round); MATH1(floor); MATH1P(ceiling, ceil); MATH1(trunc); MATH1(frac); MATH1P(abs, fabs); MATH1(sign); MATH1(exp); MATH1(log); MATH1(log10); MATH1(sin); MATH1(asin); MATH1(cos); MATH1(acos); MATH1(tan); MATH1(atan); MATH1(degrees); MATH1(radians); MATH1(sqrt); typedef double (*math2_func_ptr)(double, double); static void math2(Request& r, MethodParams& params, math2_func_ptr func) { double a=params.as_double(0, "parameter must be expression", r); double b=params.as_double(1, "parameter must be expression", r); double result=func(a, b); r.write_no_lang(*new VDouble(result)); } #define MATH2(name) \ static void _##name(Request& r, MethodParams& params) {\ math2(r, params, &name);\ } MATH2(pow); inline bool is_salt_body_char(int c) { return isalnum(c) || c == '.' || c=='/'; } static size_t calc_prefix_size(const char* salt) { if(strlen(salt)) { if(!is_salt_body_char((unsigned char)salt[0])) { // $... {... const char* cur=salt+1; // skip while(is_salt_body_char((unsigned char)*cur++)) // ...$ ...} ; return cur-salt; } else return 0; } else return 0; } static void _crypt(Request& r, MethodParams& params) { const char* password=params.as_string(0, "password must be string").cstr(); const char* maybe_bodyless_salt=params.as_string(1, "salt must be string").cstr(); size_t prefix_size=calc_prefix_size(maybe_bodyless_salt); const char* normal_salt; char normalize_buf[MAX_STRING]; if(prefix_size==strlen(maybe_bodyless_salt)) { // bodyless? strncpy(normalize_buf, maybe_bodyless_salt, MAX_STRING-MAX_SALT-1); char *cur=normalize_buf+strlen(normalize_buf); // sould add up MAX_SALT random chars static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for(int i=0; i> (32-(bits)))) void SHA1ProcessMessageBlock(SHA1Context *); void SHA1PadMessage(SHA1Context *); void SHA1Reset(SHA1Context *context) { context->Length_Low = context->Length_High = context->Message_Block_Index = 0; context->Message_Digest[0] = 0x67452301; context->Message_Digest[1] = 0xEFCDAB89; context->Message_Digest[2] = 0x98BADCFE; context->Message_Digest[3] = 0x10325476; context->Message_Digest[4] = 0xC3D2E1F0; context->Computed = context->Corrupted = 0; } int SHA1Result(SHA1Context *context) { if (context->Corrupted) return 0; if (!context->Computed) { SHA1PadMessage(context); context->Computed = 1; } return 1; } void SHA1Input(SHA1Context *context, const unsigned char *message_array, unsigned length) { if (!length) return; if (context->Computed || context->Corrupted) { context->Corrupted = 1; return; } while(length-- && !context->Corrupted) { context->Message_Block[context->Message_Block_Index++] = (*message_array & 0xFF); context->Length_Low += 8; context->Length_Low &= 0xFFFFFFFF; if (!context->Length_Low && !(context->Length_High=((1+context->Length_High)&0xFFFFFFFF))) context->Corrupted = 1; // too long message if (context->Message_Block_Index == 64) SHA1ProcessMessageBlock(context); message_array++; } } void SHA1ProcessMessageBlock(SHA1Context *context) { const unsigned K[] = {0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 }; int t; unsigned temp, W[80], buf[5]; unsigned &A=buf[0], &B=buf[1], &C=buf[2], &D=buf[3], &E=buf[4]; for(t = 0; t < 16; t++) W[t] = (((unsigned) context->Message_Block[t * 4]) << 24) | (((unsigned) context->Message_Block[t * 4 + 1]) << 16) | (((unsigned) context->Message_Block[t * 4 + 2]) << 8) | ((unsigned) context->Message_Block[t * 4 + 3]); for(t = 16; t < 80; t++) W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); memcpy (buf, context->Message_Digest, sizeof(buf)); for(t = 0; t < 20; t++) { temp = (SHA1CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[t] + K[0]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for(t = 20; t < 40; t++) { temp = (SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for(t = 40; t < 60; t++) { temp = (SHA1CircularShift(5,A) + ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for(t = 60; t < 80; t++) { temp = (SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for (t = 0; t < 5; t++) context->Message_Digest[t] = (context->Message_Digest[t] + buf[t]) & 0xFFFFFFFF; context->Message_Block_Index = 0; } void SHA1PadMessage(SHA1Context *context) { context->Message_Block[context->Message_Block_Index++] = 0x80; if (context->Message_Block_Index > 56) { //was 55, one shift while(context->Message_Block_Index < 64) context->Message_Block[context->Message_Block_Index++] = 0; SHA1ProcessMessageBlock(context); while(context->Message_Block_Index < 56) context->Message_Block[context->Message_Block_Index++] = 0; } else while(context->Message_Block_Index < 56) context->Message_Block[context->Message_Block_Index++] = 0; context->Message_Block[56] = (context->Length_High >> 24) & 0xFF; context->Message_Block[57] = (context->Length_High >> 16) & 0xFF; context->Message_Block[58] = (context->Length_High >> 8) & 0xFF; context->Message_Block[59] = (context->Length_High) & 0xFF; context->Message_Block[60] = (context->Length_Low >> 24) & 0xFF; context->Message_Block[61] = (context->Length_Low >> 16) & 0xFF; context->Message_Block[62] = (context->Length_Low >> 8) & 0xFF; context->Message_Block[63] = (context->Length_Low) & 0xFF; SHA1ProcessMessageBlock(context); } #ifdef PA_BIG_ENDIAN #define SWAP(n) (n) #else #define SWAP(n) (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #endif void SHA1ReadDigest(void *buf, SHA1Context *c) { if(!SHA1Result(c)) throw Exception (PARSER_RUNTIME, 0, "Can not compute SHA1"); ((uint32_t *)buf)[0] = SWAP(c->Message_Digest[0]); ((uint32_t *)buf)[1] = SWAP(c->Message_Digest[1]); ((uint32_t *)buf)[2] = SWAP(c->Message_Digest[2]); ((uint32_t *)buf)[3] = SWAP(c->Message_Digest[3]); ((uint32_t *)buf)[4] = SWAP(c->Message_Digest[4]); } static void _sha1(Request& r, MethodParams& params) { const char *string = params.as_string(0, PARAMETER_MUST_BE_STRING).cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets).cstr(); SHA1Context c; unsigned char digest[20]; SHA1Reset (&c); SHA1Input (&c, (const unsigned char*)string, strlen(string)); SHA1ReadDigest(digest, &c); r.write_pass_lang(*new String(hex_string(digest, sizeof(digest), false))); } void memxor(char *dest, const char *src, size_t n){ for (;n>0;n--) *dest++ ^= *src++; } #define IPAD 0x36 #define OPAD 0x5c #define HMAC(key,init,update,final,blocklen,digestlen){ \ unsigned char tempdigest[digestlen], keydigest[digestlen]; \ size_t keylen=strlen(key); \ /* Reduce the key's size, so that it becomes <= blocklen bytes. */ \ if (keylen > blocklen){ \ init(&c); \ update(&c,(const unsigned char*)hmac, keylen); \ final(keydigest, &c); \ key = (char *)keydigest; \ keylen = digestlen; \ } \ /* Compute TEMP from KEY and STRING. */ \ char block[blocklen]; \ memset (block, IPAD, blocklen); \ memxor (block, key, keylen); \ init(&c); \ update(&c, (const unsigned char*)block, blocklen); \ update(&c, (const unsigned char*)data.str, data.length); \ final(tempdigest, &c); \ /* Compute result from KEY and TEMP. */ \ memset (block, OPAD, blocklen); \ memxor (block, key, keylen); \ init(&c); \ update(&c, (const unsigned char*)block, blocklen); \ update(&c, (const unsigned char*)tempdigest, digestlen); \ } static void _digest(Request& r, MethodParams& params) { const String &smethod = params.as_string(0, PARAMETER_MUST_BE_STRING); Value& vdata=params.as_no_junction(1, "parameter must be string or file"); String::C data; if(const String* sdata=vdata.get_string()){ String::Body body=sdata->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets); // explode content, honor tainting changes data=String::C(body.cstr(), body.length()); } else { VFile *file=vdata.as_vfile(String::L_AS_IS); data=String::C(file->value_ptr(),file->value_size()); } enum Method { M_MD5, M_SHA1, M_SHA256, M_SHA512 } method; if (smethod == "md5") method = M_MD5; else if (smethod == "sha1" ) method = M_SHA1; else if (smethod == "sha256" ) method = M_SHA256; else if (smethod == "sha512" ) method = M_SHA512; else throw Exception(PARSER_RUNTIME, &smethod, "must be 'md5' or 'sha1'"); const char *hmac=0; enum Format { F_HEX, F_BASE64 } format = F_HEX; if(params.count() == 3) if(HashStringValue* options=params.as_hash(2)) { int valid_options=0; if(Value* value=options->get("hmac")) { hmac=value->as_string().cstr(); valid_options++; } if(Value* value=options->get("format")) { const String& sformat=value->as_string(); if (sformat == "hex") format = F_HEX; else if (sformat == "base64" ) format = F_BASE64; else throw Exception(PARSER_RUNTIME, &sformat, "must be 'hex' or 'base64'"); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } String::C digest; if(method == M_MD5){ PA_MD5_CTX c; if(hmac){ HMAC(hmac, pa_MD5Init, pa_MD5Update, pa_MD5Final, 64, 16); } else { pa_MD5Init(&c); pa_MD5Update(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(16); pa_MD5Final((unsigned char *)str, &c); digest = String::C(str, 16); } if(method == M_SHA1){ SHA1Context c; if(hmac){ HMAC(hmac, SHA1Reset, SHA1Input, SHA1ReadDigest, 64, 20); } else { SHA1Reset(&c); SHA1Input(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(20); SHA1ReadDigest(str, &c); digest = String::C(str, 20); } if(method == M_SHA256){ SHA256_CTX c; if(hmac){ HMAC(hmac, pa_SHA256_Init, pa_SHA256_Update, pa_SHA256_Final, 64, SHA256_DIGEST_LENGTH); } else { pa_SHA256_Init(&c); pa_SHA256_Update(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(SHA256_DIGEST_LENGTH); pa_SHA256_Final((unsigned char *)str, &c); digest = String::C(str, SHA256_DIGEST_LENGTH); } if(method == M_SHA512){ SHA512_CTX c; if(hmac){ HMAC(hmac, pa_SHA512_Init, pa_SHA512_Update, pa_SHA512_Final, 128, SHA512_DIGEST_LENGTH); } else { pa_SHA512_Init(&c); pa_SHA512_Update(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(SHA512_DIGEST_LENGTH); pa_SHA512_Final((unsigned char *)str, &c); digest = String::C(str, SHA512_DIGEST_LENGTH); } if(format == F_HEX){ r.write_pass_lang(*new String(hex_string((unsigned char *)digest.str, digest.length, false))); } if(format == F_BASE64){ r.write_pass_lang(*new String(pa_base64_encode(digest.str, digest.length))); } } static void _uuid(Request& r, MethodParams& /*params*/) { uuid uuid=get_uuid(); const size_t bufsize=36+1/*zero-teminator*/+1/*for faulty snprintfs*/; char* cstr=new(PointerFreeGC) char[bufsize]; snprintf(cstr, bufsize, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, uuid.node[0], uuid.node[1], uuid.node[2], uuid.node[3], uuid.node[4], uuid.node[5]); r.write_pass_lang(*new String(cstr)); } static void _uid64(Request& r, MethodParams& /*params*/) { unsigned char id[64/8]; random(&id, sizeof(id)); r.write_pass_lang(*new String(hex_string(id, sizeof(id), true))); } static void _crc32(Request& r, MethodParams& params) { const char *string=params.as_string(0, PARAMETER_MUST_BE_STRING).cstr(); r.write_no_lang(*new VInt(pa_crc32(string, strlen(string)))); } static void toBase(unsigned int value, unsigned int base, char*& ptr){ static const char* hex="0123456789ABCDEF"; int rest = value % base; if(value >= base) toBase( (value-rest)/base, base, ptr); *ptr++=(char)hex[rest]; } static void _convert(Request& r, MethodParams& params) { const char *str=params.as_string(0, PARAMETER_MUST_BE_STRING).cstr(); int base_from=params.as_int(1, "base from must be integer", r); if(base_from < 2 || base_from > 16) throw Exception(PARSER_RUNTIME, 0, "base from must be an integer from 2 to 16"); int base_to=params.as_int(2, "base to must be integer", r); if(base_to < 2 || base_to > 16) throw Exception(PARSER_RUNTIME, 0, "base to must be an integer from 2 to 16"); while(isspace(*str)) str++; if(!*str) return; bool negative=false; if(str[0]=='-') { negative=true; str++; } else if(str[0]=='+') { str++; } unsigned int value=pa_atoui(str, base_from); char result_cstr[sizeof(unsigned int)*8+1/*minus for negative number*/+1/*terminator*/]; char* ptr=result_cstr; if(negative) *ptr++='-'; toBase(value, base_to, ptr); *ptr=0; r.write_pass_lang(*new String(pa_strdup(result_cstr))); } // constructor MMath::MMath(): Methoded("math") { // ^FUNC(expr) #define ADDX(name, X) \ add_native_method(#name, Method::CT_STATIC, _##name, X, X) #define ADD0(name) ADDX(name, 0) #define ADD1(name) ADDX(name, 1) #define ADD2(name) ADDX(name, 2) ADD1(round); ADD1(floor); ADD1(ceiling); ADD1(trunc); ADD1(frac); ADD1(abs); ADD1(sign); ADD1(exp); ADD1(log); ADD1(log10); ADD1(sin); ADD1(asin); ADD1(cos); ADD1(acos); ADD1(tan); ADD1(atan); ADD1(degrees); ADD1(radians); ADD1(sqrt); ADD1(random); // ^math:pow(x;y) ADD2(pow); // ^math:crypt[password;salt] ADD2(crypt); // ^math:md5[string] ADD1(md5); // ^math:sha1[string] ADD1(sha1); // ^math:digest[method;string|file;options] add_native_method("digest", Method::CT_STATIC, _digest, 2, 3); // ^math:crc32[string] ADD1(crc32); // ^math:uuid[] ADD0(uuid); // ^math:uid64[] ADD0(uid64); // ^math:convert[number](base-from;base-to) add_native_method("convert", Method::CT_STATIC, _convert, 3, 3); } parser-3.4.3/src/main/pa_pool.C000644 000000 000000 00000002523 11730603276 016373 0ustar00rootwheel000000 000000 /** @file Parser: pool class. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_pool.h" #include "pa_exception.h" #include "pa_common.h" #include "pa_sapi.h" #include "pa_charset.h" volatile const char * IDENT_PA_POOL_C="$Id: pa_pool.C,v 1.63 2012/03/16 09:24:14 moko Exp $" IDENT_PA_POOL_H; // Pool Pool::Pool(){} static void cleanup(Pool::Cleanup item, int) { if(item.cleanup) item.cleanup(item.data); } Pool::~Pool() { //__asm__("int3"); //_asm int 3; //fprintf(stderr, "cleanups: %d\n", cleanups.size()); // cleanups first, because they use some object's memory pointers cleanups.for_each(cleanup, 0); } void Pool::register_cleanup(void (*cleanup) (void *), void *data) { cleanups+=Cleanup(cleanup, data); } static void unregister_cleanup(Pool::Cleanup& item, void* cleanup_data) { if(item.data==cleanup_data) item.cleanup=0; } void Pool::unregister_cleanup(void *cleanup_data) { cleanups.for_each_ref(::unregister_cleanup, cleanup_data); } // Pooled static void cleanup(void *data) { static_cast(data)->~Pooled(); } Pooled::Pooled(Pool& apool): fpool(apool) { fpool.register_cleanup(cleanup, this); } /// Sole: this got called automatically from Pool::~Pool() Pooled::~Pooled() { fpool.unregister_cleanup(this); } parser-3.4.3/src/main/compile.C000644 000000 000000 00000002014 11730603274 016363 0ustar00rootwheel000000 000000 /** @file Parser: compiler part of request class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ volatile const char * IDENT_COMPILE_C="$Id: compile.C,v 1.82 2012/03/16 09:24:12 moko Exp $"; #include "pa_request.h" #include "compile_tools.h" extern int yydebug; extern int yyparse (void *); ArrayClass& Request::compile(VStateless_class* aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset) { // prepare to parse Parse_control pc(*this, aclass, source, main_alias, file_no, line_no_offset); // parse=compile! //yydebug=1; if(yyparse(&pc)) { // error? pc.pos_prev_c(); if(!pc.explicit_result) if(pc.pos.col==0) // expecting something after EOL means they've expected it BEFORE pc.pos_prev_c(); throw Exception("parser.compile", 0, "%s(%d:%d): %s", file_list[file_no].cstr(), 1+pc.pos.line, 1+pc.pos.col, pc.error); } // result return *pc.cclasses; } parser-3.4.3/src/main/compile_tools.C000644 000000 000000 00000010151 11730603274 017604 0ustar00rootwheel000000 000000 /** @file Parser: compiler support helper functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "compile_tools.h" #include "pa_string.h" #include "pa_array.h" #include "pa_exception.h" #include "pa_vstring.h" #include "pa_vdouble.h" #include "pa_vmethod_frame.h" volatile const char * IDENT_COMPILE_TOOLS_C="$Id: compile_tools.C,v 1.69 2012/03/16 09:24:12 moko Exp $" IDENT_COMPILE_TOOLS_H; Value* LA2V(ArrayOperation& literal_string_array, int offset, OP::OPCODE code) { return literal_string_array[offset+0].code==code?literal_string_array[offset+2/*skip opcode&origin*/].value :0; } void maybe_change_string_literal_to_double_literal(ArrayOperation& literal_array) { assert(literal_array[0].code==OP::OP_VALUE); VString& vstring=*static_cast(literal_array[2/*opcode+origin*/].value); if(isdigit(vstring.string().first_char())) literal_array.put(2/*opcode+origin*/, &vstring.as_expr_result()); } void change_string_literal_value(ArrayOperation& literal_string_array, const String& new_value) { assert(literal_string_array[0].code==OP::OP_VALUE); static_cast(literal_string_array[2/*opcode+origin*/].value)->set_string(new_value); } void changetail_or_append(ArrayOperation& opcodes, OP::OPCODE find, bool with_argument, OP::OPCODE replace, OP::OPCODE notfound) { int tail=opcodes.count()-(with_argument?2:1); if(tail>=0) { Operation& op=opcodes.get_ref(tail); if(op.code==find) { op.code=replace; return; } } opcodes+=Operation(notfound); } bool maybe_change_first_opcode(ArrayOperation& opcodes, OP::OPCODE find, OP::OPCODE replace) { if(opcodes[0].code!=find) return false; opcodes.put(0, replace); return true; } // OP_VALUE+origin+self+OP_GET_ELEMENT+OP_VALUE+origin+value+OP_GET_ELEMENT => OP_WITH_SELF__VALUE__GET_ELEMENT+origin+value bool maybe_make_self(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t divine_count){ const String* first_name=LA2S(diving_code); if(first_name && *first_name==SELF_ELEMENT_NAME){ #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT if( divine_count>=8 && diving_code[3].code==OP::OP_GET_ELEMENT && diving_code[4].code==OP::OP_VALUE && diving_code[7].code==OP::OP_GET_ELEMENT ){ // optimization for $self.field and ^self.method O(opcodes, OP::OP_WITH_SELF__VALUE__GET_ELEMENT); P(opcodes, diving_code, 5/*offset*/, 2/*limit*/); // copy second origin+value. we know that the first one is "self" if(divine_count>8) P(opcodes, diving_code, 8/*offset*/); // copy tail } else #endif { // self.xxx... => xxx... // OP_VALUE+origin+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+... O(opcodes, OP::OP_WITH_SELF); /* stack: starting context */ P(opcodes, diving_code, divine_count>=4?4/*OP::OP_VALUE+origin+string+OP::OP_GET_ELEMENTx*/:3/*OP::OP_+origin+string*/); } return true; } return false; } Method::Call_type GetMethodCallType(Parse_control& pc, ArrayOperation& literal_array) { const String* full_name=LA2S(literal_array); int pos=full_name->pos(':'); if(pos > 0) { const String call_type=full_name->mid(0, pos); if(call_type!=method_call_type_static) throw Exception("parser.compile", &call_type, "incorrect method call type. the only valid call type method prefix is '"METHOD_CALL_TYPE_STATIC"'" ); const String *sole_name=&full_name->mid(pos+1, full_name->length()); // replace full method name (static:method) by sole method name (method). it will be used later. change_string_literal_value(literal_array, *sole_name); return Method::CT_STATIC; } return pc.get_methods_call_type(); } void push_LS(Parse_control& pc, lexical_state new_state) { if(pc.ls_sp=0) pc.ls=pc.ls_stack[pc.ls_sp]; else throw Exception(0, 0, "pop_LS: ls_stack underflow"); } const String& Parse_control::alias_method(const String& name) { return (main_alias && name==main_method_name)?*main_alias:name; } parser-3.4.3/src/main/pa_memory.C000644 000000 000000 00000001376 12173521636 016740 0ustar00rootwheel000000 000000 /** @file Parser: memory reference counting classes. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_sapi.h" #include "pa_common.h" volatile const char * IDENT_PA_MEMORY_C="$Id: pa_memory.C,v 1.10 2013/07/23 15:39:10 moko Exp $" IDENT_PA_MEMORY_H; void *pa_fail_alloc(const char* what, size_t size) { #ifdef PA_DEBUG_DISABLE_GC SAPI::die("out of memory (in pa_fail_alloc)"); #else SAPI::die("out of memory: failed to %s %u bytes. " "heap_used=%u, heap_free=%u, bytes_since_gc=%u, total_bytes=%u", what, size, GC_get_heap_size(), GC_get_free_bytes(), GC_get_bytes_since_gc(), GC_get_total_bytes() ); #endif // never reached return 0; } parser-3.4.3/src/main/Makefile.in000644 000000 000000 00000044135 11766635216 016720 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/main DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmain_la_LIBADD = am_libmain_la_OBJECTS = pa_pool.lo pa_os.lo pa_common.lo \ compile.tab.lo compile.lo compile_tools.lo execute.lo \ pa_cache_managers.lo pa_exception.lo pa_xml_exception.lo \ pa_globals.lo pa_xml_io.lo pa_memory.lo pa_request.lo \ pa_string.lo pa_table.lo untaint.lo pa_dir.lo pa_exec.lo \ pa_socks.lo pa_dictionary.lo pa_charset.lo pa_charsets.lo \ pa_uue.lo pa_sql_driver_manager.lo pa_stylesheet_manager.lo \ pa_stylesheet_connection.lo pa_http.lo pa_random.lo libmain_la_OBJECTS = $(am_libmain_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmain_la_SOURCES) DIST_SOURCES = $(libmain_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I../types -I../classes -I../sql -I../lib/gc/include -I../lib/cord/include $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ noinst_HEADERS = compile_tools.h utf8-to-lower.inc utf8-to-upper.inc noinst_LTLIBRARIES = libmain.la libmain_la_SOURCES = pa_pool.C pa_os.C pa_common.C compile.tab.C compile.C compile_tools.C execute.C pa_cache_managers.C pa_exception.C pa_xml_exception.C pa_globals.C pa_xml_io.C pa_memory.C pa_request.C pa_string.C pa_table.C untaint.C pa_dir.C pa_exec.C pa_socks.C pa_dictionary.C pa_charset.C pa_charsets.C pa_uue.C pa_sql_driver_manager.C pa_stylesheet_manager.C pa_stylesheet_connection.C pa_http.C pa_random.C EXTRA_DIST = compile.y main.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/main/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/main/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmain.la: $(libmain_la_OBJECTS) $(libmain_la_DEPENDENCIES) $(CXXLINK) $(libmain_la_OBJECTS) $(libmain_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile.tab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_cache_managers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_charset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_charsets.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_dictionary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_dir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_exception.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_exec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_http.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_memory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_os.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_random.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_socks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_sql_driver_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_stylesheet_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_stylesheet_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_uue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_xml_exception.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_xml_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/untaint.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am compile.tab.C: compile.y bison -v compile.y -o $@ # 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: parser-3.4.3/src/main/pa_stylesheet_manager.C000644 000000 000000 00000010474 11730603276 021311 0ustar00rootwheel000000 000000 /** @file Parser: sql driver manager implementation. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "pa_stylesheet_manager.h" #include "pa_exception.h" #include "pa_common.h" #include "pa_threads.h" #include "pa_stack.h" #include "pa_vhash.h" #include "pa_vtable.h" volatile const char * IDENT_PA_STYLESHEET_MANAGER_C="$Id: pa_stylesheet_manager.C,v 1.29 2012/03/16 09:24:14 moko Exp $" IDENT_PA_STYLESHEET_MANAGER_H; // globals Stylesheet_manager* stylesheet_manager=0; // consts const time_t EXPIRE_UNUSED_CONNECTION_SECONDS=5*60; const time_t CHECK_EXPIRED_CONNECTION_SECONDS=EXPIRE_UNUSED_CONNECTION_SECONDS*2; // helpers static void expire_connection(Stylesheet_connection& connection, time_t older_dies) { if(connection.connected() && connection.expired(older_dies)) connection.disconnect(); } static void expire_connections( Stylesheet_manager::connection_cache_type::key_type /*key*/, Stylesheet_manager::connection_cache_type::value_type stack, time_t older_dies) { for(size_t i=0; itop_index(); i++) expire_connection(*stack->get(i), older_dies); } // Stylesheet_connection methods void Stylesheet_connection::close() { stylesheet_manager->close_connection(ffile_spec, *this); } // Stylesheet_manager methods Stylesheet_manager::Stylesheet_manager(): prev_expiration_pass_time(0) { } Stylesheet_manager::~Stylesheet_manager() { connection_cache.for_each(expire_connections, time(0)+(time_t)10/*=in future=expire all*/); } Stylesheet_connection_ptr Stylesheet_manager::get_connection(String::Body file_spec) { Stylesheet_connection* result=get_connection_from_cache(file_spec); if(!result) result=new Stylesheet_connection(file_spec); return Stylesheet_connection_ptr(result); } void Stylesheet_manager::close_connection(String::Body file_spec, Stylesheet_connection& connection) { put_connection_to_cache(file_spec, connection); } // stylesheet cache /// @todo get rid of memory spending Stack [zeros deep inside got accumulated] Stylesheet_connection* Stylesheet_manager::get_connection_from_cache(String::Body file_spec) { SYNCHRONIZED; if(connection_cache_type::value_type connections=connection_cache.get(file_spec)) while(!connections->is_empty()) { // there are cached stylesheets to that 'file_spec' Stylesheet_connection* result=connections->pop(); if(result->connected()) // not expired? return result; } return 0; } void Stylesheet_manager::put_connection_to_cache(String::Body file_spec, Stylesheet_connection& connection) { SYNCHRONIZED; connection_cache_type::value_type connections=connection_cache.get(file_spec); if(!connections) { // there are no cached stylesheets to that 'file_spec' yet? connections=new connection_cache_value_type; connection_cache.put(file_spec, connections); } connections->push(&connection); } void Stylesheet_manager::maybe_expire_cache() { time_t now=time(0); if(prev_expiration_pass_time(expire_connections, now-EXPIRE_UNUSED_CONNECTION_SECONDS); prev_expiration_pass_time=now; } } static void add_connection_to_status_cache_table(Stylesheet_connection& connection, Table* table) { if(connection.connected()) { ArrayString& row=*new ArrayString; // file row+=new String(connection.file_spec(), String::L_AS_IS); // time time_t time_used=connection.get_time_used(); row+=new String(pa_strdup(ctime(&time_used))); *table+=&row; } } static void add_connections_to_status_cache_table( Stylesheet_manager::connection_cache_type::key_type /*key*/, Stylesheet_manager::connection_cache_type::value_type stack, Table* table) { for(Array_iterator i(*stack); i.has_next(); ) add_connection_to_status_cache_table(*i.next(), table); } Value* Stylesheet_manager::get_status() { VHash* result=new VHash; // cache { ArrayString& columns=*new ArrayString; columns+=new String("file"); columns+=new String("time"); Table& table=*new Table(&columns, connection_cache.count()); connection_cache.for_each(add_connections_to_status_cache_table, &table); result->get_hash()->put(*new String("cache"), new VTable(&table)); } return result; } #endif parser-3.4.3/src/main/pa_os.C000644 000000 000000 00000004112 12173573142 016037 0ustar00rootwheel000000 000000 /** @file Parser: commonly functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #include "pa_os.h" volatile const char * IDENT_PA_OS_C="$Id: pa_os.C,v 1.14 2013/07/23 21:32:18 moko Exp $" IDENT_PA_OS_H; #ifdef _MSC_VER #include #endif #ifdef HAVE_FLOCK #define PA_SH_LOCK LOCK_SH|LOCK_NB #define PA_EX_LOCK LOCK_EX|LOCK_NB #define PA_ULOCK LOCK_UN #define FLOCK(operation) int status=flock(fd, operation); #else #ifdef HAVE__LOCKING #define PA_SH_LOCK _LK_NBLCK #define PA_EX_LOCK _LK_NBLCK #define PA_ULOCK _LK_UNLCK #define FLOCK(operation) lseek(fd, 0, SEEK_SET); int status=_locking(fd, operation, 1); #else #ifdef HAVE_FCNTL #define PA_SH_LOCK F_RDLCK #define PA_EX_LOCK F_WRLCK #define PA_ULOCK F_UNLCK #define FLOCK(operation) struct flock ls={operation, SEEK_SET}; int status=fcntl(fd, F_SETLK, &ls); #else #ifdef HAVE_LOCKF #define PA_SH_LOCK F_TLOCK #define PA_EX_LOCK F_TLOCK #define PA_ULOCK F_ULOCK #define FLOCK(operation) lseek(fd, 0, SEEK_SET); int status=lockf(fd, operation, 1); #else #error unable to find file locking func #endif #endif #endif #endif int pa_lock(int fd, int attempts, int operation){ while(true){ FLOCK(operation); attempts--; if(status==0 || attempts<=0){ return status; } pa_sleep(PA_LOCK_WAIT_TIMEOUT_SECS, PA_LOCK_WAIT_TIMEOUT_USECS); } }; int pa_lock_shared_blocking(int fd) { return pa_lock(fd, PA_LOCK_ATTEMPTS, PA_SH_LOCK); } int pa_lock_exclusive_blocking(int fd) { return pa_lock(fd, PA_LOCK_ATTEMPTS, PA_EX_LOCK); } int pa_lock_exclusive_nonblocking(int fd) { return pa_lock(fd, 1, PA_EX_LOCK); } int pa_unlock(int fd) { return pa_lock(fd, 1, PA_ULOCK); } int pa_sleep(unsigned long secs, unsigned long usecs) { if(usecs >= 1000000){ secs += usecs/1000000; usecs = usecs%1000000; } #ifdef _MSC_VER Sleep(secs * 1000 + usecs / 1000); return 0; #else struct timeval t; t.tv_sec = secs; t.tv_usec = usecs; return (select(0, NULL, NULL, NULL, &t)<0 ? errno : 0); #endif } parser-3.4.3/src/main/main.vcproj000644 000000 000000 00000021526 12230131504 016775 0ustar00rootwheel000000 000000 parser-3.4.3/src/main/utf8-to-lower.inc000644 000000 000000 00000032147 10562132322 017761 0ustar00rootwheel000000 000000 /* some char's commented because of parser have a problem while changing case if from-char and to-char have different length */ {0x0041, 0x0061}, {0x0042, 0x0062}, {0x0043, 0x0063}, {0x0044, 0x0064}, {0x0045, 0x0065}, {0x0046, 0x0066}, {0x0047, 0x0067}, {0x0048, 0x0068}, {0x0049, 0x0069}, {0x004A, 0x006A}, {0x004B, 0x006B}, {0x004C, 0x006C}, {0x004D, 0x006D}, {0x004E, 0x006E}, {0x004F, 0x006F}, {0x0050, 0x0070}, {0x0051, 0x0071}, {0x0052, 0x0072}, {0x0053, 0x0073}, {0x0054, 0x0074}, {0x0055, 0x0075}, {0x0056, 0x0076}, {0x0057, 0x0077}, {0x0058, 0x0078}, {0x0059, 0x0079}, {0x005A, 0x007A}, /* {0x00B5, 0x03BC}, */{0x00C0, 0x00E0}, {0x00C1, 0x00E1}, {0x00C2, 0x00E2}, {0x00C3, 0x00E3}, {0x00C4, 0x00E4}, {0x00C5, 0x00E5}, {0x00C6, 0x00E6}, {0x00C7, 0x00E7}, {0x00C8, 0x00E8}, {0x00C9, 0x00E9}, {0x00CA, 0x00EA}, {0x00CB, 0x00EB}, {0x00CC, 0x00EC}, {0x00CD, 0x00ED}, {0x00CE, 0x00EE}, {0x00CF, 0x00EF}, {0x00D0, 0x00F0}, {0x00D1, 0x00F1}, {0x00D2, 0x00F2}, {0x00D3, 0x00F3}, {0x00D4, 0x00F4}, {0x00D5, 0x00F5}, {0x00D6, 0x00F6}, {0x00D8, 0x00F8}, {0x00D9, 0x00F9}, {0x00DA, 0x00FA}, {0x00DB, 0x00FB}, {0x00DC, 0x00FC}, {0x00DD, 0x00FD}, {0x00DE, 0x00FE}, {0x0100, 0x0101}, {0x0102, 0x0103}, {0x0104, 0x0105}, {0x0106, 0x0107}, {0x0108, 0x0109}, {0x010A, 0x010B}, {0x010C, 0x010D}, {0x010E, 0x010F}, {0x0110, 0x0111}, {0x0112, 0x0113}, {0x0114, 0x0115}, {0x0116, 0x0117}, {0x0118, 0x0119}, {0x011A, 0x011B}, {0x011C, 0x011D}, {0x011E, 0x011F}, {0x0120, 0x0121}, {0x0122, 0x0123}, {0x0124, 0x0125}, {0x0126, 0x0127}, {0x0128, 0x0129}, {0x012A, 0x012B}, {0x012C, 0x012D}, {0x012E, 0x012F}, /*{0x0130, 0x0069}, */{0x0132, 0x0133}, {0x0134, 0x0135}, {0x0136, 0x0137}, {0x0139, 0x013A}, {0x013B, 0x013C}, {0x013D, 0x013E}, {0x013F, 0x0140}, {0x0141, 0x0142}, {0x0143, 0x0144}, {0x0145, 0x0146}, {0x0147, 0x0148}, {0x014A, 0x014B}, {0x014C, 0x014D}, {0x014E, 0x014F}, {0x0150, 0x0151}, {0x0152, 0x0153}, {0x0154, 0x0155}, {0x0156, 0x0157}, {0x0158, 0x0159}, {0x015A, 0x015B}, {0x015C, 0x015D}, {0x015E, 0x015F}, {0x0160, 0x0161}, {0x0162, 0x0163}, {0x0164, 0x0165}, {0x0166, 0x0167}, {0x0168, 0x0169}, {0x016A, 0x016B}, {0x016C, 0x016D}, {0x016E, 0x016F}, {0x0170, 0x0171}, {0x0172, 0x0173}, {0x0174, 0x0175}, {0x0176, 0x0177}, /*{0x0178, 0x00FF}, */{0x0179, 0x017A}, {0x017B, 0x017C}, {0x017D, 0x017E}, /*{0x017F, 0x0073}, */{0x0181, 0x0253}, {0x0182, 0x0183}, {0x0184, 0x0185}, {0x0186, 0x0254}, {0x0187, 0x0188}, {0x0189, 0x0256}, {0x018A, 0x0257}, {0x018B, 0x018C}, {0x018E, 0x01DD}, {0x018F, 0x0259}, {0x0190, 0x025B}, {0x0191, 0x0192}, {0x0193, 0x0260}, {0x0194, 0x0263}, {0x0196, 0x0269}, {0x0197, 0x0268}, {0x0198, 0x0199}, {0x019C, 0x026F}, {0x019D, 0x0272}, {0x019F, 0x0275}, {0x01A0, 0x01A1}, {0x01A2, 0x01A3}, {0x01A4, 0x01A5}, {0x01A6, 0x0280}, {0x01A7, 0x01A8}, {0x01A9, 0x0283}, {0x01AC, 0x01AD}, {0x01AE, 0x0288}, {0x01AF, 0x01B0}, {0x01B1, 0x028A}, {0x01B2, 0x028B}, {0x01B3, 0x01B4}, {0x01B5, 0x01B6}, {0x01B7, 0x0292}, {0x01B8, 0x01B9}, {0x01BC, 0x01BD}, {0x01C4, 0x01C6}, {0x01C5, 0x01C6}, {0x01C7, 0x01C9}, {0x01C8, 0x01C9}, {0x01CA, 0x01CC}, {0x01CB, 0x01CC}, {0x01CD, 0x01CE}, {0x01CF, 0x01D0}, {0x01D1, 0x01D2}, {0x01D3, 0x01D4}, {0x01D5, 0x01D6}, {0x01D7, 0x01D8}, {0x01D9, 0x01DA}, {0x01DB, 0x01DC}, {0x01DE, 0x01DF}, {0x01E0, 0x01E1}, {0x01E2, 0x01E3}, {0x01E4, 0x01E5}, {0x01E6, 0x01E7}, {0x01E8, 0x01E9}, {0x01EA, 0x01EB}, {0x01EC, 0x01ED}, {0x01EE, 0x01EF}, {0x01F1, 0x01F3}, {0x01F2, 0x01F3}, {0x01F4, 0x01F5}, {0x01F6, 0x0195}, {0x01F7, 0x01BF}, {0x01F8, 0x01F9}, {0x01FA, 0x01FB}, {0x01FC, 0x01FD}, {0x01FE, 0x01FF}, {0x0200, 0x0201}, {0x0202, 0x0203}, {0x0204, 0x0205}, {0x0206, 0x0207}, {0x0208, 0x0209}, {0x020A, 0x020B}, {0x020C, 0x020D}, {0x020E, 0x020F}, {0x0210, 0x0211}, {0x0212, 0x0213}, {0x0214, 0x0215}, {0x0216, 0x0217}, {0x0218, 0x0219}, {0x021A, 0x021B}, {0x021C, 0x021D}, {0x021E, 0x021F}, {0x0220, 0x019E}, {0x0222, 0x0223}, {0x0224, 0x0225}, {0x0226, 0x0227}, {0x0228, 0x0229}, {0x022A, 0x022B}, {0x022C, 0x022D}, {0x022E, 0x022F}, {0x0230, 0x0231}, {0x0232, 0x0233}, {0x0345, 0x03B9}, {0x0386, 0x03AC}, {0x0388, 0x03AD}, {0x0389, 0x03AE}, {0x038A, 0x03AF}, {0x038C, 0x03CC}, {0x038E, 0x03CD}, {0x038F, 0x03CE}, {0x0391, 0x03B1}, {0x0392, 0x03B2}, {0x0393, 0x03B3}, {0x0394, 0x03B4}, {0x0395, 0x03B5}, {0x0396, 0x03B6}, {0x0397, 0x03B7}, {0x0398, 0x03B8}, {0x0399, 0x03B9}, {0x039A, 0x03BA}, {0x039B, 0x03BB}, {0x039C, 0x03BC}, {0x039D, 0x03BD}, {0x039E, 0x03BE}, {0x039F, 0x03BF}, {0x03A0, 0x03C0}, {0x03A1, 0x03C1}, {0x03A3, 0x03C3}, {0x03A4, 0x03C4}, {0x03A5, 0x03C5}, {0x03A6, 0x03C6}, {0x03A7, 0x03C7}, {0x03A8, 0x03C8}, {0x03A9, 0x03C9}, {0x03AA, 0x03CA}, {0x03AB, 0x03CB}, {0x03C2, 0x03C3}, {0x03D0, 0x03B2}, {0x03D1, 0x03B8}, {0x03D5, 0x03C6}, {0x03D6, 0x03C0}, {0x03D8, 0x03D9}, {0x03DA, 0x03DB}, {0x03DC, 0x03DD}, {0x03DE, 0x03DF}, {0x03E0, 0x03E1}, {0x03E2, 0x03E3}, {0x03E4, 0x03E5}, {0x03E6, 0x03E7}, {0x03E8, 0x03E9}, {0x03EA, 0x03EB}, {0x03EC, 0x03ED}, {0x03EE, 0x03EF}, {0x03F0, 0x03BA}, {0x03F1, 0x03C1}, {0x03F4, 0x03B8}, {0x03F5, 0x03B5}, {0x03F7, 0x03F8}, {0x03F9, 0x03F2}, {0x03FA, 0x03FB}, {0x0400, 0x0450}, {0x0401, 0x0451}, {0x0402, 0x0452}, {0x0403, 0x0453}, {0x0404, 0x0454}, {0x0405, 0x0455}, {0x0406, 0x0456}, {0x0407, 0x0457}, {0x0408, 0x0458}, {0x0409, 0x0459}, {0x040A, 0x045A}, {0x040B, 0x045B}, {0x040C, 0x045C}, {0x040D, 0x045D}, {0x040E, 0x045E}, {0x040F, 0x045F}, {0x0410, 0x0430}, {0x0411, 0x0431}, {0x0412, 0x0432}, {0x0413, 0x0433}, {0x0414, 0x0434}, {0x0415, 0x0435}, {0x0416, 0x0436}, {0x0417, 0x0437}, {0x0418, 0x0438}, {0x0419, 0x0439}, {0x041A, 0x043A}, {0x041B, 0x043B}, {0x041C, 0x043C}, {0x041D, 0x043D}, {0x041E, 0x043E}, {0x041F, 0x043F}, {0x0420, 0x0440}, {0x0421, 0x0441}, {0x0422, 0x0442}, {0x0423, 0x0443}, {0x0424, 0x0444}, {0x0425, 0x0445}, {0x0426, 0x0446}, {0x0427, 0x0447}, {0x0428, 0x0448}, {0x0429, 0x0449}, {0x042A, 0x044A}, {0x042B, 0x044B}, {0x042C, 0x044C}, {0x042D, 0x044D}, {0x042E, 0x044E}, {0x042F, 0x044F}, {0x0460, 0x0461}, {0x0462, 0x0463}, {0x0464, 0x0465}, {0x0466, 0x0467}, {0x0468, 0x0469}, {0x046A, 0x046B}, {0x046C, 0x046D}, {0x046E, 0x046F}, {0x0470, 0x0471}, {0x0472, 0x0473}, {0x0474, 0x0475}, {0x0476, 0x0477}, {0x0478, 0x0479}, {0x047A, 0x047B}, {0x047C, 0x047D}, {0x047E, 0x047F}, {0x0480, 0x0481}, {0x048A, 0x048B}, {0x048C, 0x048D}, {0x048E, 0x048F}, {0x0490, 0x0491}, {0x0492, 0x0493}, {0x0494, 0x0495}, {0x0496, 0x0497}, {0x0498, 0x0499}, {0x049A, 0x049B}, {0x049C, 0x049D}, {0x049E, 0x049F}, {0x04A0, 0x04A1}, {0x04A2, 0x04A3}, {0x04A4, 0x04A5}, {0x04A6, 0x04A7}, {0x04A8, 0x04A9}, {0x04AA, 0x04AB}, {0x04AC, 0x04AD}, {0x04AE, 0x04AF}, {0x04B0, 0x04B1}, {0x04B2, 0x04B3}, {0x04B4, 0x04B5}, {0x04B6, 0x04B7}, {0x04B8, 0x04B9}, {0x04BA, 0x04BB}, {0x04BC, 0x04BD}, {0x04BE, 0x04BF}, {0x04C1, 0x04C2}, {0x04C3, 0x04C4}, {0x04C5, 0x04C6}, {0x04C7, 0x04C8}, {0x04C9, 0x04CA}, {0x04CB, 0x04CC}, {0x04CD, 0x04CE}, {0x04D0, 0x04D1}, {0x04D2, 0x04D3}, {0x04D4, 0x04D5}, {0x04D6, 0x04D7}, {0x04D8, 0x04D9}, {0x04DA, 0x04DB}, {0x04DC, 0x04DD}, {0x04DE, 0x04DF}, {0x04E0, 0x04E1}, {0x04E2, 0x04E3}, {0x04E4, 0x04E5}, {0x04E6, 0x04E7}, {0x04E8, 0x04E9}, {0x04EA, 0x04EB}, {0x04EC, 0x04ED}, {0x04EE, 0x04EF}, {0x04F0, 0x04F1}, {0x04F2, 0x04F3}, {0x04F4, 0x04F5}, {0x04F8, 0x04F9}, {0x0500, 0x0501}, {0x0502, 0x0503}, {0x0504, 0x0505}, {0x0506, 0x0507}, {0x0508, 0x0509}, {0x050A, 0x050B}, {0x050C, 0x050D}, {0x050E, 0x050F}, {0x0531, 0x0561}, {0x0532, 0x0562}, {0x0533, 0x0563}, {0x0534, 0x0564}, {0x0535, 0x0565}, {0x0536, 0x0566}, {0x0537, 0x0567}, {0x0538, 0x0568}, {0x0539, 0x0569}, {0x053A, 0x056A}, {0x053B, 0x056B}, {0x053C, 0x056C}, {0x053D, 0x056D}, {0x053E, 0x056E}, {0x053F, 0x056F}, {0x0540, 0x0570}, {0x0541, 0x0571}, {0x0542, 0x0572}, {0x0543, 0x0573}, {0x0544, 0x0574}, {0x0545, 0x0575}, {0x0546, 0x0576}, {0x0547, 0x0577}, {0x0548, 0x0578}, {0x0549, 0x0579}, {0x054A, 0x057A}, {0x054B, 0x057B}, {0x054C, 0x057C}, {0x054D, 0x057D}, {0x054E, 0x057E}, {0x054F, 0x057F}, {0x0550, 0x0580}, {0x0551, 0x0581}, {0x0552, 0x0582}, {0x0553, 0x0583}, {0x0554, 0x0584}, {0x0555, 0x0585}, {0x0556, 0x0586}, {0x1E00, 0x1E01}, {0x1E02, 0x1E03}, {0x1E04, 0x1E05}, {0x1E06, 0x1E07}, {0x1E08, 0x1E09}, {0x1E0A, 0x1E0B}, {0x1E0C, 0x1E0D}, {0x1E0E, 0x1E0F}, {0x1E10, 0x1E11}, {0x1E12, 0x1E13}, {0x1E14, 0x1E15}, {0x1E16, 0x1E17}, {0x1E18, 0x1E19}, {0x1E1A, 0x1E1B}, {0x1E1C, 0x1E1D}, {0x1E1E, 0x1E1F}, {0x1E20, 0x1E21}, {0x1E22, 0x1E23}, {0x1E24, 0x1E25}, {0x1E26, 0x1E27}, {0x1E28, 0x1E29}, {0x1E2A, 0x1E2B}, {0x1E2C, 0x1E2D}, {0x1E2E, 0x1E2F}, {0x1E30, 0x1E31}, {0x1E32, 0x1E33}, {0x1E34, 0x1E35}, {0x1E36, 0x1E37}, {0x1E38, 0x1E39}, {0x1E3A, 0x1E3B}, {0x1E3C, 0x1E3D}, {0x1E3E, 0x1E3F}, {0x1E40, 0x1E41}, {0x1E42, 0x1E43}, {0x1E44, 0x1E45}, {0x1E46, 0x1E47}, {0x1E48, 0x1E49}, {0x1E4A, 0x1E4B}, {0x1E4C, 0x1E4D}, {0x1E4E, 0x1E4F}, {0x1E50, 0x1E51}, {0x1E52, 0x1E53}, {0x1E54, 0x1E55}, {0x1E56, 0x1E57}, {0x1E58, 0x1E59}, {0x1E5A, 0x1E5B}, {0x1E5C, 0x1E5D}, {0x1E5E, 0x1E5F}, {0x1E60, 0x1E61}, {0x1E62, 0x1E63}, {0x1E64, 0x1E65}, {0x1E66, 0x1E67}, {0x1E68, 0x1E69}, {0x1E6A, 0x1E6B}, {0x1E6C, 0x1E6D}, {0x1E6E, 0x1E6F}, {0x1E70, 0x1E71}, {0x1E72, 0x1E73}, {0x1E74, 0x1E75}, {0x1E76, 0x1E77}, {0x1E78, 0x1E79}, {0x1E7A, 0x1E7B}, {0x1E7C, 0x1E7D}, {0x1E7E, 0x1E7F}, {0x1E80, 0x1E81}, {0x1E82, 0x1E83}, {0x1E84, 0x1E85}, {0x1E86, 0x1E87}, {0x1E88, 0x1E89}, {0x1E8A, 0x1E8B}, {0x1E8C, 0x1E8D}, {0x1E8E, 0x1E8F}, {0x1E90, 0x1E91}, {0x1E92, 0x1E93}, {0x1E94, 0x1E95}, {0x1E9B, 0x1E61}, {0x1EA0, 0x1EA1}, {0x1EA2, 0x1EA3}, {0x1EA4, 0x1EA5}, {0x1EA6, 0x1EA7}, {0x1EA8, 0x1EA9}, {0x1EAA, 0x1EAB}, {0x1EAC, 0x1EAD}, {0x1EAE, 0x1EAF}, {0x1EB0, 0x1EB1}, {0x1EB2, 0x1EB3}, {0x1EB4, 0x1EB5}, {0x1EB6, 0x1EB7}, {0x1EB8, 0x1EB9}, {0x1EBA, 0x1EBB}, {0x1EBC, 0x1EBD}, {0x1EBE, 0x1EBF}, {0x1EC0, 0x1EC1}, {0x1EC2, 0x1EC3}, {0x1EC4, 0x1EC5}, {0x1EC6, 0x1EC7}, {0x1EC8, 0x1EC9}, {0x1ECA, 0x1ECB}, {0x1ECC, 0x1ECD}, {0x1ECE, 0x1ECF}, {0x1ED0, 0x1ED1}, {0x1ED2, 0x1ED3}, {0x1ED4, 0x1ED5}, {0x1ED6, 0x1ED7}, {0x1ED8, 0x1ED9}, {0x1EDA, 0x1EDB}, {0x1EDC, 0x1EDD}, {0x1EDE, 0x1EDF}, {0x1EE0, 0x1EE1}, {0x1EE2, 0x1EE3}, {0x1EE4, 0x1EE5}, {0x1EE6, 0x1EE7}, {0x1EE8, 0x1EE9}, {0x1EEA, 0x1EEB}, {0x1EEC, 0x1EED}, {0x1EEE, 0x1EEF}, {0x1EF0, 0x1EF1}, {0x1EF2, 0x1EF3}, {0x1EF4, 0x1EF5}, {0x1EF6, 0x1EF7}, {0x1EF8, 0x1EF9}, {0x1F08, 0x1F00}, {0x1F09, 0x1F01}, {0x1F0A, 0x1F02}, {0x1F0B, 0x1F03}, {0x1F0C, 0x1F04}, {0x1F0D, 0x1F05}, {0x1F0E, 0x1F06}, {0x1F0F, 0x1F07}, {0x1F18, 0x1F10}, {0x1F19, 0x1F11}, {0x1F1A, 0x1F12}, {0x1F1B, 0x1F13}, {0x1F1C, 0x1F14}, {0x1F1D, 0x1F15}, {0x1F28, 0x1F20}, {0x1F29, 0x1F21}, {0x1F2A, 0x1F22}, {0x1F2B, 0x1F23}, {0x1F2C, 0x1F24}, {0x1F2D, 0x1F25}, {0x1F2E, 0x1F26}, {0x1F2F, 0x1F27}, {0x1F38, 0x1F30}, {0x1F39, 0x1F31}, {0x1F3A, 0x1F32}, {0x1F3B, 0x1F33}, {0x1F3C, 0x1F34}, {0x1F3D, 0x1F35}, {0x1F3E, 0x1F36}, {0x1F3F, 0x1F37}, {0x1F48, 0x1F40}, {0x1F49, 0x1F41}, {0x1F4A, 0x1F42}, {0x1F4B, 0x1F43}, {0x1F4C, 0x1F44}, {0x1F4D, 0x1F45}, {0x1F59, 0x1F51}, {0x1F5B, 0x1F53}, {0x1F5D, 0x1F55}, {0x1F5F, 0x1F57}, {0x1F68, 0x1F60}, {0x1F69, 0x1F61}, {0x1F6A, 0x1F62}, {0x1F6B, 0x1F63}, {0x1F6C, 0x1F64}, {0x1F6D, 0x1F65}, {0x1F6E, 0x1F66}, {0x1F6F, 0x1F67}, {0x1F88, 0x1F80}, {0x1F89, 0x1F81}, {0x1F8A, 0x1F82}, {0x1F8B, 0x1F83}, {0x1F8C, 0x1F84}, {0x1F8D, 0x1F85}, {0x1F8E, 0x1F86}, {0x1F8F, 0x1F87}, {0x1F98, 0x1F90}, {0x1F99, 0x1F91}, {0x1F9A, 0x1F92}, {0x1F9B, 0x1F93}, {0x1F9C, 0x1F94}, {0x1F9D, 0x1F95}, {0x1F9E, 0x1F96}, {0x1F9F, 0x1F97}, {0x1FA8, 0x1FA0}, {0x1FA9, 0x1FA1}, {0x1FAA, 0x1FA2}, {0x1FAB, 0x1FA3}, {0x1FAC, 0x1FA4}, {0x1FAD, 0x1FA5}, {0x1FAE, 0x1FA6}, {0x1FAF, 0x1FA7}, {0x1FB8, 0x1FB0}, {0x1FB9, 0x1FB1}, {0x1FBA, 0x1F70}, {0x1FBB, 0x1F71}, {0x1FBC, 0x1FB3}, {0x1FBE, 0x03B9}, {0x1FC8, 0x1F72}, {0x1FC9, 0x1F73}, {0x1FCA, 0x1F74}, {0x1FCB, 0x1F75}, {0x1FCC, 0x1FC3}, {0x1FD8, 0x1FD0}, {0x1FD9, 0x1FD1}, {0x1FDA, 0x1F76}, {0x1FDB, 0x1F77}, {0x1FE8, 0x1FE0}, {0x1FE9, 0x1FE1}, {0x1FEA, 0x1F7A}, {0x1FEB, 0x1F7B}, {0x1FEC, 0x1FE5}, {0x1FF8, 0x1F78}, {0x1FF9, 0x1F79}, {0x1FFA, 0x1F7C}, {0x1FFB, 0x1F7D}, {0x1FFC, 0x1FF3}, {0x2126, 0x03C9}, /*{0x212A, 0x006B}, {0x212B, 0x00E5}, */{0x2160, 0x2170}, {0x2161, 0x2171}, {0x2162, 0x2172}, {0x2163, 0x2173}, {0x2164, 0x2174}, {0x2165, 0x2175}, {0x2166, 0x2176}, {0x2167, 0x2177}, {0x2168, 0x2178}, {0x2169, 0x2179}, {0x216A, 0x217A}, {0x216B, 0x217B}, {0x216C, 0x217C}, {0x216D, 0x217D}, {0x216E, 0x217E}, {0x216F, 0x217F}, {0x24B6, 0x24D0}, {0x24B7, 0x24D1}, {0x24B8, 0x24D2}, {0x24B9, 0x24D3}, {0x24BA, 0x24D4}, {0x24BB, 0x24D5}, {0x24BC, 0x24D6}, {0x24BD, 0x24D7}, {0x24BE, 0x24D8}, {0x24BF, 0x24D9}, {0x24C0, 0x24DA}, {0x24C1, 0x24DB}, {0x24C2, 0x24DC}, {0x24C3, 0x24DD}, {0x24C4, 0x24DE}, {0x24C5, 0x24DF}, {0x24C6, 0x24E0}, {0x24C7, 0x24E1}, {0x24C8, 0x24E2}, {0x24C9, 0x24E3}, {0x24CA, 0x24E4}, {0x24CB, 0x24E5}, {0x24CC, 0x24E6}, {0x24CD, 0x24E7}, {0x24CE, 0x24E8}, {0x24CF, 0x24E9}, {0xFF21, 0xFF41}, {0xFF22, 0xFF42}, {0xFF23, 0xFF43}, {0xFF24, 0xFF44}, {0xFF25, 0xFF45}, {0xFF26, 0xFF46}, {0xFF27, 0xFF47}, {0xFF28, 0xFF48}, {0xFF29, 0xFF49}, {0xFF2A, 0xFF4A}, {0xFF2B, 0xFF4B}, {0xFF2C, 0xFF4C}, {0xFF2D, 0xFF4D}, {0xFF2E, 0xFF4E}, {0xFF2F, 0xFF4F}, {0xFF30, 0xFF50}, {0xFF31, 0xFF51}, {0xFF32, 0xFF52}, {0xFF33, 0xFF53}, {0xFF34, 0xFF54}, {0xFF35, 0xFF55}, {0xFF36, 0xFF56}, {0xFF37, 0xFF57}, {0xFF38, 0xFF58}, {0xFF39, 0xFF59}, {0xFF3A, 0xFF5A} parser-3.4.3/src/main/pa_xml_exception.C000644 000000 000000 00000002467 12227340624 020304 0ustar00rootwheel000000 000000 /** @file Parser: exception class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "pa_xml_exception.h" #include "pa_globals.h" #include "pa_common.h" #include "pa_charset.h" volatile const char * IDENT_PA_XML_EXCEPTION_C="$Id: pa_xml_exception.C,v 1.9 2013/10/15 22:28:36 moko Exp $" IDENT_PA_XML_EXCEPTION_H; // methods XmlException::XmlException(const String* aproblem_source, const char* aproblem_comment, ...) { ftype="xml"; fproblem_source=aproblem_source; fcomment=new(PointerFreeGC) char[MAX_STRING]; va_list args; va_start(args, aproblem_comment); vsnprintf((char *)fcomment, MAX_STRING, aproblem_comment, args); va_end(args); } XmlException::XmlException(const String* aproblem_source, Request& r){ ftype="xml"; fproblem_source=aproblem_source; if(const char* xml_generic_errors=xmlGenericErrors()){ fcomment=pa_strdup(xml_generic_errors); if(r.charsets.source().isUTF8()) fcomment=fixUTF8(fcomment); } else fcomment="-UNKNOWN ERROR-"; } XmlException::XmlException(){ ftype="xml"; fproblem_source=0; if(const char* xml_generic_errors=xmlGenericErrors()) fcomment=pa_strdup(xml_generic_errors); else fcomment="-UNKNOWN ERROR-"; } #endif parser-3.4.3/src/main/utf8-to-upper.inc000644 000000 000000 00000031337 10562132322 017764 0ustar00rootwheel000000 000000 /* some char's commented because of parser have a problem while changing case if from-char and to-char have different length */ {0x0061, 0x0041}, {0x0062, 0x0042}, {0x0063, 0x0043}, {0x0064, 0x0044}, {0x0065, 0x0045}, {0x0066, 0x0046}, {0x0067, 0x0047}, {0x0068, 0x0048}, {0x0069, 0x0049}, {0x006A, 0x004A}, {0x006B, 0x004B}, {0x006C, 0x004C}, {0x006D, 0x004D}, {0x006E, 0x004E}, {0x006F, 0x004F}, {0x0070, 0x0050}, {0x0071, 0x0051}, {0x0072, 0x0052}, {0x0073, 0x0053}, {0x0074, 0x0054}, {0x0075, 0x0055}, {0x0076, 0x0056}, {0x0077, 0x0057}, {0x0078, 0x0058}, {0x0079, 0x0059}, {0x007A, 0x005A}, {0x00E0, 0x00C0}, {0x00E1, 0x00C1}, {0x00E2, 0x00C2}, {0x00E3, 0x00C3}, {0x00E4, 0x00C4}, {0x00E5, 0x00C5}, {0x00E6, 0x00C6}, {0x00E7, 0x00C7}, {0x00E8, 0x00C8}, {0x00E9, 0x00C9}, {0x00EA, 0x00CA}, {0x00EB, 0x00CB}, {0x00EC, 0x00CC}, {0x00ED, 0x00CD}, {0x00EE, 0x00CE}, {0x00EF, 0x00CF}, {0x00F0, 0x00D0}, {0x00F1, 0x00D1}, {0x00F2, 0x00D2}, {0x00F3, 0x00D3}, {0x00F4, 0x00D4}, {0x00F5, 0x00D5}, {0x00F6, 0x00D6}, {0x00F8, 0x00D8}, {0x00F9, 0x00D9}, {0x00FA, 0x00DA}, {0x00FB, 0x00DB}, {0x00FC, 0x00DC}, {0x00FD, 0x00DD}, {0x00FE, 0x00DE}, /*{0x00FF, 0x0178}, */{0x0101, 0x0100}, {0x0103, 0x0102}, {0x0105, 0x0104}, {0x0107, 0x0106}, {0x0109, 0x0108}, {0x010B, 0x010A}, {0x010D, 0x010C}, {0x010F, 0x010E}, {0x0111, 0x0110}, {0x0113, 0x0112}, {0x0115, 0x0114}, {0x0117, 0x0116}, {0x0119, 0x0118}, {0x011B, 0x011A}, {0x011D, 0x011C}, {0x011F, 0x011E}, {0x0121, 0x0120}, {0x0123, 0x0122}, {0x0125, 0x0124}, {0x0127, 0x0126}, {0x0129, 0x0128}, {0x012B, 0x012A}, {0x012D, 0x012C}, {0x012F, 0x012E}, /*{0x0131, 0x0049}, */{0x0133, 0x0132}, {0x0135, 0x0134}, {0x0137, 0x0136}, {0x013A, 0x0139}, {0x013C, 0x013B}, {0x013E, 0x013D}, {0x0140, 0x013F}, {0x0142, 0x0141}, {0x0144, 0x0143}, {0x0146, 0x0145}, {0x0148, 0x0147}, {0x014B, 0x014A}, {0x014D, 0x014C}, {0x014F, 0x014E}, {0x0151, 0x0150}, {0x0153, 0x0152}, {0x0155, 0x0154}, {0x0157, 0x0156}, {0x0159, 0x0158}, {0x015B, 0x015A}, {0x015D, 0x015C}, {0x015F, 0x015E}, {0x0161, 0x0160}, {0x0163, 0x0162}, {0x0165, 0x0164}, {0x0167, 0x0166}, {0x0169, 0x0168}, {0x016B, 0x016A}, {0x016D, 0x016C}, {0x016F, 0x016E}, {0x0171, 0x0170}, {0x0173, 0x0172}, {0x0175, 0x0174}, {0x0177, 0x0176}, {0x017A, 0x0179}, {0x017C, 0x017B}, {0x017E, 0x017D}, {0x0183, 0x0182}, {0x0185, 0x0184}, {0x0188, 0x0187}, {0x018C, 0x018B}, {0x0192, 0x0191}, {0x0195, 0x01F6}, {0x0199, 0x0198}, {0x019E, 0x0220}, {0x01A1, 0x01A0}, {0x01A3, 0x01A2}, {0x01A5, 0x01A4}, {0x01A8, 0x01A7}, {0x01AD, 0x01AC}, {0x01B0, 0x01AF}, {0x01B4, 0x01B3}, {0x01B6, 0x01B5}, {0x01B9, 0x01B8}, {0x01BD, 0x01BC}, {0x01BF, 0x01F7}, {0x01C6, 0x01C4}, {0x01C9, 0x01C7}, {0x01CC, 0x01CA}, {0x01CE, 0x01CD}, {0x01D0, 0x01CF}, {0x01D2, 0x01D1}, {0x01D4, 0x01D3}, {0x01D6, 0x01D5}, {0x01D8, 0x01D7}, {0x01DA, 0x01D9}, {0x01DC, 0x01DB}, {0x01DD, 0x018E}, {0x01DF, 0x01DE}, {0x01E1, 0x01E0}, {0x01E3, 0x01E2}, {0x01E5, 0x01E4}, {0x01E7, 0x01E6}, {0x01E9, 0x01E8}, {0x01EB, 0x01EA}, {0x01ED, 0x01EC}, {0x01EF, 0x01EE}, {0x01F3, 0x01F1}, {0x01F5, 0x01F4}, {0x01F9, 0x01F8}, {0x01FB, 0x01FA}, {0x01FD, 0x01FC}, {0x01FF, 0x01FE}, {0x0201, 0x0200}, {0x0203, 0x0202}, {0x0205, 0x0204}, {0x0207, 0x0206}, {0x0209, 0x0208}, {0x020B, 0x020A}, {0x020D, 0x020C}, {0x020F, 0x020E}, {0x0211, 0x0210}, {0x0213, 0x0212}, {0x0215, 0x0214}, {0x0217, 0x0216}, {0x0219, 0x0218}, {0x021B, 0x021A}, {0x021D, 0x021C}, {0x021F, 0x021E}, {0x0223, 0x0222}, {0x0225, 0x0224}, {0x0227, 0x0226}, {0x0229, 0x0228}, {0x022B, 0x022A}, {0x022D, 0x022C}, {0x022F, 0x022E}, {0x0231, 0x0230}, {0x0233, 0x0232}, {0x0253, 0x0181}, {0x0254, 0x0186}, {0x0256, 0x0189}, {0x0257, 0x018A}, {0x0259, 0x018F}, {0x025B, 0x0190}, {0x0260, 0x0193}, {0x0263, 0x0194}, {0x0268, 0x0197}, {0x0269, 0x0196}, {0x026F, 0x019C}, {0x0272, 0x019D}, {0x0275, 0x019F}, {0x0280, 0x01A6}, {0x0283, 0x01A9}, {0x0288, 0x01AE}, {0x028A, 0x01B1}, {0x028B, 0x01B2}, {0x0292, 0x01B7}, {0x03AC, 0x0386}, {0x03AD, 0x0388}, {0x03AE, 0x0389}, {0x03AF, 0x038A}, {0x03B1, 0x0391}, {0x03B2, 0x0392}, {0x03B3, 0x0393}, {0x03B4, 0x0394}, {0x03B5, 0x0395}, {0x03B6, 0x0396}, {0x03B7, 0x0397}, {0x03B8, 0x0398}, {0x03B9, 0x0345}, {0x03BA, 0x039A}, {0x03BB, 0x039B}, /*{0x03BC, 0x00B5}, */{0x03BD, 0x039D}, {0x03BE, 0x039E}, {0x03BF, 0x039F}, {0x03C0, 0x03A0}, {0x03C1, 0x03A1}, {0x03C3, 0x03A3}, {0x03C4, 0x03A4}, {0x03C5, 0x03A5}, {0x03C6, 0x03A6}, {0x03C7, 0x03A7}, {0x03C8, 0x03A8}, {0x03C9, 0x03A9}, {0x03CA, 0x03AA}, {0x03CB, 0x03AB}, {0x03CC, 0x038C}, {0x03CD, 0x038E}, {0x03CE, 0x038F}, {0x03D9, 0x03D8}, {0x03DB, 0x03DA}, {0x03DD, 0x03DC}, {0x03DF, 0x03DE}, {0x03E1, 0x03E0}, {0x03E3, 0x03E2}, {0x03E5, 0x03E4}, {0x03E7, 0x03E6}, {0x03E9, 0x03E8}, {0x03EB, 0x03EA}, {0x03ED, 0x03EC}, {0x03EF, 0x03EE}, {0x03F2, 0x03F9}, {0x03F8, 0x03F7}, {0x03FB, 0x03FA}, {0x0430, 0x0410}, {0x0431, 0x0411}, {0x0432, 0x0412}, {0x0433, 0x0413}, {0x0434, 0x0414}, {0x0435, 0x0415}, {0x0436, 0x0416}, {0x0437, 0x0417}, {0x0438, 0x0418}, {0x0439, 0x0419}, {0x043A, 0x041A}, {0x043B, 0x041B}, {0x043C, 0x041C}, {0x043D, 0x041D}, {0x043E, 0x041E}, {0x043F, 0x041F}, {0x0440, 0x0420}, {0x0441, 0x0421}, {0x0442, 0x0422}, {0x0443, 0x0423}, {0x0444, 0x0424}, {0x0445, 0x0425}, {0x0446, 0x0426}, {0x0447, 0x0427}, {0x0448, 0x0428}, {0x0449, 0x0429}, {0x044A, 0x042A}, {0x044B, 0x042B}, {0x044C, 0x042C}, {0x044D, 0x042D}, {0x044E, 0x042E}, {0x044F, 0x042F}, {0x0450, 0x0400}, {0x0451, 0x0401}, {0x0452, 0x0402}, {0x0453, 0x0403}, {0x0454, 0x0404}, {0x0455, 0x0405}, {0x0456, 0x0406}, {0x0457, 0x0407}, {0x0458, 0x0408}, {0x0459, 0x0409}, {0x045A, 0x040A}, {0x045B, 0x040B}, {0x045C, 0x040C}, {0x045D, 0x040D}, {0x045E, 0x040E}, {0x045F, 0x040F}, {0x0461, 0x0460}, {0x0463, 0x0462}, {0x0465, 0x0464}, {0x0467, 0x0466}, {0x0469, 0x0468}, {0x046B, 0x046A}, {0x046D, 0x046C}, {0x046F, 0x046E}, {0x0471, 0x0470}, {0x0473, 0x0472}, {0x0475, 0x0474}, {0x0477, 0x0476}, {0x0479, 0x0478}, {0x047B, 0x047A}, {0x047D, 0x047C}, {0x047F, 0x047E}, {0x0481, 0x0480}, {0x048B, 0x048A}, {0x048D, 0x048C}, {0x048F, 0x048E}, {0x0491, 0x0490}, {0x0493, 0x0492}, {0x0495, 0x0494}, {0x0497, 0x0496}, {0x0499, 0x0498}, {0x049B, 0x049A}, {0x049D, 0x049C}, {0x049F, 0x049E}, {0x04A1, 0x04A0}, {0x04A3, 0x04A2}, {0x04A5, 0x04A4}, {0x04A7, 0x04A6}, {0x04A9, 0x04A8}, {0x04AB, 0x04AA}, {0x04AD, 0x04AC}, {0x04AF, 0x04AE}, {0x04B1, 0x04B0}, {0x04B3, 0x04B2}, {0x04B5, 0x04B4}, {0x04B7, 0x04B6}, {0x04B9, 0x04B8}, {0x04BB, 0x04BA}, {0x04BD, 0x04BC}, {0x04BF, 0x04BE}, {0x04C2, 0x04C1}, {0x04C4, 0x04C3}, {0x04C6, 0x04C5}, {0x04C8, 0x04C7}, {0x04CA, 0x04C9}, {0x04CC, 0x04CB}, {0x04CE, 0x04CD}, {0x04D1, 0x04D0}, {0x04D3, 0x04D2}, {0x04D5, 0x04D4}, {0x04D7, 0x04D6}, {0x04D9, 0x04D8}, {0x04DB, 0x04DA}, {0x04DD, 0x04DC}, {0x04DF, 0x04DE}, {0x04E1, 0x04E0}, {0x04E3, 0x04E2}, {0x04E5, 0x04E4}, {0x04E7, 0x04E6}, {0x04E9, 0x04E8}, {0x04EB, 0x04EA}, {0x04ED, 0x04EC}, {0x04EF, 0x04EE}, {0x04F1, 0x04F0}, {0x04F3, 0x04F2}, {0x04F5, 0x04F4}, {0x04F9, 0x04F8}, {0x0501, 0x0500}, {0x0503, 0x0502}, {0x0505, 0x0504}, {0x0507, 0x0506}, {0x0509, 0x0508}, {0x050B, 0x050A}, {0x050D, 0x050C}, {0x050F, 0x050E}, {0x0561, 0x0531}, {0x0562, 0x0532}, {0x0563, 0x0533}, {0x0564, 0x0534}, {0x0565, 0x0535}, {0x0566, 0x0536}, {0x0567, 0x0537}, {0x0568, 0x0538}, {0x0569, 0x0539}, {0x056A, 0x053A}, {0x056B, 0x053B}, {0x056C, 0x053C}, {0x056D, 0x053D}, {0x056E, 0x053E}, {0x056F, 0x053F}, {0x0570, 0x0540}, {0x0571, 0x0541}, {0x0572, 0x0542}, {0x0573, 0x0543}, {0x0574, 0x0544}, {0x0575, 0x0545}, {0x0576, 0x0546}, {0x0577, 0x0547}, {0x0578, 0x0548}, {0x0579, 0x0549}, {0x057A, 0x054A}, {0x057B, 0x054B}, {0x057C, 0x054C}, {0x057D, 0x054D}, {0x057E, 0x054E}, {0x057F, 0x054F}, {0x0580, 0x0550}, {0x0581, 0x0551}, {0x0582, 0x0552}, {0x0583, 0x0553}, {0x0584, 0x0554}, {0x0585, 0x0555}, {0x0586, 0x0556}, {0x1E01, 0x1E00}, {0x1E03, 0x1E02}, {0x1E05, 0x1E04}, {0x1E07, 0x1E06}, {0x1E09, 0x1E08}, {0x1E0B, 0x1E0A}, {0x1E0D, 0x1E0C}, {0x1E0F, 0x1E0E}, {0x1E11, 0x1E10}, {0x1E13, 0x1E12}, {0x1E15, 0x1E14}, {0x1E17, 0x1E16}, {0x1E19, 0x1E18}, {0x1E1B, 0x1E1A}, {0x1E1D, 0x1E1C}, {0x1E1F, 0x1E1E}, {0x1E21, 0x1E20}, {0x1E23, 0x1E22}, {0x1E25, 0x1E24}, {0x1E27, 0x1E26}, {0x1E29, 0x1E28}, {0x1E2B, 0x1E2A}, {0x1E2D, 0x1E2C}, {0x1E2F, 0x1E2E}, {0x1E31, 0x1E30}, {0x1E33, 0x1E32}, {0x1E35, 0x1E34}, {0x1E37, 0x1E36}, {0x1E39, 0x1E38}, {0x1E3B, 0x1E3A}, {0x1E3D, 0x1E3C}, {0x1E3F, 0x1E3E}, {0x1E41, 0x1E40}, {0x1E43, 0x1E42}, {0x1E45, 0x1E44}, {0x1E47, 0x1E46}, {0x1E49, 0x1E48}, {0x1E4B, 0x1E4A}, {0x1E4D, 0x1E4C}, {0x1E4F, 0x1E4E}, {0x1E51, 0x1E50}, {0x1E53, 0x1E52}, {0x1E55, 0x1E54}, {0x1E57, 0x1E56}, {0x1E59, 0x1E58}, {0x1E5B, 0x1E5A}, {0x1E5D, 0x1E5C}, {0x1E5F, 0x1E5E}, {0x1E61, 0x1E60}, {0x1E63, 0x1E62}, {0x1E65, 0x1E64}, {0x1E67, 0x1E66}, {0x1E69, 0x1E68}, {0x1E6B, 0x1E6A}, {0x1E6D, 0x1E6C}, {0x1E6F, 0x1E6E}, {0x1E71, 0x1E70}, {0x1E73, 0x1E72}, {0x1E75, 0x1E74}, {0x1E77, 0x1E76}, {0x1E79, 0x1E78}, {0x1E7B, 0x1E7A}, {0x1E7D, 0x1E7C}, {0x1E7F, 0x1E7E}, {0x1E81, 0x1E80}, {0x1E83, 0x1E82}, {0x1E85, 0x1E84}, {0x1E87, 0x1E86}, {0x1E89, 0x1E88}, {0x1E8B, 0x1E8A}, {0x1E8D, 0x1E8C}, {0x1E8F, 0x1E8E}, {0x1E91, 0x1E90}, {0x1E93, 0x1E92}, {0x1E95, 0x1E94}, {0x1EA1, 0x1EA0}, {0x1EA3, 0x1EA2}, {0x1EA5, 0x1EA4}, {0x1EA7, 0x1EA6}, {0x1EA9, 0x1EA8}, {0x1EAB, 0x1EAA}, {0x1EAD, 0x1EAC}, {0x1EAF, 0x1EAE}, {0x1EB1, 0x1EB0}, {0x1EB3, 0x1EB2}, {0x1EB5, 0x1EB4}, {0x1EB7, 0x1EB6}, {0x1EB9, 0x1EB8}, {0x1EBB, 0x1EBA}, {0x1EBD, 0x1EBC}, {0x1EBF, 0x1EBE}, {0x1EC1, 0x1EC0}, {0x1EC3, 0x1EC2}, {0x1EC5, 0x1EC4}, {0x1EC7, 0x1EC6}, {0x1EC9, 0x1EC8}, {0x1ECB, 0x1ECA}, {0x1ECD, 0x1ECC}, {0x1ECF, 0x1ECE}, {0x1ED1, 0x1ED0}, {0x1ED3, 0x1ED2}, {0x1ED5, 0x1ED4}, {0x1ED7, 0x1ED6}, {0x1ED9, 0x1ED8}, {0x1EDB, 0x1EDA}, {0x1EDD, 0x1EDC}, {0x1EDF, 0x1EDE}, {0x1EE1, 0x1EE0}, {0x1EE3, 0x1EE2}, {0x1EE5, 0x1EE4}, {0x1EE7, 0x1EE6}, {0x1EE9, 0x1EE8}, {0x1EEB, 0x1EEA}, {0x1EED, 0x1EEC}, {0x1EEF, 0x1EEE}, {0x1EF1, 0x1EF0}, {0x1EF3, 0x1EF2}, {0x1EF5, 0x1EF4}, {0x1EF7, 0x1EF6}, {0x1EF9, 0x1EF8}, {0x1F00, 0x1F08}, {0x1F01, 0x1F09}, {0x1F02, 0x1F0A}, {0x1F03, 0x1F0B}, {0x1F04, 0x1F0C}, {0x1F05, 0x1F0D}, {0x1F06, 0x1F0E}, {0x1F07, 0x1F0F}, {0x1F10, 0x1F18}, {0x1F11, 0x1F19}, {0x1F12, 0x1F1A}, {0x1F13, 0x1F1B}, {0x1F14, 0x1F1C}, {0x1F15, 0x1F1D}, {0x1F20, 0x1F28}, {0x1F21, 0x1F29}, {0x1F22, 0x1F2A}, {0x1F23, 0x1F2B}, {0x1F24, 0x1F2C}, {0x1F25, 0x1F2D}, {0x1F26, 0x1F2E}, {0x1F27, 0x1F2F}, {0x1F30, 0x1F38}, {0x1F31, 0x1F39}, {0x1F32, 0x1F3A}, {0x1F33, 0x1F3B}, {0x1F34, 0x1F3C}, {0x1F35, 0x1F3D}, {0x1F36, 0x1F3E}, {0x1F37, 0x1F3F}, {0x1F40, 0x1F48}, {0x1F41, 0x1F49}, {0x1F42, 0x1F4A}, {0x1F43, 0x1F4B}, {0x1F44, 0x1F4C}, {0x1F45, 0x1F4D}, {0x1F51, 0x1F59}, {0x1F53, 0x1F5B}, {0x1F55, 0x1F5D}, {0x1F57, 0x1F5F}, {0x1F60, 0x1F68}, {0x1F61, 0x1F69}, {0x1F62, 0x1F6A}, {0x1F63, 0x1F6B}, {0x1F64, 0x1F6C}, {0x1F65, 0x1F6D}, {0x1F66, 0x1F6E}, {0x1F67, 0x1F6F}, {0x1F70, 0x1FBA}, {0x1F71, 0x1FBB}, {0x1F72, 0x1FC8}, {0x1F73, 0x1FC9}, {0x1F74, 0x1FCA}, {0x1F75, 0x1FCB}, {0x1F76, 0x1FDA}, {0x1F77, 0x1FDB}, {0x1F78, 0x1FF8}, {0x1F79, 0x1FF9}, {0x1F7A, 0x1FEA}, {0x1F7B, 0x1FEB}, {0x1F7C, 0x1FFA}, {0x1F7D, 0x1FFB}, {0x1F80, 0x1F88}, {0x1F81, 0x1F89}, {0x1F82, 0x1F8A}, {0x1F83, 0x1F8B}, {0x1F84, 0x1F8C}, {0x1F85, 0x1F8D}, {0x1F86, 0x1F8E}, {0x1F87, 0x1F8F}, {0x1F90, 0x1F98}, {0x1F91, 0x1F99}, {0x1F92, 0x1F9A}, {0x1F93, 0x1F9B}, {0x1F94, 0x1F9C}, {0x1F95, 0x1F9D}, {0x1F96, 0x1F9E}, {0x1F97, 0x1F9F}, {0x1FA0, 0x1FA8}, {0x1FA1, 0x1FA9}, {0x1FA2, 0x1FAA}, {0x1FA3, 0x1FAB}, {0x1FA4, 0x1FAC}, {0x1FA5, 0x1FAD}, {0x1FA6, 0x1FAE}, {0x1FA7, 0x1FAF}, {0x1FB0, 0x1FB8}, {0x1FB1, 0x1FB9}, {0x1FB3, 0x1FBC}, {0x1FC3, 0x1FCC}, {0x1FD0, 0x1FD8}, {0x1FD1, 0x1FD9}, {0x1FE0, 0x1FE8}, {0x1FE1, 0x1FE9}, {0x1FE5, 0x1FEC}, {0x1FF3, 0x1FFC}, {0x2170, 0x2160}, {0x2171, 0x2161}, {0x2172, 0x2162}, {0x2173, 0x2163}, {0x2174, 0x2164}, {0x2175, 0x2165}, {0x2176, 0x2166}, {0x2177, 0x2167}, {0x2178, 0x2168}, {0x2179, 0x2169}, {0x217A, 0x216A}, {0x217B, 0x216B}, {0x217C, 0x216C}, {0x217D, 0x216D}, {0x217E, 0x216E}, {0x217F, 0x216F}, {0x24D0, 0x24B6}, {0x24D1, 0x24B7}, {0x24D2, 0x24B8}, {0x24D3, 0x24B9}, {0x24D4, 0x24BA}, {0x24D5, 0x24BB}, {0x24D6, 0x24BC}, {0x24D7, 0x24BD}, {0x24D8, 0x24BE}, {0x24D9, 0x24BF}, {0x24DA, 0x24C0}, {0x24DB, 0x24C1}, {0x24DC, 0x24C2}, {0x24DD, 0x24C3}, {0x24DE, 0x24C4}, {0x24DF, 0x24C5}, {0x24E0, 0x24C6}, {0x24E1, 0x24C7}, {0x24E2, 0x24C8}, {0x24E3, 0x24C9}, {0x24E4, 0x24CA}, {0x24E5, 0x24CB}, {0x24E6, 0x24CC}, {0x24E7, 0x24CD}, {0x24E8, 0x24CE}, {0x24E9, 0x24CF}, {0xFF41, 0xFF21}, {0xFF42, 0xFF22}, {0xFF43, 0xFF23}, {0xFF44, 0xFF24}, {0xFF45, 0xFF25}, {0xFF46, 0xFF26}, {0xFF47, 0xFF27}, {0xFF48, 0xFF28}, {0xFF49, 0xFF29}, {0xFF4A, 0xFF2A}, {0xFF4B, 0xFF2B}, {0xFF4C, 0xFF2C}, {0xFF4D, 0xFF2D}, {0xFF4E, 0xFF2E}, {0xFF4F, 0xFF2F}, {0xFF50, 0xFF30}, {0xFF51, 0xFF31}, {0xFF52, 0xFF32}, {0xFF53, 0xFF33}, {0xFF54, 0xFF34}, {0xFF55, 0xFF35}, {0xFF56, 0xFF36}, {0xFF57, 0xFF37}, {0xFF58, 0xFF38}, {0xFF59, 0xFF39}, {0xFF5A, 0xFF3A} parser-3.4.3/src/main/Makefile.am000644 000000 000000 00000001337 11766067564 016711 0ustar00rootwheel000000 000000 INCLUDES = -I../types -I../classes -I../sql -I../lib/gc/include -I../lib/cord/include $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ noinst_HEADERS = compile_tools.h utf8-to-lower.inc utf8-to-upper.inc noinst_LTLIBRARIES = libmain.la libmain_la_SOURCES = pa_pool.C pa_os.C pa_common.C compile.tab.C compile.C compile_tools.C execute.C pa_cache_managers.C pa_exception.C pa_xml_exception.C pa_globals.C pa_xml_io.C pa_memory.C pa_request.C pa_string.C pa_table.C untaint.C pa_dir.C pa_exec.C pa_socks.C pa_dictionary.C pa_charset.C pa_charsets.C pa_uue.C pa_sql_driver_manager.C pa_stylesheet_manager.C pa_stylesheet_connection.C pa_http.C pa_random.C compile.tab.C: compile.y bison -v compile.y -o $@ EXTRA_DIST = compile.y main.vcproj parser-3.4.3/src/main/pa_stylesheet_connection.C000644 000000 000000 00000003234 12231021005 022007 0ustar00rootwheel000000 000000 /** @file Parser: Stylesheet connection implementation. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "pa_stylesheet_connection.h" #include "pa_xml_exception.h" volatile const char * IDENT_PA_STYLESHEET_CONNECTION_C="$Id: pa_stylesheet_connection.C,v 1.8 2013/10/20 18:33:41 moko Exp $" IDENT_PA_STYLESHEET_CONNECTION_H; void Stylesheet_connection::load(time_t new_disk_time) { xsltStylesheet *nstylesheet; { pa_xmlStartMonitoringDependencies(); { int saved=xmlDoValidityCheckingDefaultValue;// xmlDoValidityCheckingDefaultValue=0;// nstylesheet=xsltParseStylesheetFile(BAD_CAST ffile_spec.cstr()); xmlDoValidityCheckingDefaultValue = saved;// } dependencies=pa_xmlGetDependencies(); } if(xmlHaveGenericErrors()) throw XmlException(new String(ffile_spec, String::L_TAINTED), pa_thread_request()); if(!nstylesheet) throw Exception("file.missing", new String(ffile_spec, String::L_TAINTED), "stylesheet failed to load"); xsltFreeStylesheet(fstylesheet); fstylesheet=nstylesheet; prev_disk_time=new_disk_time; } static void update_max_mtime(HashStringValue::key_type stat_file_spec_cstr, bool /*value*/, time_t* max) { size_t size; time_t atime, mtime, ctime; file_stat(*new String(stat_file_spec_cstr, String::L_AS_IS), size, atime, mtime, ctime, true/*exception on error*/); if(mtime>*max) *max=mtime; } time_t Stylesheet_connection::get_disk_time() { assert(dependencies); time_t result=0; dependencies->for_each(update_max_mtime, &result); return result; } #endif parser-3.4.3/src/main/pa_sql_driver_manager.C000644 000000 000000 00000022655 12165633046 021277 0ustar00rootwheel000000 000000 /** @file Parser: sql driver manager implementation. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_sql_driver_manager.h" #include "ltdl.h" #include "pa_threads.h" #include "pa_sql_connection.h" #include "pa_exception.h" #include "pa_common.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_charsets.h" volatile const char * IDENT_PA_SQL_DRIVER_MANAGER_C="$Id: pa_sql_driver_manager.C,v 1.92 2013/07/05 21:09:58 moko Exp $" IDENT_PA_SQL_DRIVER_MANAGER_H IDENT_PA_SQL_CONNECTION_H; // globals SQL_Driver_manager* SQL_driver_manager=0; // consts const time_t EXPIRE_UNUSED_CONNECTION_SECONDS=60; const time_t CHECK_EXPIRED_CONNECTIONS_SECONDS=EXPIRE_UNUSED_CONNECTION_SECONDS*2; // helpers const String& SQL_Driver_services_impl::url_without_login() const { String& result=*new String; result << furl->mid(0, furl->pos(':')) << "://****"; size_t at_pos=0; size_t new_at_pos; while( (new_at_pos=furl->pos('@', at_pos+1))!=STRING_NOT_FOUND) at_pos=new_at_pos; if(at_pos) result << furl->mid(at_pos, furl->length()); return result; } void SQL_Driver_services_impl::transcode(const char* src, size_t src_length, const char*& dst, size_t& dst_length, const char* charset_from_name, const char* charset_to_name ) { try { // to speed up sql transcode [lots of charsets::get-s -- twice for each cell] // without complicating sql driver API // we need to cache couple of name->charset pairs // assuming pointers to names are are NOT to local vars struct cache_record { const char* name; Charset* object; } cache[2]={{0,0}, {0,0}}; Charset* charset_from_object; Charset* charset_to_object; if(charset_from_name==cache[0].name) { charset_from_object=cache[0].object; } else { cache[0].name=charset_from_name; cache[0].object=charset_from_object=&charsets.get(charset_from_name); } if(charset_to_name==cache[1].name) { charset_to_object=cache[1].object; } else { cache[1].name=charset_to_name; cache[1].object=charset_to_object=&charsets.get(charset_to_name); } String::C result=Charset::transcode(String::C(src, src_length), *charset_from_object, *charset_to_object); dst=result.str; dst_length=result.length; } catch(const Exception& e) { _throw(SQL_Error(e.type(), e.comment())); } catch(...) { _throw(SQL_Error(0, "unknown error while transcoding in sql driver")); } } // helpers static void expire_connection(SQL_Connection& connection, time_t older_dies) { if(connection.connected() && connection.expired(older_dies)) connection.disconnect(); } static void expire_connections(SQL_Driver_manager::connection_cache_type::key_type /*key*/, SQL_Driver_manager::connection_cache_type::value_type stack, time_t older_dies) { for(size_t i=0; itop_index(); i++) expire_connection(*stack->get(i), older_dies); } // SQL_Driver_manager SQL_Driver_manager::SQL_Driver_manager(): prev_expiration_pass_time(0) {} SQL_Driver_manager::~SQL_Driver_manager() { connection_cache.for_each(expire_connections, time(0)+(time_t)10/*=in future=expire all*/); } /// @param aurl protocol://[driver-dependent] SQL_Connection* SQL_Driver_manager::get_connection(const String& aurl, Table *protocol2driver_and_client, const char* arequest_charset, const char* adocument_root) { // we have table for locating protocol's library if(!protocol2driver_and_client) throw Exception(PARSER_RUNTIME, &aurl, "$"MAIN_SQL_NAME":"MAIN_SQL_DRIVERS_NAME" table must be defined"); // first trying to get cached connection SQL_Connection* connection=get_connection_from_cache(aurl); if(connection) { connection->set_url(); if(!connection->ping()) { // we have some cached connection, is it pingable? connection->disconnect(); // kill unpingabe=dead connection connection=0; } } char *url_cstr; if(connection) url_cstr=0; // calm, compiler else { // no cached connection or it were unpingabe: connect/reconnect url_cstr=aurl.cstrm(); if(!strstr(url_cstr, "://")) throw Exception(PARSER_RUNTIME, aurl.length()?&aurl:0, "connection string must start with protocol://"); char *protocol_cstr=lsplit(&url_cstr, ':'); // skip "//" after ':' while(*url_cstr=='/') url_cstr++; const String& protocol=*new String(protocol_cstr); SQL_Driver *driver; // first trying to get cached driver if(!(driver=get_driver_from_cache(protocol))) { // no cached const String* library=0; const String* dlopen_file_spec=0; Table::Action_options options; if(protocol2driver_and_client->locate(0, protocol, options)) { if(!(library=protocol2driver_and_client->item(1)) || library->length()==0) throw Exception(PARSER_RUNTIME, 0, "driver library column for protocol '%s' is empty", protocol_cstr); dlopen_file_spec=protocol2driver_and_client->item(2); } else throw Exception(PARSER_RUNTIME, &aurl, "undefined protocol '%s'", protocol_cstr); pa_dlinit(); const char* filename=library->taint_cstr(String::L_FILE_SPEC); lt_dlhandle handle=lt_dlopen(filename); if (!handle) { const char* error=lt_dlerror(); throw Exception(0, library, error?error:"can not open the module"); } SQL_Driver_create_func create=(SQL_Driver_create_func)(lt_dlsym(handle, SQL_DRIVER_CREATE_NAME)); if(!create) throw Exception(0, library, "function '"SQL_DRIVER_CREATE_NAME"' was not found"); // create library-driver! driver=(*create)(); // validate driver api version int driver_api_version=driver->api_version(); if(driver_api_version!=SQL_DRIVER_API_VERSION) throw Exception(0, library, "driver implements API version 0x%04X not equal to 0x%04X", driver_api_version, SQL_DRIVER_API_VERSION); // initialise by connecting to sql client dynamic link library char* dlopen_file_spec_cstr= dlopen_file_spec && dlopen_file_spec->length()? dlopen_file_spec->taint_cstrm(String::L_AS_IS):0; if(const char* error=driver->initialize(dlopen_file_spec_cstr)) throw Exception(0, library, "driver failed to initialize client library '%s', %s", dlopen_file_spec_cstr?dlopen_file_spec_cstr:"unspecifed", error); // cache it put_driver_to_cache(protocol, driver); } connection=new SQL_Connection(aurl, *driver, arequest_charset, adocument_root); // associate with pool[request] (deassociates at close) connection->set_url(); } // if not connected yet, do that now, when connection has services if(!connection->connected()) connection->connect(url_cstr); // return autoclosing object for it return connection; } void SQL_Driver_manager::close_connection(connection_cache_type::key_type url, SQL_Connection* connection) { put_connection_to_cache(url, connection); } // driver cache SQL_Driver *SQL_Driver_manager::get_driver_from_cache(driver_cache_type::key_type protocol) { SYNCHRONIZED; return driver_cache.get(protocol); } void SQL_Driver_manager::put_driver_to_cache( driver_cache_type::key_type protocol, driver_cache_type::value_type driver) { SYNCHRONIZED; driver_cache.put(protocol, driver); } // connection cache /// @todo get rid of memory spending Stack [zeros deep inside got accumulated] SQL_Connection* SQL_Driver_manager::get_connection_from_cache(connection_cache_type::key_type url) { SYNCHRONIZED; if(connection_cache_type::value_type connections=connection_cache.get(url)) while(!connections->is_empty()) { // there are cached connections to that 'url' SQL_Connection* result=connections->pop(); if(result->connected()) // not expired? return result; } return 0; } void SQL_Driver_manager::put_connection_to_cache( connection_cache_type::key_type url, SQL_Connection* connection) { SYNCHRONIZED; connection_cache_type::value_type connections=connection_cache.get(url); if(!connections) { // there are no cached connections to that 'url' yet? connections=new connection_cache_element_base_type; connection_cache.put(url, connections); } connections->push(connection); } void SQL_Driver_manager::maybe_expire_cache() { time_t now=time(0); if(prev_expiration_pass_time(expire_connections, time_t(now-EXPIRE_UNUSED_CONNECTION_SECONDS)); prev_expiration_pass_time=now; } } static void add_connection_to_status_cache_table(SQL_Connection& connection, Table* table) { if(connection.connected()) { ArrayString& row=*new ArrayString; // url row+=&connection.services().url_without_login(); // time time_t time_used=connection.get_time_used(); row+=new String(pa_strdup(ctime(&time_used))); *table+=&row; } } static void add_connections_to_status_cache_table( SQL_Driver_manager::connection_cache_type::key_type /*key*/, SQL_Driver_manager::connection_cache_type::value_type stack, Table* table) { for(Array_iterator i(*stack); i.has_next(); ) add_connection_to_status_cache_table(*i.next(), table); } Value* SQL_Driver_manager::get_status() { Value* result=new VHash; // cache { ArrayString& columns=*new ArrayString; columns+=new String("url"); columns+=new String("time"); Table& table=*new Table(&columns, connection_cache.count()); connection_cache.for_each(add_connections_to_status_cache_table, &table); result->get_hash()->put(*new String("cache"), new VTable(&table)); } return result; } parser-3.4.3/src/main/execute.C000644 000000 000000 00000124656 12223630563 016415 0ustar00rootwheel000000 000000 /** @file Parser: executor part of request class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_opcode.h" #include "pa_array.h" #include "pa_request.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vvoid.h" #include "pa_vcode_frame.h" #include "pa_vmethod_frame.h" #include "pa_vobject.h" #include "pa_vdouble.h" #include "pa_vbool.h" #include "pa_vtable.h" #include "pa_vfile.h" #include "pa_vimage.h" #include "pa_wwrapper.h" volatile const char * IDENT_EXECUTE_C="$Id: execute.C,v 1.371 2013/10/04 21:21:55 moko Exp $" IDENT_PA_OPCODE_H IDENT_PA_OPERATION_H IDENT_PA_VCODE_FRAME_H IDENT_PA_WWRAPPER_H; //#define DEBUG_EXECUTE #ifdef DEBUG_EXECUTE char *opcode_name[]={ // literals "VALUE", "CURLY_CODE__STORE_PARAM", "EXPR_CODE__STORE_PARAM", "NESTED_CODE", // actions "WITH_ROOT", "WITH_SELF", "WITH_READ", "WITH_WRITE", "VALUE__GET_CLASS", "CONSTRUCT_VALUE", "CONSTRUCT_EXPR", "CURLY_CODE__CONSTRUCT", "WRITE_VALUE", "WRITE_EXPR_RESULT", "STRING__WRITE", #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT "VALUE__GET_ELEMENT_OR_OPERATOR", #else "GET_ELEMENT_OR_OPERATOR", #endif "GET_ELEMENT", "GET_ELEMENT__WRITE", #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT "VALUE__GET_ELEMENT", "VALUE__GET_ELEMENT__WRITE", "WITH_ROOT__VALUE__GET_ELEMENT", #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT "GET_OBJECT_ELEMENT", "GET_OBJECT_ELEMENT__WRITE", #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT "GET_OBJECT_VAR_ELEMENT", "GET_OBJECT_VAR_ELEMENT__WRITE", #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT "WITH_SELF__VALUE__GET_ELEMENT", "WITH_SELF__VALUE__GET_ELEMENT__WRITE", #endif "OBJECT_POOL", "STRING_POOL", "PREPARE_TO_CONSTRUCT_OBJECT", "CONSTRUCT_OBJECT", "CONSTRUCT_OBJECT__WRITE", "PREPARE_TO_EXPRESSION", "CALL", "CALL__WRITE", #ifdef OPTIMIZE_BYTECODE_CONSTRUCT "WITH_ROOT__VALUE__CONSTRUCT_EXPR", "WITH_ROOT__VALUE__CONSTRUCT_VALUE", "WITH_WRITE__VALUE__CONSTRUCT_EXPR", "WITH_WRITE__VALUE__CONSTRUCT_VALUE", "WITH_SELF__VALUE__CONSTRUCT_EXPR", "WITH_SELF__VALUE__CONSTRUCT_VALUE", #endif // expression ops: unary "NEG", "INV", "NOT", "DEF", "IN", "FEXISTS", "DEXISTS", // expression ops: binary "SUB", "ADD", "MUL", "DIV", "MOD", "INTDIV", "BIN_SL", "BIN_SR", "BIN_AND", "BIN_OR", "BIN_XOR", "LOG_AND", "LOG_OR", "LOG_XOR", "NUM_LT", "NUM_GT", "NUM_LE", "NUM_GE", "NUM_EQ", "NUM_NE", "STR_LT", "STR_GT", "STR_LE", "STR_GE", "STR_EQ", "STR_NE", "IS" }; const char* debug_value_to_cstr(Value& value){ const String* string=value.get_string(); if(string) return string->cstr(); else if(value.is_bool()) return value.as_bool()?"":""; else return ""; } void va_debug_printf(SAPI_Info& sapi_info, const char* fmt,va_list args) { char buf[MAX_STRING]; vsnprintf(buf, MAX_STRING, fmt, args); SAPI::log(sapi_info, "%s", buf); } void debug_printf(SAPI_Info& sapi_info, const char* fmt, ...) { va_list args; va_start(args, fmt); va_debug_printf(sapi_info, fmt, args); va_end(args); } void debug_dump(SAPI_Info& sapi_info, int level, ArrayOperation& ops) { Array_iterator i(ops); while(i.has_next()) { OP::OPCODE opcode=i.next().code; #if defined(OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT) || defined(OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT) if( 1==0 #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT || opcode==OP::OP_GET_OBJECT_ELEMENT || opcode==OP::OP_GET_OBJECT_ELEMENT__WRITE #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT || opcode==OP::OP_GET_OBJECT_VAR_ELEMENT || opcode==OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE #endif ){ i.next(); // skip origin Value& value1=*i.next().value; i.next(); // skip origin Value& value2=*i.next().value; debug_printf(sapi_info, "%*s%s" " \"%s\" \"%s\"", level*4, "", opcode_name[opcode], debug_value_to_cstr(value1), debug_value_to_cstr(value2)); continue; } #endif if( opcode==OP::OP_CONSTRUCT_OBJECT || opcode==OP::OP_CONSTRUCT_OBJECT__WRITE ){ i.next(); // skip origin Value& value1=*i.next().value; i.next(); // skip origin Value& value2=*i.next().value; debug_printf(sapi_info, "%*s%s" " \"%s\" \"%s\"", level*4, "", opcode_name[opcode], debug_value_to_cstr(value1), debug_value_to_cstr(value2)); if(ArrayOperation* local_ops=i.next().ops) debug_dump(sapi_info, level+1, *local_ops); continue; } if( opcode==OP::OP_VALUE || opcode==OP::OP_STRING__WRITE || opcode==OP::OP_VALUE__GET_CLASS #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT || opcode==OP::OP_VALUE__GET_ELEMENT || opcode==OP::OP_VALUE__GET_ELEMENT__WRITE || opcode==OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR || opcode==OP::OP_WITH_ROOT__VALUE__GET_ELEMENT #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT || opcode==OP::OP_WITH_SELF__VALUE__GET_ELEMENT || opcode==OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE #endif #ifdef OPTIMIZE_BYTECODE_CONSTRUCT || opcode==OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR || opcode==OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE || opcode==OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR || opcode==OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE || opcode==OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR || opcode==OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE #endif ) { Operation::Origin origin=i.next().origin; Value& value=*i.next().value; debug_printf(sapi_info, "%*s%s" " \"%s\" %s", level*4, "", opcode_name[opcode], debug_value_to_cstr(value), value.type()); continue; } debug_printf(sapi_info, "%*s%s", level*4, "", opcode_name[opcode]); switch(opcode) { case OP::OP_CURLY_CODE__STORE_PARAM: case OP::OP_EXPR_CODE__STORE_PARAM: case OP::OP_CURLY_CODE__CONSTRUCT: case OP::OP_NESTED_CODE: case OP::OP_OBJECT_POOL: case OP::OP_STRING_POOL: case OP::OP_CALL: case OP::OP_CALL__WRITE: if(ArrayOperation* local_ops=i.next().ops) debug_dump(sapi_info, level+1, *local_ops); } } } #define DEBUG_PRINT_STR(str) debug_printf(sapi_info, str); #define DEBUG_PRINT_STRING(value) debug_printf(sapi_info, " \"%s\" ", value.cstr()); #define DEBUG_PRINT_VALUE_AND_TYPE(value) debug_printf(sapi_info, " \"%s\" %s", debug_value_to_cstr(value), value.type()); #define DEBUG_PRINT_OPS(local_ops) \ debug_printf(sapi_info, \ " (%d)\n", local_ops?local_ops->count():0); \ if(local_ops) debug_dump(sapi_info, 1, *local_ops); #else #define DEBUG_PRINT_STR(str) #define DEBUG_PRINT_STRING(value) #define DEBUG_PRINT_VALUE_AND_TYPE(value) #define DEBUG_PRINT_OPS(local_ops) #endif // Request void Request::execute(ArrayOperation& ops) { register Stack& stack=this->stack; // helps a lot on MSVC: 'esi' const String* debug_name=0; Operation::Origin debug_origin={0, 0, 0}; try{ #ifdef DEBUG_EXECUTE debug_printf(sapi_info, "source----------------------------\n"); debug_dump(sapi_info, 0, ops); debug_printf(sapi_info, "execution-------------------------\n"); #endif for(Array_iterator i(ops); i.has_next(); ) { OP::OPCODE opcode=i.next().code; #ifdef DEBUG_EXECUTE debug_printf(sapi_info, "%d:%s", stack.top_index()+1, opcode_name[opcode]); #endif switch(opcode) { // param in next instruction case OP::OP_VALUE: { debug_origin=i.next().origin; Value& value=*i.next().value; DEBUG_PRINT_VALUE_AND_TYPE(value) stack.push(value); break; } case OP::OP_VALUE__GET_CLASS: { // maybe they do ^class:method[] call, remember the fact wcontext->set_somebody_entered_some_class(); debug_origin=i.next().origin; Value& value=*i.next().value; const String& name=*value.get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value* class_value=get_class(name); if(!class_value) throw Exception(PARSER_RUNTIME, &name, "class is undefined"); stack.push(*class_value); break; } // OP_WITH case OP::OP_WITH_ROOT: { stack.push(*method_frame); break; } case OP::OP_WITH_SELF: { stack.push(get_self()); break; } case OP::OP_WITH_READ: { stack.push(*rcontext); break; } case OP::OP_WITH_WRITE: { if(wcontext==method_frame) throw Exception(PARSER_RUNTIME, 0, "$.name outside of $name[...]"); stack.push(*wcontext); break; } // OTHER ACTIONS BUT WITHs #ifdef OPTIMIZE_BYTECODE_CONSTRUCT #define DO_CONSTRUCT(context, vvalue) { \ debug_origin=i.next().origin; \ const String& name=*i.next().value->get_string(); debug_name=&name; \ DEBUG_PRINT_STRING(name) \ Value& value=stack.pop().value(); \ put_element( context, name, vvalue ); \ break; \ } #define DO_CONSTRUCT_VALUE(context) DO_CONSTRUCT(context, &value) #define DO_CONSTRUCT_EXPR(context) { \ wcontext->set_in_expression(false); \ DO_CONSTRUCT(context, &value.as_expr_result()) \ } case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR: { if(wcontext==method_frame) throw Exception(PARSER_RUNTIME, 0, "$.name outside of $name[...]"); DO_CONSTRUCT_EXPR(*wcontext) } case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE: { if(wcontext==method_frame) throw Exception(PARSER_RUNTIME, 0, "$.name outside of $name[...]"); DO_CONSTRUCT_VALUE(*wcontext) } case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR: DO_CONSTRUCT_EXPR(*method_frame) case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE: DO_CONSTRUCT_VALUE(*method_frame) case OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR: DO_CONSTRUCT_EXPR(get_self()) case OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE: DO_CONSTRUCT_VALUE(get_self()) #endif // OPTIMIZE_BYTECODE_CONSTRUCT case OP::OP_CONSTRUCT_VALUE: { #ifdef OPTIMIZE_BYTECODE_CONSTRUCT const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=stack.pop().value(); #else Value& value=stack.pop().value(); const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); #endif put_element(ncontext, name, &value); break; } case OP::OP_CONSTRUCT_EXPR: { // see OP_PREPARE_TO_EXPRESSION wcontext->set_in_expression(false); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& expr=stack.pop().value(); #else Value& expr=stack.pop().value(); const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); #endif Value& value=expr.as_expr_result(); put_element(ncontext, name, &value); break; } case OP::OP_CURLY_CODE__CONSTRUCT: { ArrayOperation& local_ops=*i.next().ops; DEBUG_PRINT_OPS((&local_ops)) VJunction& value=*new VJunction( get_self(), 0, method_frame, rcontext, wcontext, &local_ops); wcontext->attach_junction(&value); const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); if(const VJunction* vjunction=ncontext.put_element(name, &value)) if(vjunction!=PUT_ELEMENT_REPLACED_ELEMENT) throw Exception(PARSER_RUNTIME, 0, "property value can not be code, use [] or () brackets"); break; } case OP::OP_NESTED_CODE: { ArrayOperation& local_ops=*i.next().ops; DEBUG_PRINT_OPS((&local_ops)) stack.push(local_ops); break; } case OP::OP_WRITE_VALUE: { Value& value=stack.pop().value(); write_assign_lang(value); break; } case OP::OP_WRITE_EXPR_RESULT: { // see OP_PREPARE_TO_EXPRESSION wcontext->set_in_expression(false); Value& value=stack.pop().value(); wcontext->write(value.as_expr_result()); break; } case OP::OP_STRING__WRITE: { i.next(); // ignore origin Value* value=i.next().value; const String& string_value=*value->get_string(); DEBUG_PRINT_STRING(string_value) write_no_lang(string_value); break; } #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT case OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) if(Method* method=main_class.get_method(name)){ // looking operator of that name FIRST if(!method->junction_template) method->junction_template=new VJunction(main_class, method); stack.push(*method->junction_template); break; } Value& value=get_element(*rcontext, name); stack.push(value); break; } #else case OP::OP_GET_ELEMENT_OR_OPERATOR: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); if(Method* method=main_class.get_method(name)){ // looking operator of that name FIRST if(!method->junction_template) method->junction_template=new VJunction(main_class, method); stack.push(*method->junction_template); break; } Value& value=get_element(ncontext, name); stack.push(value); break; } #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT case OP::OP_GET_OBJECT_ELEMENT: case OP::OP_GET_OBJECT_ELEMENT__WRITE: { debug_origin=i.next().origin; const String& context_name=*i.next().value->get_string(); debug_name=&context_name; DEBUG_PRINT_STRING(context_name) Value& object=get_element(*rcontext, context_name); debug_origin=i.next().origin; const String& field_name=*i.next().value->get_string(); debug_name=&field_name; DEBUG_PRINT_STRING(field_name) Value& value=get_element(object, field_name); if(opcode==OP::OP_GET_OBJECT_ELEMENT){ stack.push(value); } else { write_assign_lang(value); } break; } #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT case OP::OP_GET_OBJECT_VAR_ELEMENT: case OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE: { debug_origin=i.next().origin; const String& context_name=*i.next().value->get_string(); debug_name=&context_name; DEBUG_PRINT_STRING(context_name) Value& object=get_element(*rcontext, context_name); debug_origin=i.next().origin; const String& var_name=*i.next().value->get_string(); debug_name=&var_name; DEBUG_PRINT_STRING(var_name) const String* field=&get_element(*rcontext, var_name).as_string(); Value& value=get_element(object, *field); if(opcode==OP::OP_GET_OBJECT_VAR_ELEMENT){ stack.push(value); } else { write_assign_lang(value); } break; } #endif case OP::OP_GET_ELEMENT: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=get_element(ncontext, name); stack.push(value); break; } case OP::OP_GET_ELEMENT__WRITE: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=get_element(ncontext, name); write_assign_lang(value); break; } #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT case OP::OP_VALUE__GET_ELEMENT: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(*rcontext, name); stack.push(value); break; } case OP::OP_VALUE__GET_ELEMENT__WRITE: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(*rcontext, name); write_assign_lang(value); break; } case OP::OP_WITH_ROOT__VALUE__GET_ELEMENT: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(*method_frame, name); stack.push(value); break; } #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT case OP::OP_WITH_SELF__VALUE__GET_ELEMENT: case OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(get_self(), name); if(opcode==OP::OP_WITH_SELF__VALUE__GET_ELEMENT){ stack.push(value); } else { write_assign_lang(value); } break; } #endif case OP::OP_OBJECT_POOL: { ArrayOperation& local_ops=*i.next().ops; WContext *saved_wcontext=wcontext; String::Language saved_lang=flang; flang=String::L_PASS_APPENDED; #ifdef OPTIMIZE_SINGLE_STRING_WRITE WObjectPoolWrapper local(wcontext); #else WWrapper local(wcontext); #endif wcontext=&local; execute(local_ops); stack.push(wcontext->result().as_value()); flang=saved_lang; wcontext=saved_wcontext; break; } case OP::OP_STRING_POOL: { ArrayOperation& local_ops=*i.next().ops; WContext *saved_wcontext=wcontext; WWrapper local(wcontext); wcontext=&local; execute(local_ops); // from "$a $b" part of expression taking only string value, // ignoring any other content of wcontext const String* string=wcontext->get_string(); Value* value=string ? new VString(*string) : new VString(); stack.push(*value); wcontext=saved_wcontext; break; } // CALL case OP::OP_CURLY_CODE__STORE_PARAM: case OP::OP_EXPR_CODE__STORE_PARAM: { // code ArrayOperation& local_ops=*i.next().ops; DEBUG_PRINT_OPS((&local_ops)) // when they evaluate expression parameter, // the object expression result // does not need to be written into calling frame // it must go into any expressions using that parameter // hence, we zero junction.wcontext here, and later // in .process we would test that field // in decision "which wwrapper to use" VJunction& value=*new VJunction( get_self(), 0, method_frame, rcontext, opcode==OP::OP_EXPR_CODE__STORE_PARAM?0:wcontext, &local_ops); #ifndef USE_DESTRUCTORS if (opcode!=OP::OP_EXPR_CODE__STORE_PARAM) wcontext->attach_junction(&value); #endif // store param stack.push(value); break; } case OP::OP_PREPARE_TO_EXPRESSION: { wcontext->set_in_expression(true); break; } #define METHOD_FRAME_ACTION(action) \ if(local_ops){ \ size_t first = stack.top_index(); \ execute(*local_ops); \ frame.store_params((Value**)stack.ptr(first), stack.top_index()-first); \ action; \ stack.set_top_index(first); \ } else { \ frame.empty_params(); \ action; \ } case OP::OP_CALL: { ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") Value& value=stack.pop().value(); Junction* junction=value.get_junction(); if(!junction) { if(value.is("void")) throw Exception(PARSER_RUNTIME, 0, "undefined method"); else throw Exception(PARSER_RUNTIME, 0, "is '%s', not a method or junction, can not call it", value.type()); } Value *result; { VMethodFrame frame(*junction->method, method_frame, junction->self); METHOD_FRAME_ACTION(op_call(frame)); result=&frame.result().as_value(); // VMethodFrame desctructor deletes junctions in stack params here } stack.push(*result); DEBUG_PRINT_STR("<-returned") if(get_skip()) return; if(get_interrupted()) { set_interrupted(false); throw Exception("parser.interrupted", 0, "execution stopped"); } break; } case OP::OP_CALL__WRITE: { ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") Value& value=stack.pop().value(); Junction* junction=value.get_junction(); if(!junction) { if(value.is("void")) throw Exception(PARSER_RUNTIME, 0, "undefined method"); else throw Exception(PARSER_RUNTIME, 0, "is '%s', not a method or junction, can not call it", value.type()); } #ifdef OPTIMIZE_CALL const Method& method=*junction->method; if(method.call_optimization==Method::CO_WITHOUT_FRAME){ if(local_ops){ // store param code goes here size_t first = stack.top_index(); execute(*local_ops); MethodParams method_params; method_params.store_params((Value**)stack.ptr(first), stack.top_index()-first); method.check_actual_numbered_params(junction->self, &method_params); method.native_code(*this, method_params); // execute it stack.set_top_index(first); } else { MethodParams method_params; method.check_actual_numbered_params(junction->self, &method_params); method.native_code(*this, method_params); // execute it } } else if(method.call_optimization==Method::CO_WITHOUT_WCONTEXT){ VMethodFrame frame(method, method_frame, junction->self); METHOD_FRAME_ACTION(op_call_write(frame)); } else #endif // OPTIMIZE_CALL { VMethodFrame frame(method, method_frame, junction->self); METHOD_FRAME_ACTION(op_call(frame)); write_pass_lang(frame.result()); } DEBUG_PRINT_STR("<-returned") if(get_skip()) return; if(get_interrupted()) { set_interrupted(false); throw Exception("parser.interrupted", 0, "execution stopped"); } break; } case OP::OP_CONSTRUCT_OBJECT: case OP::OP_CONSTRUCT_OBJECT__WRITE: { debug_origin=i.next().origin; Value& vclass_name=*i.next().value; const String& class_name=*vclass_name.get_string(); debug_name=&class_name; DEBUG_PRINT_STRING(class_name) Value* class_value=get_class(class_name); if(!class_value) throw Exception(PARSER_RUNTIME, &class_name, "class is undefined"); debug_origin=i.next().origin; Value& vconstructor_name=*i.next().value; const String& constructor_name=*vconstructor_name.get_string(); debug_name=&constructor_name; DEBUG_PRINT_STRING(constructor_name) Junction* constructor_junction=get_element(*class_value, constructor_name).get_junction(); if(!constructor_junction) throw Exception(PARSER_RUNTIME, &constructor_name, "constructor must be declared in class '%s'", class_value->get_class()->name_cstr()); ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") Value *result; { Value& object=construct(*class_value, *constructor_junction->method); VConstructorFrame frame(*constructor_junction->method, method_frame, object); METHOD_FRAME_ACTION(op_call(frame)); object.enable_default_setter(); result=&frame.result().as_value(); // VMethodFrame desctructor deletes junctions in stack params here } if(opcode==OP::OP_CONSTRUCT_OBJECT) stack.push(*result); else write_pass_lang(*result); DEBUG_PRINT_STR("<-returned") break; } // expression ops: unary case OP::OP_NEG: { Value& a=stack.pop().value(); Value& value=*new VDouble(-a.as_double()); stack.push(value); break; } case OP::OP_INV: { Value& a=stack.pop().value(); Value& value=*new VDouble(~a.as_int()); stack.push(value); break; } case OP::OP_NOT: { Value& a=stack.pop().value(); Value& value=VBool::get(!a.as_bool()); stack.push(value); break; } case OP::OP_DEF: { Value& a=stack.pop().value(); Value& value=VBool::get(a.is_defined()); stack.push(value); break; } case OP::OP_IN: { Value& a=stack.pop().value(); const String& path=a.as_string(); Value& value=VBool::get(request_info.uri && *request_info.uri && path.this_starts(request_info.uri)); stack.push(value); break; } case OP::OP_FEXISTS: { Value& a=stack.pop().value(); Value& value=VBool::get(file_exist(absolute(a.as_string()))); stack.push(value); break; } case OP::OP_DEXISTS: { Value& a=stack.pop().value(); Value& value=VBool::get(dir_exists(absolute(a.as_string()))); stack.push(value); break; } // expression ops: binary case OP::OP_SUB: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VDouble(a.as_double() - b.as_double()); stack.push(value); break; } case OP::OP_ADD: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VDouble(a.as_double() + b.as_double()); stack.push(value); break; } case OP::OP_MUL: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VDouble(a.as_double() * b.as_double()); stack.push(value); break; } case OP::OP_DIV: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); double a_double=a.as_double(); double b_double=b.as_double(); if(b_double == 0) { //const String* problem_source=b.as_string(); throw Exception("number.zerodivision", 0, //problem_source, "Division by zero"); } Value& value=*new VDouble(a_double / b_double); stack.push(value); break; } case OP::OP_MOD: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); double a_double=a.as_double(); double b_double=b.as_double(); if(b_double == 0) { //const String* problem_source=b.as_string(); throw Exception("number.zerodivision", 0, //problem_source, "Modulus by zero"); } Value& value=*new VDouble(fmod(a_double, b_double)); stack.push(value); break; } case OP::OP_INTDIV: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); int a_int=a.as_int(); int b_int=b.as_int(); if(b_int == 0) { //const String* problem_source=b.as_string(); throw Exception("number.zerodivision", 0, //problem_source, "Division by zero"); } Value& value=*new VInt(a_int / b_int); stack.push(value); break; } case OP::OP_BIN_SL: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() << b.as_int()); stack.push(value); break; } case OP::OP_BIN_SR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() >> b.as_int()); stack.push(value); break; } case OP::OP_BIN_AND: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() & b.as_int()); stack.push(value); break; } case OP::OP_BIN_OR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() | b.as_int()); stack.push(value); break; } case OP::OP_BIN_XOR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() ^ b.as_int()); stack.push(value); break; } case OP::OP_LOG_AND: { ArrayOperation& local_ops=stack.pop().ops(); Value& a=stack.pop().value(); bool result; if(a.as_bool()) { execute(local_ops); Value& b=stack.pop().value(); result=b.as_bool(); } else result=false; Value& value=VBool::get(result); stack.push(value); break; } case OP::OP_LOG_OR: { ArrayOperation& local_ops=stack.pop().ops(); Value& a=stack.pop().value(); bool result; if(a.as_bool()) result=true; else { execute(local_ops); Value& b=stack.pop().value(); result=b.as_bool(); } Value& value=VBool::get(result); stack.push(value); break; } case OP::OP_LOG_XOR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_bool() ^ b.as_bool()); stack.push(value); break; } case OP::OP_NUM_LT: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_doubleb_double); stack.push(value); break; } case OP::OP_NUM_LE: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double<=b_double); stack.push(value); break; } case OP::OP_NUM_GE: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double>=b_double); stack.push(value); break; } case OP::OP_NUM_EQ: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double==b_double); stack.push(value); break; } case OP::OP_NUM_NE: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double!=b_double); stack.push(value); break; } case OP::OP_STR_LT: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() < b.as_string()); stack.push(value); break; } case OP::OP_STR_GT: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() > b.as_string()); stack.push(value); break; } case OP::OP_STR_LE: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() <= b.as_string()); stack.push(value); break; } case OP::OP_STR_GE: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() >= b.as_string()); stack.push(value); break; } case OP::OP_STR_EQ: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() == b.as_string()); stack.push(value); break; } case OP::OP_STR_NE: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() != b.as_string()); stack.push(value); break; } case OP::OP_IS: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.is(b.as_string().cstr())); stack.push(value); break; } default: throw Exception(0, 0, "invalid opcode %d", opcode); } } } catch(const Exception&) { // record it to stack trace if(debug_name) exception_trace.push(Trace(debug_name, debug_origin)); rethrow; } } #define SAVE_CONTEXT \ VMethodFrame *saved_method_frame=method_frame; \ Value* saved_rcontext=rcontext; \ WContext *saved_wcontext=wcontext; #define RESTORE_CONTEXT \ wcontext=saved_wcontext; \ rcontext=saved_rcontext; \ method_frame=saved_method_frame; Value& Request::construct(Value &class_value, const Method &method){ VStateless_class& called_class=*class_value.get_class(); if(method.call_type!=Method::CT_STATIC) { // this is a constructor call if(Value* result=called_class.create_new_value(fpool)) { // some stateless_class creatable derivates return *result; } else throw Exception(PARSER_RUNTIME, 0, //&frame.name(), "is not a constructor, system class '%s' can be constructed only implicitly", called_class.name().cstr()); } else throw Exception(PARSER_RUNTIME, 0, //&frame.name(), "method is static and can not be used as constructor"); } void Request::op_call(VMethodFrame& frame){ // see OP_PREPARE_TO_EXPRESSION frame.set_in_expression(wcontext->get_in_expression()); SAVE_CONTEXT rcontext=wcontext=method_frame=&frame; Value& self=frame.self(); const Method& method=frame.method; Method::Call_type call_type=self.get_class()==&self ? Method::CT_STATIC : Method::CT_DYNAMIC; if(method.call_type==Method::CT_ANY || method.call_type==call_type) { // allowed call type? if(method.native_code) { // native code? method.check_actual_numbered_params(self, frame.numbered_params()); method.native_code(*this, *frame.numbered_params()); // execute it } else // parser code, execute it recoursion_checked_execute(*method.parser_code); } else throw Exception(PARSER_RUNTIME, 0, "is not allowed to be called %s", call_type==Method::CT_STATIC?"statically":"dynamically"); RESTORE_CONTEXT } void Request::op_call_write(VMethodFrame& frame){ VMethodFrame *saved_method_frame=method_frame; Value* saved_rcontext=rcontext; rcontext=&frame; method_frame=&frame; Value& self=frame.self(); const Method& method=frame.method; Method::Call_type call_type=self.get_class()==&self ? Method::CT_STATIC : Method::CT_DYNAMIC; if(method.call_type==Method::CT_ANY || method.call_type==call_type) { // allowed call type? if(method.native_code) { // native code? method.check_actual_numbered_params(self, frame.numbered_params()); method.native_code(*this, *frame.numbered_params()); // execute it } else // parser code, execute it recoursion_checked_execute(*method.parser_code); } else throw Exception(PARSER_RUNTIME, 0, "is not allowed to be called %s", call_type==Method::CT_STATIC?"statically":"dynamically"); rcontext=saved_rcontext; method_frame=saved_method_frame; } Value& Request::get_element(Value& ncontext, const String& name) { if(wcontext->get_somebody_entered_some_class()) // ^class:method if(VStateless_class *called_class=ncontext.get_class()) if(VStateless_class *read_class=rcontext->get_class()) if(read_class->derived_from(*called_class)){ // current derived from called Value *value=called_class->get_element(get_self(), name); return *(value ? &process_to_value(*value) : VVoid::get()); } Value* value=ncontext.get_element(name); return *(value ? &process_to_value(*value) : VVoid::get()); } void Request::put_element(Value& ncontext, const String& name, Value* value) { // put_element can return property-setting-junction if(const VJunction* vjunction=ncontext.put_element(name, value)) if(vjunction!=PUT_ELEMENT_REPLACED_ELEMENT) { const Junction& junction = vjunction->junction(); VConstructorFrame frame(*junction.method, method_frame /*caller*/, junction.self); size_t param_count=frame.method_params_count(); if(junction.auto_name){ // default setter if(param_count!=2) throw Exception(PARSER_RUNTIME, 0, "default setter method must have TWO parameters (has %d parameters)", param_count); Value* params[2] = { new VString(*junction.auto_name), value }; frame.store_params(params, 2); Temp_disable_default_setter temp(junction.self); execute_method(frame); } else { // setter if(param_count!=1) throw Exception(PARSER_RUNTIME, 0, "setter method must have ONE parameter (has %d parameters)", param_count); frame.store_params(&value, 1); execute_method(frame); } } } StringOrValue Request::process_getter(Junction& junction) { VMethodFrame frame(*junction.method, method_frame/*caller*/, junction.self); size_t param_count=frame.method_params_count(); if(junction.auto_name){ // default getter Value *param; if(param_count){ if(param_count>1) throw Exception(PARSER_RUNTIME, 0, "default getter method can't have more then 1 parameter (has %d parameters)", param_count); param=new VString(*junction.auto_name); frame.store_params(¶m, 1); } // no need for else frame.empty_params() Temp_disable_default_getter temp(junction.self); execute_method(frame); } else { // getter if(param_count!=0) throw Exception(PARSER_RUNTIME, 0, "getter method must have no parameters (has %d parameters)", param_count); // no need for frame.empty_params() execute_method(frame); } return frame.result(); } /** @param intercept_string - true: they want result=string value, possible object result goes to wcontext - false: they want any result[string|object] nothing goes to wcontext. used in @c (expression) params evaluation using the fact it's either string_ or value_ result requested to speed up checkes */ StringOrValue Request::process(Value& input_value, bool intercept_string) { Junction* junction=input_value.get_junction(); if(junction) { if(junction->is_getter) { // is it a getter-junction? return process_getter(*junction); } if(junction->code) { // is it a code-junction? // process it StringOrValue result; DEBUG_PRINT_STR("ja->\n") if(!junction->method_frame) throw Exception(PARSER_RUNTIME, 0, "junction used outside of context"); SAVE_CONTEXT method_frame=junction->method_frame; rcontext=junction->rcontext; // for expression method params // wcontext is set 0 // using the fact in decision "which wwrapper to use" bool using_code_frame=intercept_string && junction->wcontext; if(using_code_frame) { // almost plain wwrapper about junction wcontext VCodeFrame local(*junction->wcontext); wcontext=&local; // execute it recoursion_checked_execute(*junction->code); // CodeFrame soul: result=wcontext->result(); } else { // plain wwrapper WWrapper local(wcontext); wcontext=&local; // execute it recoursion_checked_execute(*junction->code); result=wcontext->result(); } RESTORE_CONTEXT DEBUG_PRINT_STR("<-ja returned") return result; } // it is then method-junction, do not explode it // just return it as we do for usual objects } return input_value; } void Request::process_write(Value& input_value) { Junction* junction=input_value.get_junction(); if(junction) { if(junction->is_getter) { // is it a getter-junction? write_pass_lang(process_getter(*junction)); return; } if(junction->code) { // is it a code-junction? // process it DEBUG_PRINT_STR("ja->\n") if(!junction->method_frame) throw Exception(PARSER_RUNTIME, 0, "junction used outside of context"); SAVE_CONTEXT method_frame=junction->method_frame; rcontext=junction->rcontext; // for expression method params // wcontext is set 0 // using the fact in decision "which wwrapper to use" #ifdef OPTIMIZE_CALL if(wcontext==junction->wcontext){ // no wrappers for wcontext recoursion_checked_execute(*junction->code); RESTORE_CONTEXT } else #endif if(junction->wcontext) { // almost plain wwrapper about junction wcontext VCodeFrame local(*junction->wcontext); wcontext=&local; // execute it recoursion_checked_execute(*junction->code); RESTORE_CONTEXT write_pass_lang(local.result()); } else { // plain wwrapper WWrapper local(wcontext); wcontext=&local; // execute it recoursion_checked_execute(*junction->code); RESTORE_CONTEXT write_pass_lang(local.result()); } DEBUG_PRINT_STR("<-ja returned") return; } // it is then method-junction, do not explode it // just return it as we do for usual objects } write_pass_lang(input_value); } void Request::execute_method(VMethodFrame& aframe) { SAVE_CONTEXT // initialize contexts rcontext=wcontext=method_frame=&aframe; // execute! recoursion_checked_execute(*aframe.method.parser_code); RESTORE_CONTEXT } const String* Request::execute_method(Value& aself, const Method& method, Value* optional_param, bool do_return_string) { VMethodFrame local_frame(method, method_frame/*caller*/, aself); if(optional_param && local_frame.method_params_count()>0) { local_frame.store_params(&optional_param, 1); } else { local_frame.empty_params(); } // prevent non-string writes for better error reporting if(do_return_string) local_frame.write(local_frame); execute_method(local_frame); return do_return_string ? local_frame.get_string() : 0; } Request::Execute_nonvirtual_method_result Request::execute_nonvirtual_method(VStateless_class& aclass, const String& method_name, VString* optional_param, bool do_return_string) { Execute_nonvirtual_method_result result; result.method=aclass.get_method(method_name); if(result.method) result.string=execute_method(aclass, *result.method, optional_param, do_return_string); return result; } const String* Request::execute_virtual_method(Value& aself, const String& method_name) { if(Value* value=aself.get_element(method_name)) if(Junction* junction=value->get_junction()) if(const Method *method=junction->method) return execute_method(aself, *method, 0/*no params*/, true); return 0; } const String* Request::get_method_filename(const Method* method){ if(ArrayOperation* code=method->parser_code) if(code){ Operation::Origin origin={0, 0, 0}; Array_iterator i(*code); while( i.has_next() ){ switch( i.next().code ){ case OP::OP_CURLY_CODE__STORE_PARAM: case OP::OP_EXPR_CODE__STORE_PARAM: case OP::OP_CURLY_CODE__CONSTRUCT: case OP::OP_NESTED_CODE: case OP::OP_OBJECT_POOL: case OP::OP_STRING_POOL: case OP::OP_CALL: case OP::OP_CALL__WRITE: { i.next(); // skip local ops i.next(); // skip next opcode // continue execution } case OP::OP_CONSTRUCT_OBJECT: case OP::OP_CONSTRUCT_OBJECT__WRITE: case OP::OP_VALUE: case OP::OP_STRING__WRITE: case OP::OP_VALUE__GET_CLASS: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT case OP::OP_GET_OBJECT_ELEMENT: case OP::OP_GET_OBJECT_ELEMENT__WRITE: #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT case OP::OP_GET_OBJECT_VAR_ELEMENT: case OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE: #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT case OP::OP_VALUE__GET_ELEMENT: case OP::OP_VALUE__GET_ELEMENT__WRITE: case OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR: case OP::OP_WITH_ROOT__VALUE__GET_ELEMENT: #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT case OP::OP_WITH_SELF__VALUE__GET_ELEMENT: case OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE: #endif #ifdef OPTIMIZE_BYTECODE_CONSTRUCT case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR: case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE: case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR: case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE: case OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR: case OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE: #endif { origin=i.next().origin; break; } } if(origin.file_no) return get_used_filename(origin.file_no); } } return 0; } parser-3.4.3/src/main/pa_dictionary.C000644 000000 000000 00000004101 11730603275 017560 0ustar00rootwheel000000 000000 /** @file Parser: dictionary class impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_dictionary.h" #include "pa_exception.h" volatile const char * IDENT_PA_DICTIONARY_C="$Id: pa_dictionary.C,v 1.26 2012/03/16 09:24:13 moko Exp $" IDENT_PA_DICTIONARY_H; Dictionary::Dictionary(Table& atable): substs(atable.count()) { // clear starting_lines memset(starting_line_of, 0, sizeof(starting_line_of)); // grab first letters of first column of a table constructor_line=1; for(Array_iterator i(atable); i.has_next(); ) { ArrayString* row=i.next(); append_subst( row->get(0), (row->count()>1) ? row->get(1) : 0, "dictionary table 'from' column elements must not be empty" ); } } Dictionary::Dictionary(const String& from, const String& to): substs(1) { // clear starting_lines memset(starting_line_of, 0, sizeof(starting_line_of)); constructor_line=1; append_subst(&from, &to); } void Dictionary::append_subst(const String* from, const String* to, const char* exception_cstr) { if(from->is_empty()) throw Exception(PARSER_RUNTIME, 0, exception_cstr ? exception_cstr : "'from' must not be empty"); // record simplier 'from' for quick comparisons in 'starts' extremely-tight-callback substs+=Dictionary::Subst(from->cstr(), (to && !to->is_empty()) ? to : 0); unsigned char c=(unsigned char)from->first_char(); if(!starting_line_of[c]) starting_line_of[c]=constructor_line; constructor_line++; } #ifndef DOXYGEN struct First_that_begins_info { int line; const char* str; }; #endif static bool starts(Dictionary::Subst subst, First_that_begins_info* info) { // skip irrelevant lines if(info->line>1) { --info->line; return 0; } return strncmp(subst.from, info->str, subst.from_length)==0; } Dictionary::Subst Dictionary::first_that_begins(const char* str) const { First_that_begins_info info; if((info.line=starting_line_of[(unsigned char)*str])) { info.str=str; return substs.first_that(starts, &info); } else return 0; } parser-3.4.3/src/main/untaint.C000644 000000 000000 00000045015 12227057562 016432 0ustar00rootwheel000000 000000 /** @file Parser: String class part: untaint mechanizm. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ volatile const char * IDENT_UNTAINT_C="$Id: untaint.C,v 1.165 2013/10/14 21:17:38 moko Exp $"; #include "pa_string.h" #include "pa_hash.h" #include "pa_exception.h" #include "pa_table.h" #include "pa_globals.h" #include "pa_dictionary.h" #include "pa_common.h" #include "pa_charset.h" #include "pa_request_charsets.h" #include "pa_sapi.h" extern "C" { // author forgot to do that #include "ec.h" } #include "pa_sql_connection.h" // defines #undef CORD_ec_append // redefining to intercept flushes and implement whitespace optimization // of all consequent white space chars leaving only first one #define CORD_ec_append(x, c) \ { \ bool skip=false; \ if(optimize) switch(c) { \ case ' ': case '\n': case '\t': \ if(whitespace) \ skip=true; /*skipping subsequent*/ \ else \ whitespace=true; \ break; \ default: \ whitespace=false; \ break; \ } \ if(!skip) { \ if ((x)[0].ec_bufptr == (x)[0].ec_buf + CORD_BUFSZ) { \ CORD_ec_flush_buf(x); \ } \ *((x)[0].ec_bufptr)++ = (c); \ } \ } #define escape_fragment(action) \ for(; fragment_length--; CORD_next(info->pos)) { \ char c=CORD_pos_fetch(info->pos); \ action \ } #define _default CORD_ec_append(info->result, c) #define encode(need_encode_func, prefix, otherwise) \ if(need_encode_func(c)) { \ CORD_ec_append(info->result, prefix); \ CORD_ec_append(info->result, hex_digits[((unsigned char)c) >> 4]); \ CORD_ec_append(info->result, hex_digits[((unsigned char)c) & 0x0F]); \ } else \ CORD_ec_append(info->result, otherwise); #define to_char(c) { CORD_ec_append(info->result, c); whitespace=false; } #define to_string(s) { CORD_ec_append_cord(info->result, s); whitespace=false; } inline bool need_file_encode(unsigned char c){ // russian letters and space ENABLED // encoding only these... return strchr( "*?\"<>|" #ifndef WIN32 ":\\" #endif , c)!=0; } inline bool need_uri_encode(unsigned char c){ return !(pa_isalnum(c) || strchr("_-./*", c)); } inline bool need_regex_escape(unsigned char c){ return strchr("\\^$.[]|()?*+{}-", c)!=0; } inline bool need_parser_code_escape(unsigned char c){ return strchr("^$;@()[]{}:#\"", c)!=0; } // String /* HTTP-header = field-name ":" [ field-value ] CRLF field-name = token field-value = *( field-content | LWS ) field-content = token = 1* word = token | quoted-string quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) qdtext = > quoted-pair = "\" CHAR OCTET = CHAR = tspecials = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT SP = HT = LWS = [CRLF] 1*( SP | HT ) TEXT = CTL = if(strchr("()<>@,;:\\\"/[]?={} \t", *ptr)) */ inline bool need_quote_http_header(const char* ptr, size_t size) { for(; size--; ptr++) if(strchr(";\\\"= \t" /* excluded ()<>@, :/ ? []{} */, *ptr)) return true; return false; } #ifndef DOXYGEN struct Append_fragment_info { String::Language lang; String::Languages* dest_languages; size_t dest_body_plan_length; }; #endif int append_fragment_optimizing(char alang, size_t asize, Append_fragment_info* info) { const String::Language lang=(String::Language)(unsigned char)alang; // main idea here: // tainted piece would get OPTIMIZED bit from 'lang' // clean piece would be marked OPTIMIZED manually // pieces with determined languages [not tainted|clean] would retain theirs langs info->dest_languages->append(info->dest_body_plan_length, lang==String::L_TAINTED? info->lang :lang==String::L_CLEAN? (String::Language)(String::L_CLEAN|String::L_OPTIMIZE_BIT) // ORing with OPTIMIZED flag :lang, asize); info->dest_body_plan_length+=asize; return 0; // 0=continue } int append_fragment_nonoptimizing(char alang, size_t asize, Append_fragment_info* info) { const String::Language lang=(String::Language)(unsigned char)alang; // The core idea: tainted pieces got marked with context's lang info->dest_languages->append(info->dest_body_plan_length, lang==String::L_TAINTED? info->lang :lang, asize); info->dest_body_plan_length+=asize; return 0; // 0=continue } /** appends to other String, marking all tainted pieces of it with @a lang. or marking ALL pieces of it with a @a lang when @a forced to, and propagating OPTIMIZE language bit. */ String& String::append_to(String& dest, Language ilang, bool forced) const { if(is_empty()) return dest; // first: fragment infos if(ilang==L_PASS_APPENDED) // without language-change? dest.langs.appendHelper(dest.body, langs, body); else if(forced) //forcing passed lang? dest.langs.appendHelper(dest.body, ilang, body); else { if(langs.opt.is_not_just_lang){ Append_fragment_info info={ilang, &dest.langs, dest.body.length()}; langs.for_each(body, ilang&L_OPTIMIZE_BIT? append_fragment_optimizing :append_fragment_nonoptimizing, &info); } else { Language lang=langs.opt.lang; // see append_fragment_* for explanation if(ilang&L_OPTIMIZE_BIT){ dest.langs.appendHelper(dest.body, lang==String::L_TAINTED? ilang :lang==String::L_CLEAN? (String::Language)(String::L_CLEAN|String::L_OPTIMIZE_BIT) :lang, body); } else { dest.langs.appendHelper(dest.body, lang==String::L_TAINTED ? ilang:lang, body); } } } // next: letters dest.body<. An 'encoded-word' that appears within a 'phrase' MUST be separated from any adjacent 'word', 'text' or 'special' by 'linear-white-space'. ... (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_" (underscore, ASCII 95.). (This character may not pass through some internetwork mail gateways, but its use will greatly enhance readability of "Q" encoded data with mail readers that do not support this encoding.) Note that the "_" always represents hexadecimal 20, even if the SPACE character occupies a different code position in the character set in use. paf: obviously, without "=", or one could not differ "=E0" and "russian letter a" and without "_", or in would mean 0x20 */ inline bool mail_header_char_valid_within_Qencoded(char c) { return (pa_isalnum((unsigned char)c) || strchr("!*+-/", c)); } inline bool addr_spec_soon(const char *src) { for(char c; (c=*src); src++) if(c=='<') return true; else if(!(c==' ' || c=='\t')) return false; return false; } /** RFC Upper case should be used for hexadecimal digits "A" through "F" The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_" */ inline bool mail_header_nonspace_char(char c) { return c != 0x20; } inline void ec_append(CORD_ec& result, bool& optimize, bool& whitespace, CORD_pos pos, size_t size) { while(size--) { CORD_ec_append(result, CORD_pos_fetch(pos)); CORD_next(pos); } } inline void pa_CORD_pos_advance(CORD_pos pos, size_t n) { while(true) { long avail=CORD_pos_chars_left(pos); if(avail<=0) { CORD_next(pos); if(!--n) break; } else if((size_t)avail=n CORD_pos_advance(pos, n); break; } } } #ifndef DOXYGEN struct Cstr_to_string_body_block_info { // input String::Language lang; SQL_Connection* connection; const Request_charsets* charsets; const String::Body* body; // output CORD_ec result; // private CORD_pos pos; size_t fragment_begin; bool whitespace; const char* exception; }; #endif // @todo: replace info->body->mid with something that uses info->pos int cstr_to_string_body_block(String::Language to_lang, size_t fragment_length, Cstr_to_string_body_block_info* info) { bool& whitespace=info->whitespace; size_t fragment_end=info->fragment_begin+fragment_length; //fprintf(stderr, "%d, %d =%s=\n", to_lang, fragment_length, info->body->cstr()); bool optimize=(to_lang & String::L_OPTIMIZE_BIT)!=0; if(!optimize) whitespace=false; switch(to_lang & ~String::L_OPTIMIZE_BIT) { case String::L_CLEAN: case String::L_TAINTED: case String::L_AS_IS: // clean piece // tainted piece, but undefined untaint language // for VString.as_double of tainted values // for ^process{body} evaluation // tainted, untaint language: as-is ec_append(info->result, optimize, whitespace, info->pos, fragment_length); break; case String::L_FILE_SPEC: // tainted, untaint language: file [name] { escape_fragment( encode(need_file_encode, '_', c); ); } break; case String::L_URI: // tainted, untaint language: uri { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); String::C output(fragment_str, fragment_length); if(info->charsets) output=Charset::transcode(output, info->charsets->source(), info->charsets->client()); char c; for(const char* src=output.str; (c=*src++); ) encode(need_uri_encode, '%', c); } break; case String::L_HTTP_HEADER: // tainted, untaint language: http-field-content-text escape_fragment(switch(c) { case '\n': case '\r': to_string(" "); break; default: _default; break; }); break; case String::L_MAIL_HEADER: // tainted, untaint language: mail-header // http://www.ietf.org/rfc/rfc2047.txt if(info->charsets) { size_t mail_size; const char *mail_ptr= info->body->mid(info->fragment_begin, mail_size=fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, mail_size); const char* charset_name=info->charsets->mail().NAME().cstr(); // Subject: Re: parser3: =?koi8-r?Q?=D3=C5=CD=C9=CE=C1=D2?= bool to_quoted_printable=false; bool email=false; uchar c; for(const char* src=mail_ptr; (c=(uchar)*src++); ) { if(c=='\r' || c=='\n') c=' '; if(to_quoted_printable && (c==',' || c == '"' || addr_spec_soon(src-1/*position to 'c'*/))) { email=c=='<'; to_string("?="); to_quoted_printable=false; } //RFC + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'. if(!email && ( !to_quoted_printable && (c & 0x80) // starting quote-printable-encoding on first 8bit char || to_quoted_printable && !mail_header_char_valid_within_Qencoded(c) )) { if(!to_quoted_printable) { to_string("=?"); to_string(charset_name); to_string("?Q?"); to_quoted_printable=true; } encode(mail_header_nonspace_char, '=', '_'); } else to_char(c); if(c=='>') email=false; } if(to_quoted_printable) // close to_string("?="); } else ec_append(info->result, optimize, whitespace, info->pos, fragment_length); break; case String::L_SQL: // tainted, untaint language: sql if(info->connection) { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); to_string(info->connection->quote(fragment_str, fragment_length)); } else { info->exception="untaint in SQL language failed - no connection specified"; info->fragment_begin=fragment_end; return 1; // stop processing. can't throw exception here } break; case String::L_JS: escape_fragment(switch(c) { case '\n': to_string("\\n"); break; case '"': to_string("\\\""); break; case '\'': to_string("\\'"); break; case '\\': to_string("\\\\"); break; case '\xFF': to_string("\\\xFF"); break; case '\r': to_string("\\r"); break; default: _default; break; }); break; case String::L_XML: // [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] escape_fragment(switch(c) { case '\x20': case '\x9': case '\xA': case '\xD': // this is usually removed on input _default; break; case '&': to_string("&"); break; case '>': to_string(">"); break; case '<': to_string("<"); break; case '"': to_string("""); break; case '\'': to_string("'"); break; default: if(((unsigned char)c)<0x20) { // fixing it, so that libxml would not result // in fatal error parsing text // though it really violates standard. // to indicate there were an error // replace bad char not to it's code, // which we can do, // but rather to '!' to show that input were actually // invalid. // life: shows that MSIE can somehow garble form values // so that they contain these chars. to_char('!'); } else { _default; } break; }); break; case String::L_HTML: escape_fragment(switch(c) { case '&': to_string("&"); break; case '>': to_string(">"); break; case '<': to_string("<"); break; case '"': to_string("""); break; default: _default; break; }); break; case String::L_REGEX: // tainted, untaint language: regex escape_fragment( if(need_regex_escape(c)) to_char('\\') _default; ); break; case String::L_JSON: // tainted, untaint language: json // escape '"' '\' '/' '\n' '\t' '\r' '\b' '\f' chars and escape chars as \uXXXX if output charset != UTF-8 { if(info->charsets==NULL || info->charsets->client().isUTF8()){ // escaping to \uXXXX is not needed escape_fragment(switch(c) { case '\n': to_string("\\n"); break; case '"' : to_string("\\\""); break; case '\\': to_string("\\\\"); break; case '/' : to_string("\\/"); break; case '\t': to_string("\\t"); break; case '\r': to_string("\\r"); break; case '\b': to_string("\\b"); break; case '\f': to_string("\\f"); break; default: if((unsigned char)c < 0x20){ to_string("\\u00"); to_char(hex_digits[((unsigned char)c) >> 4]); to_char(hex_digits[((unsigned char)c) & 0x0F]); } else { _default; } break; }); } else { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); String::C output(fragment_str, fragment_length); output=Charset::escape_JSON(output, info->charsets->source()); to_string(output); } } break; case String::L_HTTP_COOKIE: // tainted, untaint language: cookie (3.3.0 and higher: %uXXXX in UTF-8) if(info->charsets) { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); String::C output(fragment_str, fragment_length); output=Charset::escape(output, info->charsets->source()); to_string(output); } else ec_append(info->result, optimize, whitespace, info->pos, fragment_length); break; case String::L_PARSER_CODE: // for auto-untaint in process escape_fragment( if(need_parser_code_escape(c)) to_char('^'); _default; ); break; default: SAPI::abort("unknown untaint language #%d", static_cast(to_lang)); // should never break; // never } info->fragment_begin=fragment_end; return 0; // 0=continue } String::Body String::cstr_to_string_body_taint(Language lang, SQL_Connection* connection, const Request_charsets *charsets) const { if(is_empty()) return String::Body(); Cstr_to_string_body_block_info info; // input info.lang=lang; info.connection=connection; info.charsets=charsets; info.body=&body; // output CORD_ec_init(info.result); // private body.set_pos(info.pos, 0); info.fragment_begin=0; info.exception=0; info.whitespace=true; cstr_to_string_body_block(lang, length(), &info); if(info.exception) throw Exception(0, 0, info.exception); return String::Body(CORD_ec_to_cord(info.result)); } int cstr_to_string_body_block_untaint(char alang, size_t fragment_length, Cstr_to_string_body_block_info* info){ const String::Language lang=(String::Language)(unsigned char)alang; // see append_fragment_* for explanation if(info->lang&String::L_OPTIMIZE_BIT) return cstr_to_string_body_block( lang==String::L_TAINTED? info->lang :lang==String::L_CLEAN? (String::Language)(String::L_CLEAN|String::L_OPTIMIZE_BIT) :lang, fragment_length, info); else return cstr_to_string_body_block(lang==String::L_TAINTED ? info->lang:lang, fragment_length, info); } String::Body String::cstr_to_string_body_untaint(Language lang, SQL_Connection* connection, const Request_charsets *charsets) const { if(is_empty()) return String::Body(); Cstr_to_string_body_block_info info; // input info.lang=lang; info.connection=connection; info.charsets=charsets; info.body=&body; // output CORD_ec_init(info.result); // private body.set_pos(info.pos, 0); info.fragment_begin=0; info.exception=0; info.whitespace=true; langs.for_each(body, cstr_to_string_body_block_untaint, &info); if(info.exception) throw Exception(0, 0, info.exception); return String::Body(CORD_ec_to_cord(info.result)); } const char* String::untaint_and_transcode_cstr(Language lang, const Request_charsets *charsets) const { if(charsets && &charsets->source() != &charsets->client()){ // Note: L_URI is allready transcoded during untaint, but transcode does not affect %XX return Charset::transcode(cstr_to_string_body_untaint(lang, 0, charsets), charsets->source(), charsets->client()).cstr(); } else return cstr_to_string_body_untaint(lang, 0, charsets).cstr(); } parser-3.4.3/src/main/pa_dir.C000644 000000 000000 00000005646 12173316132 016203 0ustar00rootwheel000000 000000 /** @file Parser: directory scanning for different OS-es. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_common.h" #include "pa_dir.h" volatile const char * IDENT_PA_DIR_C="$Id: pa_dir.C,v 1.24 2013/07/22 20:55:54 moko Exp $" IDENT_PA_DIR_H; #ifdef _MSC_VER #define TICKS_PER_SECOND 10000000ULL #define EPOCH_DIFFERENCE 11644473600ULL time_t filetime_to_timet(FILETIME const& ft){ ULARGE_INTEGER ull; ull.LowPart = ft.dwLowDateTime; ull.HighPart = ft.dwHighDateTime; long long secs=(ull.QuadPart / TICKS_PER_SECOND - EPOCH_DIFFERENCE); time_t t =(time_t)secs; return (secs == (long long)t) ? t : 0; } bool findfirst(const char* _pathname, struct ffblk *_ffblk, int /*_attrib*/) { char mask[MAXPATH]; snprintf(mask, MAXPATH, "%s/*.*", _pathname); _ffblk->handle=FindFirstFile(mask, (_WIN32_FIND_DATAA *)_ffblk); return _ffblk->handle==INVALID_HANDLE_VALUE; } bool findnext(struct ffblk *_ffblk) { return !FindNextFile(_ffblk->handle, (_WIN32_FIND_DATAA *)_ffblk); } void findclose(struct ffblk *_ffblk) { FindClose(_ffblk->handle); } bool ffblk::is_dir() { return (ff_attrib & FILE_ATTRIBUTE_DIRECTORY) != 0; } double ffblk::size() { ULARGE_INTEGER ull; ull.LowPart = nFileSizeLow; ull.HighPart = nFileSizeHigh; return (double)ull.QuadPart; } time_t ffblk::c_timestamp() { return filetime_to_timet(ftCreationTime); } time_t ffblk::m_timestamp() { return filetime_to_timet(ftLastWriteTime); } time_t ffblk::a_timestamp() { return filetime_to_timet(ftLastAccessTime); } #else bool findfirst(const char* _pathname, struct ffblk *_ffblk, int /*_attrib*/) { _ffblk->filePath=_pathname; if(!(_ffblk->dir=opendir(_ffblk->filePath))) return true; return findnext(_ffblk); } bool findnext(struct ffblk *_ffblk) { while(true) { struct dirent *entry=readdir(_ffblk->dir); if(!entry) return true; strncpy(_ffblk->ff_name, entry->d_name, sizeof(_ffblk->ff_name)-1); _ffblk->ff_name[sizeof(_ffblk->ff_name)-1]=0; #ifdef HAVE_STRUCT_DIRENT_D_TYPE // http://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html _ffblk->_d_type=entry->d_type; #endif return false; } } void findclose(struct ffblk *_ffblk) { closedir(_ffblk->dir); } #ifdef HAVE_STRUCT_DIRENT_D_TYPE void ffblk::stat_file() { #else void ffblk::real_stat_file() { #endif char fileSpec[MAXPATH]; snprintf(fileSpec, MAXPATH, "%s/%s", filePath, ff_name); if(stat(fileSpec, &_st) != 0) { memset(&_st,0,sizeof(_st)); } } bool ffblk::is_dir() { #ifdef HAVE_STRUCT_DIRENT_D_TYPE return (_d_type & DT_DIR) != 0; #else real_stat_file(); return S_ISDIR(_st.st_mode) != 0; #endif } double ffblk::size() { return (double)_st.st_size; } time_t ffblk::c_timestamp() { return _st.st_ctime; } time_t ffblk::m_timestamp() { return _st.st_mtime; } time_t ffblk::a_timestamp() { return _st.st_atime; } #endif parser-3.4.3/src/main/pa_common.C000644 000000 000000 00000113115 12227057562 016715 0ustar00rootwheel000000 000000 /** @file Parser: commonly functions. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) * BASE64 part * Authors: Michael Zucchi * Jeffrey Stedfast * * Copyright 2000-2004 Ximian, Inc. (www.ximian.com) * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. * */ #include "pa_common.h" #include "pa_exception.h" #include "pa_hash.h" #include "pa_globals.h" #include "pa_charsets.h" #include "pa_http.h" #include "pa_request_charsets.h" #include "pcre.h" #include "pa_request.h" #ifdef _MSC_VER #include #include #endif #ifdef _MSC_VER #define pa_mkdir(path, mode) _mkdir(path) #else #define pa_mkdir(path, mode) mkdir(path, mode) #endif volatile const char * IDENT_PA_COMMON_C="$Id: pa_common.C,v 1.279 2013/10/14 21:17:38 moko Exp $" IDENT_PA_COMMON_H IDENT_PA_HASH_H IDENT_PA_ARRAY_H IDENT_PA_STACK_H; // some maybe-undefined constants #ifndef _O_TEXT # define _O_TEXT 0 #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #ifdef HAVE_FTRUNCATE # define PA_O_TRUNC 0 #else # ifdef _O_TRUNC # define PA_O_TRUNC _O_TRUNC # else # error you must have either ftruncate function or _O_TRUNC bit declared # endif #endif // defines for globals #define FILE_STATUS_NAME "status" // globals const String file_status_name(FILE_STATUS_NAME); // functions char* file_read_text(Request_charsets& charsets, const String& file_spec, bool fail_on_read_problem, HashStringValue* params, bool transcode_result) { File_read_result file=file_read(charsets, file_spec, true, params, fail_on_read_problem, 0, 0, 0, transcode_result); return file.success?file.str:0; } char* file_load_text(Request& r, const String& file_spec, bool fail_on_read_problem, HashStringValue* params, bool transcode_result) { File_read_result file=file_load(r, file_spec, true, params, fail_on_read_problem, 0, 0, 0, transcode_result); return file.success?file.str:0; } /// these options were handled but not checked elsewhere, now check them int pa_get_valid_file_options_count(HashStringValue& options) { int result=0; if(options.get(PA_SQL_LIMIT_NAME)) result++; if(options.get(PA_SQL_OFFSET_NAME)) result++; if(options.get(PA_COLUMN_SEPARATOR_NAME)) result++; if(options.get(PA_COLUMN_ENCLOSER_NAME)) result++; if(options.get(PA_CHARSET_NAME)) result++; return result; } #ifndef DOXYGEN struct File_read_action_info { char **data; size_t *data_size; char* buf; size_t offset; size_t count; }; #endif static void file_read_action(struct stat& finfo, int f, const String& file_spec, const char* /*fname*/, bool as_text, void *context) { File_read_action_info& info=*static_cast(context); size_t to_read_size=info.count; if(!to_read_size) to_read_size=(size_t)finfo.st_size; assert( !(info.buf && as_text) ); if(to_read_size) { if(info.offset) lseek(f, info.offset, SEEK_SET); *info.data=info.buf ? info.buf : (char *)pa_malloc_atomic(to_read_size+1); ssize_t result=read(f, *info.data, to_read_size); if(result<0) throw Exception("file.read", &file_spec, "read failed: %s (%d)", strerror(errno), errno); *info.data_size=result; } else { // empty file // for both, text and binary: for text we need that terminator, for binary we need nonzero pointer to be able to save such files *info.data=(char *)pa_malloc_atomic(1); *(char*)(*info.data)=0; *info.data_size=0; return; } } File_read_result file_read(Request_charsets& charsets, const String& file_spec, bool as_text, HashStringValue *params, bool fail_on_read_problem, char* buf, size_t offset, size_t count, bool transcode_text_result) { File_read_result result={false, 0, 0, 0}; if(params){ int valid_options=pa_get_valid_file_options_count(*params); if(valid_options!=params->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } File_read_action_info info={&result.str, &result.length, buf, offset, count}; result.success=file_read_action_under_lock(file_spec, "read", file_read_action, &info, as_text, fail_on_read_problem); if(as_text){ if(result.success){ Charset* asked_charset=0; if(result.length>=3 && strncmp(result.str, "\xEF\xBB\xBF", 3)==0){ // skip UTF-8 signature (BOM code) result.str+=3; result.length-=3; asked_charset=&UTF8_charset; } if(params) if(Value* vcharset_name=params->get(PA_CHARSET_NAME)) asked_charset=&::charsets.get(vcharset_name->as_string().change_case(charsets.source(), String::CC_UPPER)); if(result.length && transcode_text_result && asked_charset){ // length must be checked because transcode returns CONST string in case length==0, which contradicts hacking few lines below String::C body=String::C(result.str, result.length); body=Charset::transcode(body, *asked_charset, charsets.source()); result.str=const_cast(body.str); // hacking a little result.length=body.length; } } if(result.length) fix_line_breaks(result.str, result.length); } return result; } File_read_result file_load(Request& r, const String& file_spec, bool as_text, HashStringValue *params, bool fail_on_read_problem, char* buf, size_t offset, size_t count, bool transcode_text_result) { File_read_result result={false, 0, 0, 0}; if(file_spec.starts_with("http://")) { if(offset || count) throw Exception(PARSER_RUNTIME, 0, "offset and load options are not supported for HTTP:// file load"); // fail on read problem File_read_http_result http=pa_internal_file_read_http(r, file_spec, as_text, params, transcode_text_result); result.success=true; result.str=http.str; result.length=http.length; result.headers=http.headers; } else result= file_read(r.charsets, file_spec, as_text, params, fail_on_read_problem, buf, offset, count, transcode_text_result); return result; } #ifdef PA_SAFE_MODE void check_safe_mode(struct stat finfo, const String& file_spec, const char* fname) { if(finfo.st_uid/*foreign?*/!=geteuid() && finfo.st_gid/*foreign?*/!=getegid()) throw Exception(PARSER_RUNTIME, &file_spec, "parser is in safe mode: " "reading files of foreign group and user disabled " "[recompile parser with --disable-safe-mode configure option], " "actual filename '%s', " "fuid(%d)!=euid(%d) or fgid(%d)!=egid(%d)", fname, finfo.st_uid, geteuid(), finfo.st_gid, getegid()); } #else void check_safe_mode(struct stat, const String&, const char*) { } #endif bool file_read_action_under_lock(const String& file_spec, const char* action_name, File_read_action action, void *context, bool as_text, bool fail_on_read_problem) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); int f; // first open, next stat: // directory update of NTFS hard links performed on open. // ex: // a.html:^test[] and b.html hardlink to a.html // user inserts ! before ^test in a.html // directory entry of b.html in NTFS not updated at once, // they delay update till open, so we would receive "!^test[" string // if would do stat, next open. // later: it seems, even this does not help sometimes if((f=open(fname, O_RDONLY|(as_text?_O_TEXT:_O_BINARY)))>=0) { try { if(pa_lock_shared_blocking(f)!=0) throw Exception("file.lock", &file_spec, "shared lock failed: %s (%d), actual filename '%s'", strerror(errno), errno, fname); struct stat finfo; if(fstat(f, &finfo)!=0) throw Exception("file.missing", // hardly possible: we just opened it OK &file_spec, "stat failed: %s (%d), actual filename '%s'", strerror(errno), errno, fname); check_safe_mode(finfo, file_spec, fname); action(finfo, f, file_spec, fname, as_text, context); } catch(...) { pa_unlock(f);close(f); if(fail_on_read_problem) rethrow; return false; } pa_unlock(f);close(f); return true; } else { if(fail_on_read_problem) throw Exception(errno==EACCES?"file.access" :(errno==ENOENT || errno==ENOTDIR || errno==ENODEV)?"file.missing":0, &file_spec, "%s failed: %s (%d), actual filename '%s'", action_name, strerror(errno), errno, fname); return false; } } void create_dir_for_file(const String& file_spec) { size_t pos_after=1; size_t pos_before; while((pos_before=file_spec.pos('/', pos_after))!=STRING_NOT_FOUND) { pa_mkdir(file_spec.mid(0, pos_before).taint_cstr(String::L_FILE_SPEC), 0775); pos_after=pos_before+1; } } bool file_write_action_under_lock( const String& file_spec, const char* action_name, File_write_action action, void *context, bool as_text, bool do_append, bool do_block, bool fail_on_lock_problem) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); int f; if(access(fname, W_OK)!=0) // no create_dir_for_file(file_spec); if((f=open(fname, O_CREAT|O_RDWR |(as_text?_O_TEXT:_O_BINARY) |(do_append?O_APPEND:PA_O_TRUNC), 0664))>=0) { if((do_block?pa_lock_exclusive_blocking(f):pa_lock_exclusive_nonblocking(f))!=0) { Exception e("file.lock", &file_spec, "shared lock failed: %s (%d), actual filename '%s'", strerror(errno), errno, fname); close(f); if(fail_on_lock_problem) throw e; return false; } try { #if (defined(HAVE_FCHMOD) && defined(PA_SAFE_MODE)) struct stat finfo; if(fstat(f, &finfo)==0 && finfo.st_mode & 0111) fchmod(f, finfo.st_mode & 0666/*clear executable bits*/); // backward: ignore errors if any #endif action(f, context); } catch(...) { #ifdef HAVE_FTRUNCATE if(!do_append) ftruncate(f, lseek(f, 0, SEEK_CUR)); // one can not use O_TRUNC, read lower #endif pa_unlock(f);close(f); rethrow; } #ifdef HAVE_FTRUNCATE if(!do_append) ftruncate(f, lseek(f, 0, SEEK_CUR)); // O_TRUNC truncates even exclusevely write-locked file [thanks to Igor Milyakov for discovering] #endif pa_unlock(f);close(f); return true; } else throw Exception(errno==EACCES?"file.access":0, &file_spec, "%s failed: %s (%d), actual filename '%s'", action_name, strerror(errno), errno, fname); // here should be nothing, see rethrow above } #ifndef DOXYGEN struct File_write_action_info { const char* str; size_t length; }; #endif static void file_write_action(int f, void *context) { File_write_action_info& info=*static_cast(context); if(info.length) { ssize_t written=write(f, info.str, info.length); if(written<0) throw Exception("file.write", 0, "write failed: %s (%d)", strerror(errno), errno); if((size_t)written!=info.length) throw Exception("file.write", 0, "write failed: %u of %u bytes written", written, info.length); } } void file_write( Request_charsets& charsets, const String& file_spec, const char* data, size_t size, bool as_text, bool do_append, Charset* asked_charset) { if(as_text && asked_charset){ String::C body=String::C(data, size); body=Charset::transcode(body, charsets.source(), *asked_charset); data=body.str; size=body.length; }; File_write_action_info info={data, size}; file_write_action_under_lock( file_spec, "write", file_write_action, &info, as_text, do_append); } static size_t get_dir(char* fname, size_t helper_length){ bool dir=false; size_t pos=0; for(pos=helper_length; pos; pos--){ char c=fname[pos-1]; if(c=='/' || c=='\\'){ fname[pos-1]=0; dir=true; } else if(dir) break; } return pos; } static bool entry_readable(char* fname, bool need_dir) { if(need_dir){ size_t size=strlen(fname); while(size) { char c=fname[size-1]; if(c=='/' || c=='\\') fname[--size]=0; else break; } } struct stat finfo; if(access(fname, R_OK)==0 && entry_exists(fname, &finfo)) { bool is_dir=(finfo.st_mode&S_IFDIR) != 0; return is_dir==need_dir; } return false; } static bool entry_readable(const String& file_spec, bool need_dir) { return entry_readable(file_spec.taint_cstrm(String::L_FILE_SPEC), need_dir); } // throws nothing! [this is required in file_move & file_delete] static void rmdir(const String& file_spec, size_t pos_after) { char* dir_spec=file_spec.taint_cstrm(String::L_FILE_SPEC); size_t length=strlen(dir_spec); while( (length=get_dir(dir_spec, length)) && (length > pos_after) ){ #ifdef _MSC_VER if(!entry_readable(dir_spec, true)) break; DWORD attrs=GetFileAttributes(dir_spec); if( (attrs==INVALID_FILE_ATTRIBUTES) || !(attrs & FILE_ATTRIBUTE_DIRECTORY) || (attrs & FILE_ATTRIBUTE_REPARSE_POINT) ) break; #endif if( rmdir(dir_spec) ) break; }; } bool file_delete(const String& file_spec, bool fail_on_problem, bool keep_empty_dirs) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); if(unlink(fname)!=0) if(fail_on_problem) throw Exception(errno==EACCES?"file.access":errno==ENOENT?"file.missing":0, &file_spec, "unlink failed: %s (%d), actual filename '%s'", strerror(errno), errno, fname); else return false; if(!keep_empty_dirs) rmdir(file_spec, 1); return true; } void file_move(const String& old_spec, const String& new_spec, bool keep_empty_dirs) { const char* old_spec_cstr=old_spec.taint_cstr(String::L_FILE_SPEC); const char* new_spec_cstr=new_spec.taint_cstr(String::L_FILE_SPEC); create_dir_for_file(new_spec); if(rename(old_spec_cstr, new_spec_cstr)!=0) throw Exception(errno==EACCES?"file.access":errno==ENOENT?"file.missing":0, &old_spec, "rename failed: %s (%d), actual filename '%s' to '%s'", strerror(errno), errno, old_spec_cstr, new_spec_cstr); if(!keep_empty_dirs) rmdir(old_spec, 1); } bool entry_exists(const char* fname, struct stat *afinfo) { struct stat lfinfo; bool result=stat(fname, &lfinfo)==0; if(afinfo) *afinfo=lfinfo; return result; } bool entry_exists(const String& file_spec) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); return entry_exists(fname, 0); } bool file_exist(const String& file_spec) { return entry_readable(file_spec, false); } bool dir_exists(const String& file_spec) { return entry_readable(file_spec, true); } const String* file_exist(const String& path, const String& name) { String& result=*new String(path); if(path.last_char() != '/') result << "/"; result << name; return file_exist(result)?&result:0; } bool file_executable(const String& file_spec) { return access(file_spec.taint_cstr(String::L_FILE_SPEC), X_OK)==0; } bool file_stat(const String& file_spec, size_t& rsize, time_t& ratime, time_t& rmtime, time_t& rctime, bool fail_on_read_problem) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); struct stat finfo; if(stat(fname, &finfo)!=0) if(fail_on_read_problem) throw Exception("file.missing", &file_spec, "getting file size failed: %s (%d), real filename '%s'", strerror(errno), errno, fname); else return false; rsize=finfo.st_size; ratime=finfo.st_atime; rmtime=finfo.st_mtime; rctime=finfo.st_ctime; return true; } /** String related functions */ bool capitalized(const char* s){ bool upper=true; for(const char* c=s; *c; c++){ if(*c != (upper ? toupper((unsigned char)*c) : tolower((unsigned char)*c))) return false; upper=strchr("-_ ", *c) != 0; } return true; } const char* capitalize(const char* s){ if(!s || capitalized(s)) return s; char* result=pa_strdup(s); if(result){ bool upper=true; for(char* c=result; *c; c++){ *c=upper ? (char)toupper((unsigned char)*c) : (char)tolower((unsigned char)*c); upper=strchr("-_ ", *c) != 0; } } return (const char*)result; } void fix_line_breaks(char *str, size_t& length) { //_asm int 3; const char* const eob=str+length; char* dest=str; // fix DOS: \r\n -> \n // fix Macintosh: \r -> \n char* bol=str; while(char* eol=(char*)memchr(bol, '\r', eob -bol)) { size_t len=eol-bol; if(dest!=bol) memmove(dest, bol, len); dest+=len; *dest++='\n'; if(&eol[1]='0' && c<='9'){ if(state == Flags) state=Width; // no more flags break; } else if(c=='d' || c=='i'){ result=FormatInt; } else if(strchr("feEgG", c)!=0){ result=FormatDouble; } else if(strchr("uoxX", c)!=0){ result=FormatUInt; } else { return FormatInvalid; // invalid char } state=Done; break; case Done: return FormatInvalid; // no chars allowed after 'type' } } return result; } const char* format(double value, const char* fmt) { char local_buf[MAX_NUMBER]; int size=-1; if(fmt && strlen(fmt)){ switch(format_type(fmt)){ case FormatDouble: size=snprintf(local_buf, sizeof(local_buf), fmt, value); break; case FormatInt: size=snprintf(local_buf, sizeof(local_buf), fmt, (int)value); break; case FormatUInt: size=snprintf(local_buf, sizeof(local_buf), fmt, (uint)value); break; case FormatInvalid: throw Exception(PARSER_RUNTIME, 0, "Incorrect format string '%s' was specified.", fmt); } } else size=snprintf(local_buf, sizeof(local_buf), "%d", (int)value); if(size < 0 || size >= MAX_NUMBER-1){ // on win32 we manually reduce max size while printing throw Exception(PARSER_RUNTIME, 0, "Error occure white executing snprintf with format string '%s'.", fmt); } return pa_strdup(local_buf, (size_t)size); } size_t stdout_write(const void *buf, size_t size) { #ifdef WIN32 size_t to_write = size; do{ int chunk_written=fwrite(buf, 1, min((size_t)8*0x400, size), stdout); if(chunk_written<=0) break; size-=chunk_written; buf=((const char*)buf)+chunk_written; } while(size>0); return to_write-size; #else return fwrite(buf, 1, size, stdout); #endif } enum EscapeState { EscapeRest, EscapeFirst, EscapeSecond, EscapeUnicode }; // @todo prescan for reduce required size (unescaped sting in 1 byte charset requires less memory usually) char* unescape_chars(const char* cp, int len, Charset* charset, bool js){ char* s=new(PointerFreeGC) char[len+1]; // must be enough (%uXXXX==6 bytes, max utf-8 char length==6 bytes) char* dst=s; EscapeState escapeState=EscapeRest; uint escapedValue=0; int srcPos=0; short int jsCnt=0; while(srcPosstore_Char((XMLByte*&)dst, (XMLCh)escapedValue, '?'); escapeState=EscapeRest; } } else { // not full unicode value escapeState=EscapeRest; } break; } } srcPos++; } *dst=0; // zero-termination return s; } char *search_stop(char*& current, char cstop_at) { // sanity check if(!current) return 0; // skip leading WS while(*current==' ' || *current=='\t') current++; if(!*current) return current=0; char *result=current; if(char *pstop_at=strchr(current, cstop_at)) { *pstop_at=0; current=pstop_at+1; } else current=0; return result; } #ifdef WIN32 void back_slashes_to_slashes(char* s) { if(s) for(; *s; s++) if(*s=='\\') *s='/'; } #endif bool StrStartFromNC(const char* str, const char* substr, bool equal){ while(true) { if(!(*substr)){ if(!(*str)) return true; else return !equal; } if(!(*str)) return false; if(isalpha((unsigned char)*str)) { if(tolower((unsigned char)*str)!=tolower((unsigned char)*substr)) return false; } else if((*str) != (*substr)) return false; str++; substr++; } } size_t strpos(const char *str, const char *substr) { const char *p = strstr(str, substr); return (p==0)?STRING_NOT_FOUND:p-str; } int remove_crlf(char* start, char* end) { char* from=start; char* to=start; bool skip=false; while(from < end){ switch(*from){ case '\n': case '\r': case '\t': case ' ': if(!skip){ *to=' '; to++; skip=true; } break; default: if(from != to) *to=*from; to++; skip=false; } from++; } return to-start; } const char* hex_digits="0123456789ABCDEF"; const char* hex_string(unsigned char* bytes, size_t size, bool upcase) { char *bytes_hex=new(PointerFreeGC) char [size*2/*byte->hh*/+1/*for zero-teminator*/]; unsigned char *src=bytes; unsigned char *end=bytes+size; char *dest=bytes_hex; const char *hex=upcase? hex_digits : "0123456789abcdef"; for(; srcs) r=s; #endif b[r]=0; return r; } int __snprintf(char* b, size_t s, const char* f, ...) { va_list l; va_start(l, f); int r=__vsnprintf(b, s, f, l); va_end(l); return r; } /* mime64 functions are from libgmime[http://spruce.sourceforge.net/gmime/] lib */ /* * Authors: Michael Zucchi * Jeffrey Stedfast * * Copyright 2000 Helix Code, Inc. (www.helixcode.com) * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. * */ static const char *base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * g_mime_utils_base64_encode_step: * @in: input stream * @inlen: length of the input * @out: output string * @state: holds the number of bits that are stored in @save * @save: leftover bits that have not yet been encoded * * Base64 encodes a chunk of data. Performs an 'encode step', only * encodes blocks of 3 characters to the output at a time, saves * left-over state in state and save (initialise to 0 on first * invocation). * * Returns the number of bytes encoded. **/ #define BASE64_GROUPS_IN_LINE 19 static size_t g_mime_utils_base64_encode_step (const unsigned char *in, size_t inlen, unsigned char *out, int *state, int *save) { register const unsigned char *inptr; register unsigned char *outptr; if (inlen <= 0) return 0; inptr = in; outptr = out; if (inlen + ((unsigned char *)save)[0] > 2) { const unsigned char *inend = in + inlen - 2; register int c1 = 0, c2 = 0, c3 = 0; register int already; already = *state; switch (((char *)save)[0]) { case 1: c1 = ((unsigned char *)save)[1]; goto skip1; case 2: c1 = ((unsigned char *)save)[1]; c2 = ((unsigned char *)save)[2]; goto skip2; } /* yes, we jump into the loop, no i'm not going to change it, its beautiful! */ while (inptr < inend) { c1 = *inptr++; skip1: c2 = *inptr++; skip2: c3 = *inptr++; *outptr++ = base64_alphabet [c1 >> 2]; *outptr++ = base64_alphabet [(c2 >> 4) | ((c1 & 0x3) << 4)]; *outptr++ = base64_alphabet [((c2 & 0x0f) << 2) | (c3 >> 6)]; *outptr++ = base64_alphabet [c3 & 0x3f]; /* this is a bit ugly ... */ if ((++already) >= BASE64_GROUPS_IN_LINE) { *outptr++ = '\n'; already = 0; } } ((unsigned char *)save)[0] = 0; inlen = 2 - (inptr - inend); *state = already; } //d(printf ("state = %d, inlen = %d\n", (int)((char *)save)[0], inlen)); if (inlen > 0) { register char *saveout; /* points to the slot for the next char to save */ saveout = & (((char *)save)[1]) + ((char *)save)[0]; /* inlen can only be 0 1 or 2 */ switch (inlen) { case 2: *saveout++ = *inptr++; case 1: *saveout++ = *inptr++; } *(char *)save = *(char *)save+(char)inlen; } /*d(printf ("mode = %d\nc1 = %c\nc2 = %c\n", (int)((char *)save)[0], (int)((char *)save)[1], (int)((char *)save)[2]));*/ return (outptr - out); } /** * g_mime_utils_base64_encode_close: * @in: input stream * @inlen: length of the input * @out: output string * @state: holds the number of bits that are stored in @save * @save: leftover bits that have not yet been encoded * * Base64 encodes the input stream to the output stream. Call this * when finished encoding data with g_mime_utils_base64_encode_step to * flush off the last little bit. * * Returns the number of bytes encoded. **/ static size_t g_mime_utils_base64_encode_close (const unsigned char *in, size_t inlen, unsigned char *out, int *state, int *save) { unsigned char *outptr = out; int c1, c2; if (inlen > 0) outptr += g_mime_utils_base64_encode_step (in, inlen, outptr, state, save); c1 = ((unsigned char *)save)[1]; c2 = ((unsigned char *)save)[2]; switch (((unsigned char *)save)[0]) { case 2: outptr[2] = base64_alphabet [(c2 & 0x0f) << 2]; goto skip; case 1: outptr[2] = '='; skip: outptr[0] = base64_alphabet [c1 >> 2]; outptr[1] = base64_alphabet [c2 >> 4 | ((c1 & 0x3) << 4)]; outptr[3] = '='; outptr += 4; break; } *outptr++ = 0; *save = 0; *state = 0; return (outptr - out); } static unsigned char gmime_base64_rank[256] = { 255,255,255,255,255,255,255,255,255,254,254,255,255,254,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 254,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255, 0,255,255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, }; /** * g_mime_utils_base64_decode_step: * @in: input stream * @inlen: max length of data to decode * @out: output stream * @state: holds the number of bits that are stored in @save * @save: leftover bits that have not yet been decoded * @strict: only base64 and whitespace chars are allowed * * Decodes a chunk of base64 encoded data. * * Returns the number of bytes decoded (which have been dumped in @out). **/ size_t g_mime_utils_base64_decode_step(const unsigned char *in, size_t inlen, unsigned char *out, int *state, int *save, bool strict=false) { const unsigned char *inptr; unsigned char *outptr; const unsigned char *inend; int saved; unsigned char c; int i; inend = in + inlen; outptr = out; /* convert 4 base64 bytes to 3 normal bytes */ saved = *save; i = *state; inptr = in; while (inptr < inend) { c = gmime_base64_rank[*inptr++]; switch(c) { case 0xff: // non-base64 and non-whitespace chars. not allowed in strict mode if(strict) throw Exception(BASE64_FORMAT, 0, "Invalid base64 char on position %d is detected", inptr-in-1); case 0xfe: // whitespace chars 0x09, 0x0A, 0x0D, 0x20 are allowed in any mode break; default: saved = (saved << 6) | c; i++; if (i == 4) { *outptr++ = (unsigned char)(saved >> 16); *outptr++ = (unsigned char)(saved >> 8); *outptr++ = (unsigned char)(saved); i = 0; } } } *save = saved; *state = i; /* quick scan back for '=' on the end somewhere */ /* fortunately we can drop 1 output char for each trailing = (upto 2) */ i = 2; while (inptr > in && i) { inptr--; if (gmime_base64_rank[*inptr] <= 0xfe) { if (*inptr == '=' && outptr > out) outptr--; i--; } } /* if i != 0 then there is a truncation error! */ return (outptr - out); } char* pa_base64_encode(const char *in, size_t in_size){ size_t new_size = ((in_size / 3 + 1) * 4); new_size += new_size / (BASE64_GROUPS_IN_LINE * 4)/*new lines*/ + 1/*zero terminator*/; char* result = new(PointerFreeGC) char[new_size]; int state=0; int save=0; #ifndef NDEBUG size_t filled= #endif g_mime_utils_base64_encode_close ((const unsigned char*)in, in_size, (unsigned char*)result, &state, &save); //throw Exception(PARSER_RUNTIME, 0, "%d %d %d", in_size, new_size, filled); assert(filled <= new_size); return result; } struct File_base64_action_info { unsigned char** base64; }; static void file_base64_file_action( struct stat& finfo, int f, const String&, const char* /*fname*/, bool, void *context) { if(finfo.st_size) { File_base64_action_info& info=*static_cast(context); *info.base64=new(PointerFreeGC) unsigned char[finfo.st_size * 2 + 6]; unsigned char* base64 = *info.base64; int state=0; int save=0; int nCount; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(f, buffer, sizeof(buffer)); if( nCount ){ size_t filled=g_mime_utils_base64_encode_step ((const unsigned char*)buffer, nCount, base64, &state, &save); base64+=filled; } } while(nCount > 0); g_mime_utils_base64_encode_close (0, 0, base64, &state, &save); } } char* pa_base64_encode(const String& file_spec){ unsigned char* base64=0; File_base64_action_info info={&base64}; file_read_action_under_lock(file_spec, "pa_base64_encode", file_base64_file_action, &info); return (char*)base64; } void pa_base64_decode(const char *in, size_t in_size, char*& result, size_t& result_size, bool strict) { // every 4 base64 bytes are converted into 3 normal bytes // not full set (tail) of 4-bytes set is ignored size_t new_size=in_size/4*3; result=new(PointerFreeGC) char[new_size+1/*terminator*/]; int state=0; int save=0; result_size= g_mime_utils_base64_decode_step ((const unsigned char*)in, in_size, (unsigned char*)result, &state, &save, strict); assert(result_size <= new_size); result[result_size]=0; // for text files if(strict && state!=0) throw Exception(BASE64_FORMAT, 0, "Unexpected end of chars"); } int file_block_read(const int f, unsigned char* buffer, const size_t size){ int nCount = read(f, buffer, size); if (nCount < 0) throw Exception("file.read", 0, "read failed: %s (%d)", strerror(errno), errno); return nCount; } static unsigned long crc32Table[256]; static void InitCrc32Table() { if(crc32Table[1] == 0){ // This is the official polynomial used by CRC32 in PKZip. // Often times the polynomial shown reversed as 0x04C11DB7. static const unsigned long dwPolynomial = 0xEDB88320; for(int i = 0; i < 256; i++) { unsigned long dwCrc = i; for(int j = 8; j > 0; j--) { if(dwCrc & 1) dwCrc = (dwCrc >> 1) ^ dwPolynomial; else dwCrc >>= 1; } crc32Table[i] = dwCrc; } } } inline void CalcCrc32(const unsigned char byte, unsigned long &crc32) { crc32 = ((crc32) >> 8) ^ crc32Table[(byte) ^ ((crc32) & 0x000000FF)]; } const unsigned long pa_crc32(const char *in, size_t in_size){ unsigned long crc32=0xFFFFFFFF; InitCrc32Table(); for(size_t i = 0; i(context); if(finfo.st_size) { InitCrc32Table(); int nCount=0; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(f, buffer, sizeof(buffer)); for(int i = 0; i < nCount; i++) CalcCrc32(buffer[i], crc32); } while(nCount > 0); } } const unsigned long pa_crc32(const String& file_spec){ unsigned long crc32=0xFFFFFFFF; file_read_action_under_lock(file_spec, "crc32", file_crc32_file_action, &crc32); return ~crc32; } // content-type: xxx; charset=WE-NEED-THIS // content-type: xxx; charset="WE-NEED-THIS" // content-type: xxx; charset="WE-NEED-THIS"; Charset* detect_charset(const char* content_type){ if(content_type){ char* CONTENT_TYPE=pa_strdup(content_type); for(char *p=CONTENT_TYPE; *p; p++) *p=(char)toupper((unsigned char)*p); if(const char* begin=strstr(CONTENT_TYPE, "CHARSET=")){ begin+=8; // skip "CHARSET=" char* end=0; if(*begin && (*begin=='"' || *begin =='\'')){ char quote=*begin; begin++; end=(char*)strchr(begin, quote); } if(!end) end=(char*)strchr(begin, ';'); if(end) *end=0; // terminator return *begin?&charsets.get(begin):0; } } return 0; } static bool isLeap(int year) { return !( (year % 4) || ((year % 400) && !(year % 100)) ); } int getMonthDays(int year, int month) { static int monthDays[]={ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; return (month == 1 /* january -- 0 */ && isLeap(year)) ? 29 : monthDays[month]; } String::C date_gmt_string(tm* tms) { /// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 static const char month_names[12][4]={ "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; static const char days[7][4]={ "Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; char *buf=new(PointerFreeGC) char[MAX_STRING]; return String::C(buf, snprintf(buf, MAX_STRING, "%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT", days[tms->tm_wday], tms->tm_mday,month_names[tms->tm_mon],tms->tm_year+1900, tms->tm_hour,tms->tm_min,tms->tm_sec)); } parser-3.4.3/src/main/pa_request.C000644 000000 000000 00000073450 12231311521 017103 0ustar00rootwheel000000 000000 /** @file Parser: request class main part. @see compile.C and execute.C. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_sapi.h" #include "pa_common.h" #include "pa_request.h" #include "pa_wwrapper.h" #include "pa_vclass.h" #include "pa_globals.h" #include "pa_vint.h" #include "pa_vmethod_frame.h" #include "pa_types.h" #include "pa_venv.h" #include "pa_vmath.h" #include "pa_vstatus.h" #include "pa_vrequest.h" #include "pa_vtable.h" #include "pa_vfile.h" #include "pa_dictionary.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_cache_managers.h" #include "pa_vmail.h" #include "pa_vform.h" #include "pa_vcookie.h" #include "pa_vresponse.h" #include "pa_vmemory.h" #include "pa_vconsole.h" #include "pa_vdate.h" volatile const char * IDENT_PA_REQUEST_C="$Id: pa_request.C,v 1.337 2013/10/21 20:49:21 moko Exp $" IDENT_PA_REQUEST_H IDENT_PA_REQUEST_CHARSETS_H IDENT_PA_REQUEST_INFO_H IDENT_PA_VCONSOLE_H; // consts #define UNHANDLED_EXCEPTION_METHOD_NAME "unhandled_exception" /// content type of exception response, when no @MAIN:exception handler defined const char* UNHANDLED_EXCEPTION_CONTENT_TYPE="text/plain"; /// content type of response when no $MAIN:defaults.content-type defined const char* DEFAULT_CONTENT_TYPE="text/html"; const char* ORIGINS_CONTENT_TYPE="text/plain"; // defines for globals #define MAIN_METHOD_NAME "main" #define AUTO_METHOD_NAME "auto" #define AUTOUSE_METHOD_NAME "autouse" #define BODY_NAME "body" #define EXCEPTION_TYPE_PART_NAME "type" #define EXCEPTION_SOURCE_PART_NAME "source" #define EXCEPTION_COMMENT_PART_NAME "comment" // globals const String main_method_name(MAIN_METHOD_NAME); const String auto_method_name(AUTO_METHOD_NAME); const String autouse_method_name(AUTOUSE_METHOD_NAME); const String body_name(BODY_NAME); const String exception_type_part_name(EXCEPTION_TYPE_PART_NAME); const String exception_source_part_name(EXCEPTION_SOURCE_PART_NAME); const String exception_comment_part_name(EXCEPTION_COMMENT_PART_NAME); const String exception_handled_part_name(EXCEPTION_HANDLED_PART_NAME); // defines for statics #define CHARSETS_NAME "CHARSETS" #define MIME_TYPES_NAME "MIME-TYPES" #define STRICT_VARS_NAME "STRICT-VARS" #define ORIGINS_MODE_NAME "ORIGINS" #define CONF_METHOD_NAME "conf" #define POST_PROCESS_METHOD_NAME "postprocess" #define DOWNLOAD_NAME "download" #define CLASS_PATH_NAME "CLASS_PATH" #define RESPONSE_BODY_FILE_NAME "file" // statics static const String charsets_name(CHARSETS_NAME); static const String main_class_name(MAIN_CLASS_NAME); static const String mime_types_name(MIME_TYPES_NAME); static const String strict_vars_name(STRICT_VARS_NAME); static const String origins_mode_name(ORIGINS_MODE_NAME); static const String conf_method_name(CONF_METHOD_NAME); static const String post_process_method_name(POST_PROCESS_METHOD_NAME); static const String download_name(DOWNLOAD_NAME); static const String class_path_name(CLASS_PATH_NAME); static const String response_body_file_name(RESPONSE_BODY_FILE_NAME); // defines // op.C VStateless_class& VClassMAIN_create(); // Request::Request(SAPI_Info& asapi_info, Request_info& arequest_info, String::Language adefault_lang): // private anti_endless_execute_recoursion(0), // public allow_class_replace(false), method_frame(0), rcontext(0), wcontext(0), flang(adefault_lang), fconnection(0), finterrupted(false), fskip(SKIP_NOTHING), fin_cycle(0), // public request_info(arequest_info), sapi_info(asapi_info), charsets(UTF8_charset, UTF8_charset, UTF8_charset), // default charsets main_class(VClassMAIN_create()), form(*new VForm(charsets, arequest_info)), mail(*new VMail), response(*new VResponse(arequest_info, charsets)), cookie(*new VCookie(charsets, arequest_info)), console(*new VConsole), // private configure_admin_done(false), // private defaults fdefault_lang(adefault_lang), // private mime types mime_types(0) { pa_register_thread_request(*this); // file_no=0 => unknown file_list+=String::Body("UNKNOWN"); file_list+=String::Body("-body of process-"); // pseudo_file_no__process // maybe expire old caches cache_managers->maybe_expire(); /// directly used // MAIN class, operators classes().put(main_class.name(), &main_class); // classes: // table, file, random, mail, image, ... methoded_array().register_directly_used(*this); /// methodless // env class classes().put(String::Body(ENV_CLASS_NAME), new VEnv(asapi_info)); // status class classes().put(String::Body(STATUS_CLASS_NAME), new VStatus()); // request class classes().put(String::Body(REQUEST_CLASS_NAME), new VRequest(arequest_info, charsets, form)); // cookie class classes().put(String::Body(COOKIE_CLASS_NAME), &cookie); // console class classes().put(String::Body(CONSOLE_CLASS_NAME), &console); /// methoded // response class classes().put(response.get_class()->name(), &response); /// bases used // form class classes().put(form.get_class()->base_class()->name(), &form); // mail class classes().put(mail.get_class()->base_class()->name(), &mail); // math class { Value& math=*new VMath; classes().put(math.get_class()->base_class()->name(), &math); } // memory class { Value& memory=*new VMemory; classes().put(memory.get_class()->base_class()->name(), &memory); } } Request::~Request() { #ifdef XML // if for some strange reason xml generic errors failed to be reported, free them up if(const char* xml_generic_errors=xmlGenericErrors()) { SAPI::log(sapi_info, "warning: unreported xmlGenericErrors: %s", xml_generic_errors); free((void *)xml_generic_errors); } #endif } Value& Request::get_self() { return method_frame/*always have!*/->self(); } Value* Request::get_class(const String& name){ Value* result=classes().get(name); if(!result) if(Value* value=main_class.get_element(autouse_method_name)) if(Junction* junction=value->get_junction()) if(const Method *method=junction->method) { Value *vname=new VString(name); VMethodFrame frame(*method, 0 /*no parent*/, main_class); frame.store_params(&vname, 1); // we don't need the result execute_method(frame); result=classes().get(name); } return result; } static void load_charset(HashStringValue::key_type akey, HashStringValue::value_type avalue, Request_charsets* charsets) { const String::Body NAME=String(akey, String::L_CLEAN).change_case(charsets->source(), String::CC_UPPER); ::charsets.load_charset(*charsets, NAME, avalue->as_string()); } void Request::configure_admin(VStateless_class& conf_class) { if(configure_admin_done) throw Exception(PARSER_RUNTIME, 0, "parser already configured"); configure_admin_done=true; // charsets must only be specified in method_frame config // so that users would not interfere /* $MAIN:CHARSETS[ $.charsetname1[/full/path/to/charset/file.cfg] ... ] */ if(Value* vcharsets=conf_class.get_element(charsets_name)) { if(!vcharsets->is_string()) if(HashStringValue* charsets=vcharsets->get_hash()) charsets->for_each(load_charset, &this->charsets); else throw Exception(PARSER_RUNTIME, 0, "$" MAIN_CLASS_NAME ":" CHARSETS_NAME " must be hash"); } #ifdef STRICT_VARS VVoid::strict_vars=false; if(Value* strict_vars=conf_class.get_element(strict_vars_name)) { if(strict_vars->is_bool()) VVoid::strict_vars=strict_vars->as_bool(); else throw Exception(PARSER_RUNTIME, 0, "$" MAIN_CLASS_NAME ":" STRICT_VARS_NAME " must be bool"); } #endif // configure method_frame options // until someone with less privileges have overriden them methoded_array().configure_admin(*this); } const char* Request::get_exception_cstr( const Exception& e, Request::Exception_details& details) { #define PA_URI_FORMAT "%s: " #define PA_ORIGIN_FILE_POS_FORMAT "%s(%d:%d): " #define PA_SOURCE_FORMAT "'%s' " #define PA_COMMENT_TYPE_FORMAT "%s [%s]" char* result=new(PointerFreeGC) char[MAX_STRING]; if(details.problem_source) { // do we know the guy? if(details.trace) { // do whe know where he came from? Operation::Origin origin=details.trace.origin(); snprintf(result, MAX_STRING, PA_URI_FORMAT PA_ORIGIN_FILE_POS_FORMAT PA_SOURCE_FORMAT PA_COMMENT_TYPE_FORMAT, request_info.uri, file_list[origin.file_no].cstr(), 1+origin.line, 1+origin.col, details.problem_source->cstr(), e.comment(), e.type() ); } else snprintf(result, MAX_STRING, PA_URI_FORMAT PA_SOURCE_FORMAT PA_COMMENT_TYPE_FORMAT, request_info.uri, details.problem_source->cstr(), e.comment(), e.type() ); } else snprintf(result, MAX_STRING, PA_URI_FORMAT PA_COMMENT_TYPE_FORMAT, request_info.uri, e.comment(), e.type() ); return result; } void Request::configure() { // configure admin options if not configured yet if(!configure_admin_done) configure_admin(main_class); // configure not-admin=user options methoded_array().configure_user(*this); // $MAIN:MIME-TYPES if(Value* element=main_class.get_element(mime_types_name)) if(Table *table=element->get_table()) mime_types=table; } /** load MAIN class, execute @main. MAIN class consists of all the auto.p files we'd manage to find plus the file user requested us to process all located classes become children of one another, composing class we name 'MAIN' @test log stack trace */ void Request::core(const char* config_filespec, bool config_fail_on_read_problem, bool header_only) { try { // filling mail received mail.fill_received(*this); // loading config if(config_filespec) { const String& filespec=*new String(config_filespec); use_file_directly(main_class, filespec, config_fail_on_read_problem, true /*file must exist if 'fail on read problem' not set*/); } // loading auto.p files from document_root/.. // to the one beside requested file. // all assigned bases from upper dir { const char* after=request_info.path_translated; size_t drlen=strlen(request_info.document_root); if(memcmp(after, request_info.document_root, drlen)==0) { after+=drlen; if(after[-1]=='/') --after; } while(const char* before=strchr(after, '/')) { String& sfile_spec=*new String; if(after!=request_info.path_translated) { sfile_spec.append_strdup( request_info.path_translated, before-request_info.path_translated, String::L_CLEAN); sfile_spec << "/" AUTO_FILE_NAME; use_file_directly(main_class, sfile_spec, true /*fail on read problem*/, false /*but ignore absence, sole user*/); } for(after=before+1;*after=='/';after++); } } try { // compile requested file String& spath_translated=*new String; spath_translated.append_help_length(request_info.path_translated, 0, String::L_TAINTED); use_file_directly(main_class, spath_translated); configure(); } catch(...) { configure(); // configure anyway, useful in @unhandled_exception [say, if they would want to mail by SMTP something] rethrow; } // execute @main[] const String* body_string=execute_virtual_method(main_class, main_method_name); if(!body_string) throw Exception(PARSER_RUNTIME, 0, "'"MAIN_METHOD_NAME"' method not found"); // extract response body Value* body_value=response.fields().get(download_name); // $response:download? bool as_attachment=body_value!=0; if(!body_value) body_value=response.fields().get(body_name); // $response:body if(!body_value) body_value=new VString(*body_string); // just result of ^main[] // @postprocess if(Value* value=main_class.get_element(post_process_method_name)) if(Junction* junction=value->get_junction()) if(const Method *method=junction->method) { // preparing to pass parameters to // @postprocess[data] VMethodFrame frame(*method, 0 /*no parent*/, main_class); frame.store_params(&body_value, 1); execute_method(frame); body_value=&frame.result().as_value(); } VFile* body_file=body_value->as_vfile(flang, &charsets); // OK. write out the result output_result(body_file, header_only, as_attachment); } catch(const Exception& e) { // request handling problem try { // we're returning not result, but error explanation Request::Exception_details details=get_details(e); const char* exception_cstr=get_exception_cstr(e, details); // reset language to default flang=fdefault_lang; // reset response response.fields().clear(); // this is what we'd return in $response:body const String* body_string=0; // maybe we'd be lucky enough as to report an error // in a gracefull way... if(Value* value=main_class.get_element(*new String(UNHANDLED_EXCEPTION_METHOD_NAME))) { if(Junction* junction=value->get_junction()) { if(const Method *method=junction->method) { // preparing to pass parameters to // @unhandled_exception[exception;stack] // $stack[^table::create{name file lineno colno}] Table::columns_type stack_trace_columns(new ArrayString); *stack_trace_columns+=new String("name"); *stack_trace_columns+=new String("file"); *stack_trace_columns+=new String("lineno"); *stack_trace_columns+=new String("colno"); Table& stack_trace=*new Table(stack_trace_columns); if(!exception_trace.is_empty()/*signed!*/) for(size_t i=exception_trace.bottom_index(); ias_bool()) { SAPI::log(sapi_info, "%s", exception_cstr); } // ERROR. write it out output_result(body_file, header_only, false); } catch(const Exception& e) { // exception in unhandled exception Request::Exception_details details=get_details(e); const char* exception_cstr=get_exception_cstr(e, details); // unconditionally log the beast SAPI::log(sapi_info, "%s", exception_cstr); throw Exception(0, 0, "in %s", exception_cstr); } } } uint Request::register_file(String::Body file_spec) { file_list+=file_spec; return file_list.count()-1; } void Request::use_file_directly(VStateless_class& aclass, const String& file_spec, bool fail_on_read_problem, bool fail_on_file_absence) { // cyclic dependence check if(used_files.get(file_spec)) return; used_files.put(file_spec, true); if(fail_on_read_problem && !fail_on_file_absence) // ignore file absence if asked for if(!entry_exists(file_spec)) return; if(const char* source=file_read_text(charsets, file_spec, fail_on_read_problem)) use_buf(aclass, source, 0, register_file(file_spec)); } void Request::use_file(VStateless_class& aclass, const String& file_name, const String* use_filespec/*absolute*/) { if(file_name.is_empty()) throw Exception(PARSER_RUNTIME, 0, "usage failed - no filename was specified"); const String* filespec=0; if(file_name.first_char()=='/') //absolute path? [no need to scan MAIN:CLASS_PATH] filespec=&absolute(file_name); else if(use_filespec){ // search in current dir first size_t last_slash_pos=use_filespec->strrpbrk("/"); if(last_slash_pos!=STRING_NOT_FOUND) filespec=file_exist(use_filespec->mid(0, last_slash_pos), file_name); // found in current dir? } if(!filespec){ // prevent multiple scan CLASS_PATH for searching one file if(searched_along_class_path.get(file_name)) return; searched_along_class_path.put(file_name, true); if(Value* element=main_class.get_element(class_path_name)) { if(element->is_string()) { filespec=file_exist(absolute(element->as_string()), file_name); // found at class_path? } else if(Table *table=element->get_table()) { for(size_t i=table->count(); i--; ) { const String& path=*(*table->get(i))[0]; if(filespec=file_exist(absolute(path), file_name)) break; // found along class_path } } else throw Exception(PARSER_RUNTIME, 0, "$" CLASS_PATH_NAME " must be string or table"); if(!filespec) throw Exception(PARSER_RUNTIME, &file_name, "not found along " MAIN_CLASS_NAME ":" CLASS_PATH_NAME); } else throw Exception(PARSER_RUNTIME, &file_name, "usage failed - no $" MAIN_CLASS_NAME ":" CLASS_PATH_NAME " were specified"); } use_file_directly(aclass, *filespec); } void Request::use_buf(VStateless_class& aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset) { // temporary zero @conf so to maybe-replace it in compiled code Temp_method temp_method_conf(aclass, conf_method_name, 0); // temporary zero @auto so to maybe-replace it in compiled code Temp_method temp_method_auto(aclass, auto_method_name, 0); // compile loaded classes ArrayClass& cclasses=compile(&aclass, source, main_alias, file_no, line_no_offset); VString* vfilespec= new VString(*new String(file_list[file_no], String::L_TAINTED)); for(size_t i=0; iname*/); // locate and execute possible @auto[] static execute_nonvirtual_method(cclass, auto_method_name, vfilespec, false/*no result needed*/); cclass.enable_default_setter(); } } const String& Request::relative(const char* apath, const String& relative_name) { char *hpath=strdup(apath); String& result=*new String; if(rsplit(hpath, '/')) // if something/splitted result << hpath << "/"; result << relative_name; return result; } const String& Request::absolute(const String& relative_name) { if(relative_name.first_char()=='/') { String& result=*new String(strdup(request_info.document_root)); result << relative_name; return result; } else if(relative_name.pos("://")!=STRING_NOT_FOUND // something like "http://xxx" #ifdef WIN32 || relative_name.pos(":")==1 // DRIVE: || relative_name.starts_with("\\\\") // UNC1 || relative_name.starts_with("//") // UNC2 #endif ) return relative_name; else return relative(request_info.path_translated, relative_name); } #ifndef DOXYGEN class Add_header_attribute_info { public: Add_header_attribute_info(Request& ar) : r(ar), add_last_modified(true) {} Request& r; bool add_last_modified; }; #endif static void add_header_attribute( HashStringValue::key_type name, HashStringValue::value_type value, Add_header_attribute_info* info) { if(name==BODY_NAME || name==DOWNLOAD_NAME || name==CHARSET_NAME) return; const char* aname=String(name, String::L_URI).untaint_and_transcode_cstr(String::L_URI, &info->r.charsets); SAPI::add_header_attribute(info->r.sapi_info, aname, attributed_meaning_to_string(*value, String::L_URI, false).untaint_and_transcode_cstr(String::L_URI, &info->r.charsets) ); if(strcasecmp(aname, "last-modified")==0) info->add_last_modified=false; } static void output_sole_piece(Request& r, bool header_only, VFile& body_file, Value* body_file_content_type) { // transcode text body when "text/*" or simple result String::C output(body_file.value_ptr(), body_file.value_size()); if(!body_file_content_type/*vstring.as_vfile*/ || body_file_content_type->as_string().pos("text/")==0) output=Charset::transcode(output, r.charsets.source(), r.charsets.client()); // prepare header: Content-Length SAPI::add_header_attribute(r.sapi_info, HTTP_CONTENT_LENGTH, format(output.length, "%u")); // send header SAPI::send_header(r.sapi_info); // send body if(!header_only) SAPI::send_body(r.sapi_info, output.str, output.length); } #ifndef DOXYGEN struct Range { size_t start; size_t end; }; #endif static void parse_range(const String* s, Array &ar) { const char *p = s->cstr(); if(s->starts_with("bytes=")) p += 6; Range r; while(*p){ r.start = (size_t)-1; r.end = (size_t)-1; if(*p >= '0' && *p <= '9'){ r.start = atol(p); while(*p>='0' && *p<='9') ++p; } if(*p++ != '-') break; if(*p >= '0' && *p <= '9'){ r.end = atol(p); while(*p>='0' && *p<='9') ++p; } if(*p == ',') ++p; ar += r; } } static void output_pieces(Request& r, bool header_only, const String& filename, size_t content_length, Value& date, bool add_last_modified) { SAPI::add_header_attribute(r.sapi_info, "accept-ranges", "bytes"); const size_t BUFSIZE = 10*0x400; char buf[BUFSIZE]; const char *range = SAPI::get_env(r.sapi_info, "HTTP_RANGE"); size_t offset=0; size_t part_length=content_length; if(range){ Array ar; parse_range(new String(range), ar); size_t count = ar.count(); if(count == 1){ Range &rg = ar.get_ref(0); if(rg.start == (size_t)-1 && rg.end == (size_t)-1){ SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "416 Requested Range Not Satisfiable"); return; } if(rg.start == (size_t)-1 && rg.end != (size_t)-1){ rg.start = content_length - rg.end; rg.end = content_length; offset += rg.start; part_length = rg.end-rg.start; }else if(rg.start != (size_t)-1 && rg.end == (size_t)-1){ rg.end = content_length-1; offset += rg.start; part_length -= rg.start; } if(part_length == 0){ SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "204 No Content"); return; } SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "206 Partial Content"); snprintf(buf, BUFSIZE, "bytes %u-%u/%u", rg.start, rg.end, content_length); SAPI::add_header_attribute(r.sapi_info, "content-range", buf); }else if(count != 0){ SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "501 Not Implemented"); return; } } SAPI::add_header_attribute(r.sapi_info, HTTP_CONTENT_LENGTH, format(part_length, "%u")); if(add_last_modified) SAPI::add_header_attribute(r.sapi_info, "last-modified", attributed_meaning_to_string(date, String::L_AS_IS, true).cstr()); SAPI::send_header(r.sapi_info); const String& filespec=r.absolute(filename); size_t sent = 0; if(!header_only){ size_t to_read = 0; size_t size = 0; do{ to_read = part_lengthfields().get(content_type_name); // Content-Disposition Value* vfile_name=body_file->fields().get(name_name); if(!vfile_name) { vfile_name=body_file->fields().get(response_body_file_name); if(vfile_name) { char* name_cstr=vfile_name->as_string().cstrm(); if(char *after_slash=rsplit(name_cstr, '\\')) name_cstr=after_slash; if(char *after_slash=rsplit(name_cstr, '/')) name_cstr=after_slash; vfile_name=new VString(*new String(name_cstr)); } } if(vfile_name) { const String& sfile_name=vfile_name->as_string(); if(sfile_name!=NONAME_DAT) { VHash& hash=*new VHash(); HashStringValue &h=hash.hash(); h.put(value_name, new VString( as_attachment ? content_disposition_attachment : content_disposition_inline )); h.put(content_disposition_filename_name, new VString(String(sfile_name, String::L_HTTP_HEADER))); response.fields().put(content_disposition, &hash); if(!body_file_content_type) body_file_content_type=new VString(mime_type_of(sfile_name.cstr())); } } // set Content-Type if(body_file_content_type) { // body file content type response.fields().put(content_type_name, body_file_content_type); } else { // default content type response.fields().put_dont_replace(content_type_name, new VString(*new String(DEFAULT_CONTENT_TYPE))); } // prepare header: $response:fields without :body, :download and :charset Add_header_attribute_info info(*this); response.fields().for_each(add_header_attribute, &info); if(Value* vresponse_body_file=body_file->fields().get(response_body_file_name)) { // $response:[download|body][$.file[filespec]] -- optput specified file const String& sresponse_body_file=vresponse_body_file->as_string(); size_t content_length=0; time_t atime=0, mtime=0, ctime=0; file_stat(absolute(sresponse_body_file), content_length, atime, mtime, ctime); VDate* vdate=0; if(Value* v=body_file->fields().get("mdate")) { if(Value* vdatep=v->as(VDATE_TYPE)) vdate=static_cast(vdatep); else throw Exception(PARSER_RUNTIME, 0, "mdate must be a date"); } if(!vdate) vdate=new VDate(mtime); output_pieces(*this, header_only, sresponse_body_file, content_length, *vdate, info.add_last_modified); } else { if(body_file_content_type) if(HashStringValue *hash=body_file_content_type->get_hash()) body_file_content_type=hash->get(value_name); output_sole_piece(*this, header_only, *body_file, body_file_content_type); } } const String& Request::mime_type_of(const String* file_name) { return mime_type_of(file_name?file_name->taint_cstr(String::L_FILE_SPEC):0); } const String& Request::mime_type_of(const char* user_file_name_cstr) { if(mime_types) if(const char* cext=strrchr(user_file_name_cstr, '.')) { String sext(++cext); Table::Action_options options; if(mime_types->locate(0, sext.change_case(charsets.source(), String::CC_LOWER), options)) if(const String* result=mime_types->item(1)) return *result; else throw Exception(PARSER_RUNTIME, 0, MIME_TYPES_NAME " table column elements must not be empty"); } return *new String("application/octet-stream"); } const String* Request::get_used_filename(uint file_no){ if(file_no < file_list.count()) return new String(file_list[file_no], String::L_TAINTED); return 0; } #ifdef XML xmlChar* Request::transcode(const String& s) { return charsets.source().transcode(s); } xmlChar* Request::transcode(const String::Body s) { return charsets.source().transcode(s); } const String& Request::transcode(const xmlChar* s) { return charsets.source().transcode(s); } #endif const Request::Trace Request::Exception_trace::extract_origin(const String*& problem_source) { Trace result; if(!is_empty()) { result=bottom_value(); if(!problem_source) { // we don't know who trigged the bug? problem_source=result.name(); // consider the stack-top-guy (we usually know source of next-from-throw-point exception) did that fbottom++; } else if(result.name()==problem_source) // it is that same guy? fbottom++; // throw away that trace else { // stack top contains not us, // leaving result intact // it would help ^throw } } return result; } Request::Exception_details Request::get_details(const Exception& e) { const String* problem_source=e.problem_source(); Trace trace=exception_trace.extract_origin(problem_source); VHash& vhash=*new VHash; HashStringValue& hash=vhash.hash(); // $.type if(const char* type=e.type(true)) hash.put(exception_type_part_name, new VString(*new String(type))); // $.source if(problem_source) { String& source=*new String(*problem_source, String::L_TAINTED); hash.put(exception_source_part_name, new VString(source)); } // $.file lineno colno if(trace) { const Operation::Origin origin=trace.origin(); hash.put(String::Body("file"), new VString(*new String(file_list[origin.file_no], String::L_TAINTED))); hash.put(String::Body("lineno"), new VInt(1+origin.line)); hash.put(String::Body("colno"), new VInt(1+origin.col)); } // $.comment if(const char* comment=e.comment(true)) hash.put(exception_comment_part_name, new VString(*new String(comment, String::L_TAINTED))); // $.handled(0) hash.put(exception_handled_part_name, &VBool::get(false)); return Request::Exception_details(trace, problem_source, vhash); } Temp_value_element::Temp_value_element(Request& arequest, Value& awhere, const String& aname, Value* awhat) : frequest(arequest), fwhere(awhere), fname(aname), saved(awhere.get_element(aname)) { Junction* junction; if(saved && (junction=saved->get_junction()) && junction->is_getter) saved=0; frequest.put_element(fwhere, aname, awhat); } Temp_value_element::~Temp_value_element() { frequest.put_element(fwhere, fname, saved ? saved : VVoid::get()); } parser-3.4.3/src/main/pa_charsets.C000644 000000 000000 00000002111 11730603275 017226 0ustar00rootwheel000000 000000 /** @file Parser: sql driver manager implementation. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_charsets.h" volatile const char * IDENT_PA_CHARSETS_C="$Id: pa_charsets.C,v 1.19 2012/03/16 09:24:13 moko Exp $" IDENT_PA_CHARSETS_H; // defines for globals #define CHARSET_UTF8_NAME "UTF-8" // globals Charset UTF8_charset(0, *new String(CHARSET_UTF8_NAME), 0/*no file=system*/); Charsets charsets; // methods Charsets::Charsets() { put(UTF8_charset.NAME(), &UTF8_charset); } Charset& Charsets::get(const String::Body ANAME) { if(Charset* result=HashString::get(ANAME)) return *result; else throw Exception(PARSER_RUNTIME, new String(ANAME, String::L_TAINTED), "unknown charset"); } void Charsets::load_charset(Request_charsets& charsets, const String::Body ANAME, const String& afile_spec) { //we know that charset? if(HashString::get(ANAME)) return; // don't load it then put(ANAME, new Charset(&charsets, ANAME, &afile_spec)); } parser-3.4.3/src/main/compile.y000644 000000 000000 00000126117 12222351711 016455 0ustar00rootwheel000000 000000 %{ /** @file Parser: compiler(lexical parser and grammar). Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) */ volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.265 2013/09/30 19:40:57 moko Exp $"; /** @todo parser4: - cache compiled code from request to request. to do that... -#: make method definitions, @CLASS, @BASE, @USE instructions, which would be executed afterwards, and actions now performed at compile time would be delayed to run time. -#: make cache expiration on time and on disk-change of class source -#: in apache use subpools for compiled class storage -#: in iis make up specialized Pool object for that */ #define YYSTYPE ArrayOperation* #define YYPARSE_PARAM pc #define YYLEX_PARAM pc #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define yyerror(msg) real_yyerror((Parse_control *)pc, msg) #define YYPRINT(file, type, value) yyprint(file, type, value) // includes #include "compile_tools.h" #include "pa_value.h" #include "pa_request.h" #include "pa_vobject.h" #include "pa_vdouble.h" #include "pa_globals.h" #include "pa_vmethod_frame.h" // defines #define USE_CONTROL_METHOD_NAME "USE" #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS" #define OPTION_ALL_VARS_LOCAL_NAME "locals" #define OPTION_PARTIAL_CLASS "partial" #define REM_OPERATOR_NAME "rem" // forwards static int real_yyerror(Parse_control* pc, const char* s); static void yyprint(FILE* file, int type, YYSTYPE value); static int yylex(YYSTYPE* lvalp, void* pc); static const VBool vfalse(false); static const VBool vtrue(true); static const VString vempty; // local convinient inplace typecast & var #undef PC #define PC (*(Parse_control *)pc) #undef POOL #define POOL (*PC.pool) #ifndef DOXYGEN #define CLASS_ADD if(PC.class_add()){ \ strncpy(PC.error, PC.cclass->name().cstr(), MAX_STRING/2); \ strcat(PC.error, " - class is already defined"); \ YYERROR; \ } %} %pure_parser %token EON %token STRING %token BOGUS %token BAD_STRING_COMPARISON_OPERATOR %token BAD_HEX_LITERAL %token BAD_METHOD_DECL_START %token BAD_METHOD_PARAMETER_NAME_CHARACTER %token BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE %token LAND "&&" %token LOR "||" %token LXOR "!||" %token NXOR "!|" %token NLE "<=" %token NGE ">=" %token NEQ "==" %token NNE "!=" %token NSL "<<" %token NSR ">>" %token SLT "lt" %token SGT "gt" %token SLE "le" %token SGE "ge" %token SEQ "eq" %token SNE "ne" %token DEF "def" %token IN "in" %token FEXISTS "-f" %token DEXISTS "-d" %token IS "is" %token LITERAL_TRUE "true" %token LITERAL_FALSE "false" /* logical */ %left "!||" %left "||" %left "&&" %left '<' '>' "<=" ">=" "lt" "gt" "le" "ge" %left "==" "!=" "eq" "ne" %left "is" "def" "in" "-f" "-d" /* bitwise */ %left "!|" %left '|' %left '&' %left "<<" ">>" /* numerical */ %left '+' '-' %left '*' '/' '\\' '%' %left NUNARY /* unary - + */ /* out-of-group */ %left '~' /* bitwise */ %left '!' /* logical */ %% all: one_big_piece { Method* method=new Method(Method::CT_ANY, 0, 0, /*min, max numbered_params_count*/ 0/*param_names*/, 0/*local_names*/, $1/*parser_code*/, 0/*native_code*/); PC.cclass->set_method(PC.alias_method(main_method_name), method); } | methods; methods: method | methods method; one_big_piece: maybe_codes; method: control_method | code_method; control_method: '@' STRING '\n' maybe_control_strings { const String& command=LA2S(*$2)->trim(String::TRIM_END); YYSTYPE strings_code=$4; if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) { strcpy(PC.error, "@"); strcat(PC.error, command.cstr()); strcat(PC.error, " is empty"); YYERROR; } if(command==CLASS_NAME) { if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { CLASS_ADD; // new class' name const String& name=LA2S(*strings_code)->trim(String::TRIM_END); // creating the class VStateless_class* cclass=new VClass; PC.cclass_new=cclass; PC.cclass_new->set_name(name); } else { strcpy(PC.error, "@"CLASS_NAME" must contain only one line with class name (contains more then one)"); YYERROR; } } else if(command==USE_CONTROL_METHOD_NAME) { CLASS_ADD; for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) PC.request.use_file(PC.request.main_class, LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filename(PC.file_no)); } else if(command==BASE_NAME) { if(PC.append){ strcpy(PC.error, "can't set base while appending methods to class '"); strncat(PC.error, PC.cclass->name().cstr(), MAX_STRING/2); strcat(PC.error, "'"); YYERROR; } CLASS_ADD; if(PC.cclass->base_class()) { // already changed from default? strcpy(PC.error, "class already have a base '"); strncat(PC.error, PC.cclass->base_class()->name().cstr(), MAX_STRING/2); strcat(PC.error, "'"); YYERROR; } if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { const String& base_name=LA2S(*strings_code)->trim(String::TRIM_END); if(Value* base_class_value=PC.request.get_class(base_name)) { // @CLASS == @BASE sanity check if(VStateless_class *base_class=base_class_value->get_class()) { if(PC.cclass==base_class) { strcpy(PC.error, "@"CLASS_NAME" equals @"BASE_NAME); YYERROR; } PC.cclass->get_class()->set_base(base_class); } else { // they asked to derive from a class without methods ['env' & co] strcpy(PC.error, base_name.cstr()); strcat(PC.error, ": you can not derive from this class in @"BASE_NAME); YYERROR; } } else { strcpy(PC.error, base_name.cstr()); strcat(PC.error, ": undefined class in @"BASE_NAME); YYERROR; } } else { strcpy(PC.error, "@"BASE_NAME" must contain sole name"); YYERROR; } } else if(command==OPTIONS_CONTROL_METHOD_NAME) { for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) { const String& option=LA2S(*strings_code, i)->trim(String::TRIM_END); if(option==OPTION_ALL_VARS_LOCAL_NAME){ PC.set_all_vars_local(); } else if(option==OPTION_PARTIAL_CLASS){ if(PC.cclass_new){ if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){ if(!PC.reuse_existed_class(existed)){ strcpy(PC.error, "can't append methods to '"); strncat(PC.error, PC.cclass_new->name().cstr(), MAX_STRING/2); strcat(PC.error, "' - the class wasn't marked as partial"); YYERROR; } } else { // marks the new class as partial. we will be able to add methods here later. PC.cclass_new->set_partial(); } } else { strcpy(PC.error, "'"OPTION_PARTIAL_CLASS"' option should be used straight after @"CLASS_NAME); YYERROR; } } else if(option==method_call_type_static){ PC.set_methods_call_type(Method::CT_STATIC); } else if(option==method_call_type_dynamic){ PC.set_methods_call_type(Method::CT_DYNAMIC); } else { strcpy(PC.error, "'"); strncat(PC.error, option.cstr(), MAX_STRING/2); strcat(PC.error, "' invalid option. valid options are " "'"OPTION_PARTIAL_CLASS"', '"OPTION_ALL_VARS_LOCAL_NAME"'" ", '"METHOD_CALL_TYPE_STATIC"' and '"METHOD_CALL_TYPE_DYNAMIC"'" ); YYERROR; } } } else { strcpy(PC.error, "'"); strncat(PC.error, command.cstr(), MAX_STRING/2); strcat(PC.error, "' invalid special name. valid names are " "'"CLASS_NAME"', '"USE_CONTROL_METHOD_NAME"', '"BASE_NAME"' and '"OPTIONS_CONTROL_METHOD_NAME"'."); YYERROR; } }; maybe_control_strings: empty | control_strings; control_strings: control_string | control_strings control_string { $$=$1; P(*$$, *$2); }; control_string: maybe_string '\n'; maybe_string: empty | STRING; code_method: '@' STRING bracketed_maybe_strings maybe_bracketed_strings maybe_comment '\n' { CLASS_ADD; PC.explicit_result=false; YYSTYPE params_names_code=$3; ArrayString* params_names=0; if(int size=params_names_code->count()) { params_names=new ArrayString; for(int i=0; icount()) { locals_names=new ArrayString; for(int i=0; iis_vars_local()) all_vars_local=true; Method* method=new Method( //name, GetMethodCallType(PC, *$2), 0, 0/*min,max numbered_params_count*/, params_names, locals_names, 0/*to be filled later in next {} */, 0, all_vars_local); *reinterpret_cast(&$$)=method; } maybe_codes { Method* method=reinterpret_cast($7); // fill in the code method->parser_code=$8; // register in class const String& name=*LA2S(*$2); PC.cclass->set_method(PC.alias_method(name), method); }; maybe_bracketed_strings: empty | bracketed_maybe_strings; bracketed_maybe_strings: '[' maybe_strings ']' {$$=$2;}; maybe_strings: empty | strings; strings: STRING | strings ';' STRING { $$=$1; P(*$$, *$3); }; maybe_comment: empty | STRING; /* codes */ maybe_codes: empty | codes; codes: code | codes code { $$=$1; P(*$$, *$2); }; code: write_string | action; action: get | put | call; /* get */ get: get_value { $$=N(); YYSTYPE code=$1; size_t count=code->count(); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if( count!=3 || !maybe_change_first_opcode(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT if( count!=3 || !maybe_change_first_opcode(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if( count!=5 || !maybe_change_first_opcode(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if( count!=5 || !maybe_change_first_opcode(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE) ) #endif { changetail_or_append(*code, OP::OP_GET_ELEMENT, false, /*=>*/OP::OP_GET_ELEMENT__WRITE, /*or */OP::OP_WRITE_VALUE ); /* value=pop; wcontext.write(value) */ } P(*$$, *code); }; get_value: '$' get_name_value { $$=$2; }; get_name_value: name_without_curly_rdive EON | name_in_curly_rdive; name_in_curly_rdive: '{' name_without_curly_rdive '}' { $$=$2; }; name_without_curly_rdive: name_without_curly_rdive_read | name_without_curly_rdive_class; name_without_curly_rdive_read: name_without_curly_rdive_code { $$=N(); YYSTYPE diving_code=$1; size_t count=diving_code->count(); if(maybe_make_self(*$$, *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if(maybe_make_get_object_element(*$$, *diving_code, count)){ // optimization for $object.field + ^object.method[ } else #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if(maybe_make_get_object_var_element(*$$, *diving_code, count)){ // optimization for $object.$var } else #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if( count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ // optimization O(*$$, (PC.in_call_value && count==4) ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string : OP::OP_VALUE__GET_ELEMENT // $object : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string ); P(*$$, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*$$, *diving_code, 4); // copy tail } else { O(*$$, OP::OP_WITH_READ); /* stack: starting context */ P(*$$, *diving_code); } #else { O(*$$, OP::OP_WITH_READ); /* stack: starting context */ // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR. if(PC.in_call_value && count==4) diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR); P(*$$, *diving_code); } #endif /* diving code; stack: current context */ }; name_without_curly_rdive_class: class_prefix name_without_curly_rdive_code { $$=$1; P(*$$, *$2); }; name_without_curly_rdive_code: name_advance2 | name_path name_advance2 { $$=$1; P(*$$, *$2); }; /* put */ put: '$' name_expr_wdive construct { $$=N(); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT if(maybe_optimize_construct(*$$, *$2, *$3)){ // $a(expr), $.a(expr), $a[value], $.a[value], $self.a[value], $self.a(expr) } else #endif { P(*$$, *$2); /* stack: context,name */ P(*$$, *$3); /* stack: context,name,constructor_value */ } }; name_expr_wdive: name_expr_wdive_root | name_expr_wdive_write | name_expr_wdive_class; name_expr_wdive_root: name_expr_dive_code { $$=N(); YYSTYPE diving_code=$1; size_t count=diving_code->count(); if(maybe_make_self(*$$, *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if( count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ O(*$$, OP::OP_WITH_ROOT__VALUE__GET_ELEMENT); P(*$$, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*$$, *diving_code, 4); // tail } else #endif { O(*$$, OP::OP_WITH_ROOT); /* stack: starting context */ P(*$$, *diving_code); } /* diving code; stack: current context */ }; name_expr_wdive_write: '.' name_expr_dive_code { $$=N(); O(*$$, OP::OP_WITH_WRITE); /* stack: starting context */ P(*$$, *$2); /* diving code; stack: context,name */ }; name_expr_wdive_class: class_prefix name_expr_dive_code { $$=$1; P(*$$, *$2); }; construct: construct_square | construct_round | construct_curly ; construct_square: '[' { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&$$)=PC.explicit_result; PC.explicit_result=false; } any_constructor_code_value { PC.explicit_result=*reinterpret_cast(&$2); } ']' { // stack: context, name $$=$3; // stack: context, name, value O(*$$, OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ } ; construct_round: '(' expr_value ')' { $$=N(); O(*$$, OP::OP_PREPARE_TO_EXPRESSION); // stack: context, name P(*$$, *$2); // stack: context, name, value O(*$$, OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ } ; construct_curly: '{' maybe_codes '}' { // stack: context, name $$=N(); OA(*$$, OP::OP_CURLY_CODE__CONSTRUCT, $2); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ }; any_constructor_code_value: empty_value /* optimized $var[] case */ | STRING /* optimized $var[STRING] case */ | constructor_code_value /* $var[something complex] */ ; constructor_code_value: constructor_code { $$=N(); OA(*$$, OP::OP_OBJECT_POOL, $1); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ }; constructor_code: codes__excluding_sole_str_literal; codes__excluding_sole_str_literal: action | code codes { $$=$1; P(*$$, *$2); }; /* call */ call: call_value { #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR if((*$1).count()) #endif { $$=$1; /* stack: value */ if(!maybe_change_first_opcode(*$$, OP::OP_CONSTRUCT_OBJECT, /*=>*/OP::OP_CONSTRUCT_OBJECT__WRITE)) changetail_or_append(*$$, OP::OP_CALL, true, /*=>*/ OP::OP_CALL__WRITE, /*or */OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ } }; call_value: '^' { PC.in_call_value=true; } call_name { PC.in_call_value=false; } store_params EON { /* ^field.$method{vasya} */ #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT const String* operator_name=LA2S(*$3, 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR); #else const String* operator_name=LA2S(*$3, 1); #endif if(operator_name && *operator_name==REM_OPERATOR_NAME){ $$=N(); } else #endif { YYSTYPE params_code=$5; if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? if(const String * string=value->get_string()) if(string->is_empty()) // value is empty string? params_code=0; // ^zzz[] case. don't append lone empty param. } /* stack: context, method_junction */ YYSTYPE var_code=$3; if( var_code->count()==8 && (*var_code)[0].code==OP::OP_VALUE__GET_CLASS && (*var_code)[3].code==OP::OP_PREPARE_TO_CONSTRUCT_OBJECT && (*var_code)[4].code==OP::OP_VALUE && (*var_code)[7].code==OP::OP_GET_ELEMENT ){ yyval=N(); O(*$$, OP::OP_CONSTRUCT_OBJECT); P(*$$, *var_code, 1/*offset*/, 2/*limit*/); // class name P(*$$, *var_code, 5/*offset*/, 2/*limit*/); // constructor name OA(*$$, params_code); } else { $$=var_code; /* with_xxx,diving code; stack: context,method_junction */ OA(*$$, OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value } } }; call_name: name_without_curly_rdive; store_params: store_param | store_params store_param { $$=$1; P(*$$, *$2); }; store_param: store_square_param | store_round_param | store_curly_param ; store_square_param: '[' { // allow ^call[ letters here any time ] *reinterpret_cast(&$$)=PC.explicit_result; PC.explicit_result=false; } store_code_param_parts { PC.explicit_result=*reinterpret_cast(&$2); } ']' {$$=$3;}; store_round_param: '(' store_expr_param_parts ')' {$$=$2;}; store_curly_param: '{' store_curly_param_parts '}' {$$=$2;}; store_code_param_parts: store_code_param_part | store_code_param_parts ';' store_code_param_part { $$=$1; P(*$$, *$3); } ; store_expr_param_parts: store_expr_param_part | store_expr_param_parts ';' store_expr_param_part { $$=$1; P(*$$, *$3); } ; store_curly_param_parts: store_curly_param_part | store_curly_param_parts ';' store_curly_param_part { $$=$1; P(*$$, *$3); } ; store_code_param_part: code_param_value { $$=$1; }; store_expr_param_part: expr_value { YYSTYPE expr_code=$1; if(expr_code->count()==3 && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating $$=expr_code; } else { YYSTYPE code=N(); O(*code, OP::OP_PREPARE_TO_EXPRESSION); P(*code, *expr_code); O(*code, OP::OP_WRITE_EXPR_RESULT); $$=N(); OA(*$$, OP::OP_EXPR_CODE__STORE_PARAM, code); } }; store_curly_param_part: maybe_codes { $$=N(); OA(*$$, OP::OP_CURLY_CODE__STORE_PARAM, $1); }; code_param_value: empty_value /* optimized [;...] case */ | STRING /* optimized [STRING] case */ | constructor_code_value /* [something complex] */ ; /* name */ name_expr_dive_code: name_expr_value | name_path name_expr_value { $$=$1; P(*$$, *$2); }; name_path: name_step | name_path name_step { $$=$1; P(*$$, *$2); }; name_step: name_advance1 '.'; name_advance1: name_expr_value { // we know that name_advance1 not called from ^xxx context // so we'll not check for operator call possibility as we do in name_advance2 /* stack: context */ $$=$1; /* stack: context,name */ O(*$$, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ }; name_advance2: name_expr_value { /* stack: context */ $$=$1; /* stack: context,name */ O(*$$, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ } | STRING BOGUS ; name_expr_value: STRING /* subname_is_const */ | name_expr_subvar_value /* $subname_is_var_value */ | name_expr_with_subvar_value /* xxx$part_of_subname_is_var_value */ | name_square_code_value /* [codes] */ ; name_expr_subvar_value: '$' subvar_ref_name_rdive { $$=$2; O(*$$, OP::OP_GET_ELEMENT); }; name_expr_with_subvar_value: STRING subvar_get_writes { YYSTYPE code; { change_string_literal_to_write_string_literal(*(code=$1)); P(*code, *$2); } $$=N(); OA(*$$, OP::OP_STRING_POOL, code); }; name_square_code_value: '[' { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&$$)=PC.explicit_result; PC.explicit_result=false; } codes { PC.explicit_result=*reinterpret_cast(&$2); } ']' { $$=N(); OA(*$$, OP::OP_OBJECT_POOL, $3); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ }; subvar_ref_name_rdive: STRING { $$=N(); O(*$$, OP::OP_WITH_READ); P(*$$, *$1); }; subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P(*$$, *$2); }; subvar__get_write: '$' subvar_ref_name_rdive { $$=$2; O(*$$, OP::OP_GET_ELEMENT__WRITE); }; class_prefix: class_static_prefix | class_constructor_prefix ; class_static_prefix: STRING ':' { $$=$1; // stack: class name string if(*LA2S(*$$) == BASE_NAME) { // pseudo BASE class if(VStateless_class* base=PC.cclass->base_class()) { change_string_literal_value(*$$, base->name()); } else { strcpy(PC.error, "no base class declared"); YYERROR; } } // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string maybe_change_first_opcode(*$$, OP::OP_VALUE, OP::OP_VALUE__GET_CLASS); }; class_constructor_prefix: class_static_prefix ':' { $$=$1; if(!PC.in_call_value) { strcpy(PC.error, ":: not allowed here"); YYERROR; } O(*$$, OP::OP_PREPARE_TO_CONSTRUCT_OBJECT); }; /* expr */ expr_value: expr; expr: double_or_STRING | true_value | false_value | get_value | call_value | '"' string_inside_quotes_value '"' { $$ = $2; } | '\'' string_inside_quotes_value '\'' { $$ = $2; } | '(' expr ')' { $$ = $2; } /* stack: operand // stack: @operand */ | '-' expr %prec NUNARY { $$=$2; O(*$$, OP::OP_NEG); } | '+' expr %prec NUNARY { $$=$2; } | '~' expr { $$=$2; O(*$$, OP::OP_INV); } | '!' expr { $$=$2; O(*$$, OP::OP_NOT); } | "def" expr { $$=$2; O(*$$, OP::OP_DEF); } | "in" expr { $$=$2; O(*$$, OP::OP_IN); } | "-f" expr { $$=$2; O(*$$, OP::OP_FEXISTS); } | "-d" expr { $$=$2; O(*$$, OP::OP_DEXISTS); } /* stack: a,b // stack: a@b */ | expr '-' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_SUB); } | expr '+' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_ADD); } | expr '*' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_MUL); } | expr '/' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_DIV); } | expr '%' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_MOD); } | expr '\\' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_INTDIV); } | expr "<<" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_SL); } | expr ">>" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_SR); } | expr '&' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_AND); } | expr '|' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_OR); } | expr "!|" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_XOR); } | expr "&&" expr { $$=$1; OA(*$$, OP::OP_NESTED_CODE, $3); O(*$$, OP::OP_LOG_AND); } | expr "||" expr { $$=$1; OA(*$$, OP::OP_NESTED_CODE, $3); O(*$$, OP::OP_LOG_OR); } | expr "!||" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_LOG_XOR); } | expr '<' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_LT); } | expr '>' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_GT); } | expr "<=" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_LE); } | expr ">=" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_GE); } | expr "==" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_EQ); } | expr "!=" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_NE); } | expr "lt" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_LT); } | expr "gt" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_GT); } | expr "le" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_LE); } | expr "ge" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_GE); } | expr "eq" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_EQ); } | expr "ne" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_NE); } | expr "is" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_IS); } ; double_or_STRING: STRING { // optimized OP_STRING => OP_VALUE for doubles maybe_change_string_literal_to_double_literal(*($$=$1)); }; string_inside_quotes_value: maybe_codes { #ifdef OPTIMIZE_BYTECODE_STRING_POOL // it brakes ^if(" 09 "){...} YYSTYPE code=$1; $$=N(); if(code->count()==3 && maybe_change_first_opcode(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){ // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL P(*$$, *code); } else { OA(*$$, OP::OP_STRING_POOL, code); /* stack: empty write context */ } #else $$=N(); OA(*$$, OP::OP_STRING_POOL, $1); /* stack: empty write context */ #endif /* some code that writes to that context */ /* context=pop; stack: context.get_string() */ }; /* basics */ write_string: STRING { // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE change_string_literal_to_write_string_literal(*($$=$1)); }; empty_value: /* empty */ { $$=VL(/*we know that we will not change it*/const_cast(&vempty), 0, 0, 0); } true_value: "true" { $$ = VL(/*we know that we will not change it*/const_cast(&vtrue), 0, 0, 0); } false_value: "false" { $$ = VL(/*we know that we will not change it*/const_cast(&vfalse), 0, 0, 0); } empty: /* empty */ { $$=N(); }; %% #endif /* 000$111(2222)00 000$111{3333}00 $,^: push,=0 1:( { break=pop 2:( ) pop 3:{ } pop 000^111(2222)4444{33333}4000 $,^: push,=0 1:( { break=pop 2:( )=4 3:{ }=4 4:[^({]=pop */ inline void ungetc(Parse_control& pc, uint last_line_end_col) { pc.source--; if(pc.pos.col==0) { --pc.pos.line; pc.pos.col=last_line_end_col; } else --pc.pos.col; } static int yylex(YYSTYPE *lvalp, void *apc) { register Parse_control& pc=*static_cast(apc); #define lexical_brackets_nestage pc.brackets_nestages[pc.ls_sp] #define RC {result=c; goto break2; } register int c; int result; if(pc.pending_state) { result=pc.pending_state; pc.pending_state=0; return result; } const char *begin=pc.source; Pos begin_pos=pc.pos; const char *end; int skip_analized=0; while(true) { c=*(end=(pc.source++)); // fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp); if(c=='\n') pc.pos_next_line(); else pc.pos_next_c(c); // fprintf(stderr, "\nchar: %c file(%d:%d)", c, pc.pos.line, pc.pos.col); if(pc.pos.col==0+1 && c=='@') { if(pc.ls==LS_DEF_SPECIAL_BODY) { // @SPECIAL // ... // @punctuation begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; // converting ^#HH into char(hex(HH)) case '#': if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till ^ pc.string.append_strdup_know_length(begin, end-begin); } // #HH ? if(pc.source[1] && isxdigit(pc.source[1]) && pc.source[2] && isxdigit(pc.source[2])) { char c=(char)( hex_value[(unsigned char)pc.source[1]]*0x10+ hex_value[(unsigned char)pc.source[2]]); if(c==0) { result=BAD_HEX_LITERAL; goto break2; // wrong hex value[no ^#00 chars allowed]: bail out } // append char(hex(HH)) pc.string.append(c); // skip over ^#HH pc.source+=3; pc.pos.col+=3; // reset piece 'begin' position & line begin=pc.source; // ->after ^#HH begin_pos=pc.pos; // skip analysis = forced literal continue; } // just escaped char // reset piece 'begin' position & line begin=pc.source; begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; } break; } } // #comment start skipping if(c=='#' && pc.pos.col==1) { if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_USER_COMMENT); continue; } switch(pc.ls) { // USER'S = NOT OURS case LS_USER: case LS_NAME_SQUARE_PART: // name.[here].xxx if(pc.trim_bof) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: pc.trim_bof=false; } switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(pc.ls==LS_NAME_SQUARE_PART) if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?> pop_LS(pc); // $name.[co<]>de<]!> RC; } break; case '[': // $name.[co<[>de] if(pc.ls==LS_NAME_SQUARE_PART) lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE; goto break2; } break; // #COMMENT case LS_USER_COMMENT: if(c=='\n') { // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // STRING IN EXPRESSION case LS_EXPRESSION_STRING_QUOTED: case LS_EXPRESSION_STRING_APOSTROFED: switch(c) { case '"': case '\'': if( pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"' || pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') { pop_LS(pc); //"abc". | 'abc'. RC; } break; case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; } break; // METHOD DEFINITION case LS_DEF_NAME: switch(c) { case '[': pc.ls=LS_DEF_PARAMS; RC; case '\n': pc.ls=LS_DEF_SPECIAL_BODY; RC; } break; case LS_DEF_PARAMS: switch(c) { case '$': // common error result=BAD_METHOD_PARAMETER_NAME_CHARACTER; goto break2; case ';': RC; case ']': pc.ls=*pc.source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_LOCALS: switch(c) { case '[': case ';': RC; case ']': pc.ls=LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_COMMENT: if(c=='\n') { pop_LS(pc); RC; } break; case LS_DEF_SPECIAL_BODY: if(c=='\n') RC; break; // (EXPRESSION) case LS_VAR_ROUND: case LS_METHOD_ROUND: switch(c) { case ')': if(--lexical_brackets_nestage==0) if(pc.ls==LS_METHOD_ROUND) // method round param ended pc.ls=LS_METHOD_AFTER; // look for method end else // pc.ls==LS_VAR_ROUND // variable constructor ended pop_LS(pc); // return to normal life RC; case '#': // comment start skipping if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_EXPRESSION_COMMENT); lexical_brackets_nestage=1; continue; case '$': push_LS(pc, LS_EXPRESSION_VAR_NAME_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '(': lexical_brackets_nestage++; RC; case '-': switch(*pc.source) { case 'f': // -f skip_analized=1; result=FEXISTS; goto break2; case 'd': // -d skip_analized=1; result=DEXISTS; goto break2; default: // minus result=c; goto break2; } goto break2; case '+': case '*': case '/': case '%': case '\\': case '~': case ';': RC; case '&': case '|': if(*pc.source==c) { // && || result=c=='&'?LAND:LOR; skip_analized=1; } else result=c; goto break2; case '!': switch(pc.source[0]) { case '|': // !| !|| skip_analized=1; if(pc.source[1]=='|') { skip_analized++; result=LXOR; } else result=NXOR; goto break2; case '=': // != skip_analized=1; result=NNE; goto break2; } RC; case '<': // <<, <=, < switch(*pc.source) { case '<': // <[<] skip_analized=1; result=NSL; break; case '=': // <[=] skip_analized=1; result=NLE; break; default: // <[] result=c; break; } goto break2; case '>': // >>, >=, > switch(*pc.source) { case '>': // >[>] skip_analized=1; result=NSR; break; case '=': // >[=] skip_analized=1; result=NGE; break; default: // >[] result=c; break; } goto break2; case '=': // == switch(*pc.source) { case '=': // =[=] skip_analized=1; result=NEQ; break; default: // =[] result=c; break; // not used now } goto break2; case '"': push_LS(pc, LS_EXPRESSION_STRING_QUOTED); RC; case '\'': push_LS(pc, LS_EXPRESSION_STRING_APOSTROFED); RC; case 'l': case 'g': case 'e': case 'n': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(*pc.source) { // case '?': // ok [and bad cases, yacc would bark at them] case 't': // lt gt [et nt] result=c=='l'?SLT:c=='g'?SGT:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'e': // le ge ne [ee] result=c=='l'?SLE:c=='g'?SGE:c=='n'?SNE:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'q': // eq [lq gq nq] result=c=='e'?SEQ:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; } } break; case 'i': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(pc.source[0]) { case 'n': // in skip_analized=1; result=IN; goto break2; case 's': // is skip_analized=1; result=IS; goto break2; } } break; case 'd': if(end==begin) // right after whitespace if(pc.source[0]=='e' && pc.source[1]=='f') { // def switch(pc.source[2]){ case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed skip_analized=2; result=DEF; goto break2; } // error: incorrect char after 'def' } break; case 't': if(end==begin) // right after whitespace if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true skip_analized=3; result=LITERAL_TRUE; goto break2; } break; case 'f': if(end==begin) // right after whitespace if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false skip_analized=4; result=LITERAL_FALSE; goto break2; } break; case ' ': case '\t': case '\n': if(end!=begin) { // there were a string after previous operator? result=0; // return that string goto break2; } // that's a leading|traling space or after-operator-space // ignoring it // reset piece 'begin' position & line begin=pc.source; // after whitespace char begin_pos=pc.pos; continue; } break; case LS_EXPRESSION_COMMENT: if(c=='(') lexical_brackets_nestage++; switch(*pc.source) { case '\n': case ')': if(*pc.source==')') if(--lexical_brackets_nestage!=0) continue; // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // VARIABLE GET/PUT/WITH case LS_VAR_NAME_SIMPLE_WITH_COLON: case LS_VAR_NAME_SIMPLE_WITHOUT_COLON: case LS_EXPRESSION_VAR_NAME_WITH_COLON: case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON: if( pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name in expr ends also before switch(c) { // expression minus case '-': // expression integer division case '\\': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } if( pc.ls==LS_VAR_NAME_SIMPLE_WITHOUT_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name already has ':', stop before next switch(c) { case ':': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } switch(c) { case 0: case ' ': case '\t': case '\n': case ';': case ']': case '}': case ')': case '"': case '\'': case '<': case '>': // these stand for HTML brackets AND expression binary ops case '+': case '*': case '/': case '\\': case '%': case '&': case '|': case '=': case '!': // common delimiters case ',': case '?': case '#': // mysql column separators case '`': // before call case '^': pop_LS(pc); pc.ungetc(); result=EON; goto break2; case '[': // $name.<[>code] if(pc.pos.col>1/*not first column*/ && ( end[-1]=='$'/*was start of get*/ || end[-1]==':'/*was class name delim */ || end[-1]=='.'/*was name delim */ )) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_VAR_SQUARE; lexical_brackets_nestage=1; RC; case '{': if(begin==end) { // ${name}, no need of EON, switching LS pc.ls=LS_VAR_NAME_CURLY; } else { pc.ls=LS_VAR_CURLY; lexical_brackets_nestage=1; } RC; case '(': pc.ls=LS_VAR_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // class<:>name // go to _WITHOUT_COLON state variant... if(pc.ls==LS_VAR_NAME_SIMPLE_WITH_COLON) pc.ls=LS_VAR_NAME_SIMPLE_WITHOUT_COLON; else if(pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON) pc.ls=LS_EXPRESSION_VAR_NAME_WITHOUT_COLON; // ...stop before next ':' RC; } break; case LS_VAR_NAME_CURLY: switch(c) { case '[': // ${name.<[>code]} push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; case '}': // ${name} finished, restoring LS pop_LS(pc); RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' RC; } break; case LS_VAR_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case ';': // operator_or_fmt;value delim RC; case '[': lexical_brackets_nestage++; break; } break; case LS_VAR_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '}': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case '{': lexical_brackets_nestage++; break; } break; // METHOD CALL case LS_METHOD_NAME: switch(c) { case '[': // ^name.<[>code].xxx if(pc.pos.col>1/*not first column*/ && ( end[-1]=='^'/*was start of call*/ || // never, ^[ is literal... end[-1]==':'/*was class name delim */ || end[-1]=='.'/*was name delim */ )) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; case '{': pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; case '(': pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' case '^': // ^abc^xxx wrong. bailing out case ']': case '}': case ')': // ^abc]}) wrong. bailing out case ' ': // ^if ( wrong. bailing out RC; } break; case LS_METHOD_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case ']': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '[': lexical_brackets_nestage++; break; } break; case LS_METHOD_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case '}': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '{': lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE; goto break2; } break; case LS_METHOD_AFTER: if(c=='[') {/* ][ }[ )[ */ pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; } if(c=='{') {/* ]{ }{ ){ */ pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; } if(c=='(') {/* ]( }( )( */ pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; } pop_LS(pc); pc.ungetc(); result=EON; goto break2; } if(c==0) { result=-1; break; } } break2: if(end!=begin) { // there is last piece? if(c=='@' || c==0) // we are before LS_DEF_NAME or EOF? while(end!=begin && end[-1]=='\n') // trim all empty lines before LS_DEF_NAME and EOF end--; if(end!=begin && pc.ls!=LS_USER_COMMENT) { // last piece still alive and not comment? if(!pc.string_start) pc.string_start=begin_pos; // append it pc.string.append_strdup_know_length(begin, end-begin); } } if(!pc.string.is_empty()) { // something accumulated? // create STRING value: array of OP_VALUE+origin+vstring *lvalp=VL( new VString(*new String(pc.string, String::L_CLEAN)), pc.file_no, pc.string_start.line, pc.string_start.col); // new pieces storage pc.string.clear(); pc.string_start.clear(); // make current result be pending for next call, return STRING for now pc.pending_state=result; result=STRING; } if(skip_analized) { pc.source+=skip_analized; pc.pos.col+=skip_analized; } return result; } static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error strncpy(PC.error, s, MAX_STRING); return 1; } static void yyprint(FILE *file, int type, YYSTYPE value) { if(type==STRING) fprintf(file, " \"%s\"", LA2S(*value)->cstr()); } parser-3.4.3/src/main/pa_charset.C000644 000000 000000 00000111750 12233557103 017052 0ustar00rootwheel000000 000000 /** @file Parser: Charset connection implementation. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexander Petrosyan(http://paf.design.ru) */ #include "pa_charset.h" #include "pa_charsets.h" volatile const char * IDENT_PA_CHARSET_C="$Id: pa_charset.C,v 1.95 2013/10/28 21:59:31 moko Exp $" IDENT_PA_CHARSET_H; #ifdef XML #include "libxml/encoding.h" #endif //#define PA_PATCHED_LIBXML_BACKWARD // reduce memory usage by pre-calculation utf-8 string length #define PRECALCULATE_DEST_LENGTH // globals Charset::UTF8CaseTable::Rec UTF8CaseToUpperRecords[]={ #include "utf8-to-upper.inc" }; Charset::UTF8CaseTable UTF8CaseToUpper={ sizeof(UTF8CaseToUpperRecords)/sizeof(Charset::UTF8CaseTable::Rec), UTF8CaseToUpperRecords}; Charset::UTF8CaseTable::Rec UTF8CaseToLowerRecords[]={ #include "utf8-to-lower.inc" }; Charset::UTF8CaseTable UTF8CaseToLower={ sizeof(UTF8CaseToLowerRecords)/sizeof(Charset::UTF8CaseTable::Rec), UTF8CaseToLowerRecords}; // helpers inline void prepare_case_tables(unsigned char *tables) { unsigned char *lcc_table=tables+lcc_offset; unsigned char *fcc_table=tables+fcc_offset; for(int i=0; i<0x100; i++) lcc_table[i]=fcc_table[i]=(unsigned char)i; } inline void cstr2ctypes(unsigned char *tables, const unsigned char *cstr, unsigned char bit) { unsigned char *ctypes_table=tables+ctypes_offset; ctypes_table[0]=bit; for(; *cstr; cstr++) { unsigned char c=*cstr; ctypes_table[c]|=bit; } } inline unsigned int to_wchar_code(const char* cstr) { if(!cstr || !*cstr) return 0; if(cstr[1]==0) return(unsigned int)(unsigned char)cstr[0]; return pa_atoui(cstr,0); } inline bool to_bool(const char* cstr) { return cstr && *cstr!=0; } static void element2ctypes(unsigned char c, bool belongs, unsigned char *tables, unsigned char bit, int group_offset=-1) { if(!belongs) return; unsigned char *ctypes_table=tables+ctypes_offset; ctypes_table[c]|=bit; if(group_offset>=0) tables[cbits_offset+group_offset+c/8] |= 1<<(c%8); } static void element2case(unsigned char from, unsigned char to, unsigned char *tables) { if(!to) return; unsigned char *lcc_table=tables+lcc_offset; unsigned char *fcc_table=tables+fcc_offset; lcc_table[from]=to; fcc_table[from]=to; fcc_table[to]=from; } inline XMLByte *append_hex_8(XMLByte *dest, unsigned char c, const char* prefix=0) { if(prefix) { strcpy((char *)dest, prefix); dest+=strlen(prefix); } *dest++=hex_digits[c >> 4]; *dest++=hex_digits[c & 0x0F]; return dest; } inline XMLByte *append_hex_16(XMLByte *dest, unsigned int c, const char* prefix=0) { if(prefix) { strcpy((char *)dest, prefix); dest+=strlen(prefix); } *dest++=hex_digits[(c >> 12) & 0x0F]; *dest++=hex_digits[(c >> 8) & 0x0F]; *dest++=hex_digits[(c >> 4) & 0x0F]; *dest++=hex_digits[(c) & 0x0F]; return dest; } // methods Charset::Charset(Request_charsets* charsets, const String::Body ANAME, const String* afile_spec): FNAME(ANAME), FNAME_CSTR(ANAME.cstrm()) { if(afile_spec) { fisUTF8=false; load_definition(*charsets, *afile_spec); #ifdef XML addEncoding(FNAME_CSTR); #endif } else { fisUTF8=true; // grab default onces [for UTF-8 so to be able to make a-z =>A-Z memcpy(pcre_tables, _pcre_default_tables, sizeof(pcre_tables)); } #ifdef XML initTranscoder(FNAME, FNAME_CSTR); #endif } void Charset::load_definition(Request_charsets& charsets, const String& afile_spec) { // pcre_tables // lowcase, flipcase, bits digit+word+whitespace, masks // must not move this inside of prepare_case_tables // don't know the size there memset(pcre_tables, 0, sizeof(pcre_tables)); prepare_case_tables(pcre_tables); cstr2ctypes(pcre_tables,(const unsigned char *)"*+?{^.$|()[", ctype_meta); // charset memset(&tables, 0, sizeof(tables)); // loading text char *data=file_read_text(charsets, afile_spec); // ignore header getrow(&data); // parse cells char *row; while((row=getrow(&data))) { // remove empty&comment lines if(!*row || *row=='#') continue; // char white-space digit hex-digit letter word lowercase unicode1 unicode2 unsigned char c=0; char *cell; for(int column=0; (cell=lsplit(&row, '\t')); column++) { switch(column) { case 0: c=(unsigned char)to_wchar_code(cell); break; // pcre_tables case 1: element2ctypes(c, to_bool(cell), pcre_tables, ctype_space, cbit_space); break; case 2: element2ctypes(c, to_bool(cell), pcre_tables, ctype_digit, cbit_digit); break; case 3: element2ctypes(c, to_bool(cell), pcre_tables, ctype_xdigit); break; case 4: element2ctypes(c, to_bool(cell), pcre_tables, ctype_letter); break; case 5: element2ctypes(c, to_bool(cell), pcre_tables, ctype_word, cbit_word); break; case 6: element2case(c, (unsigned char)to_wchar_code(cell), pcre_tables); break; case 7: case 8: // charset if(tables.toTableSize>MAX_CHARSET_UNI_CODES) throw Exception(PARSER_RUNTIME, &afile_spec, "charset must contain not more then %d unicode values", MAX_CHARSET_UNI_CODES); XMLCh unicode=(XMLCh)to_wchar_code(cell); if(!unicode && column==7/*unicode1 column*/) unicode=(XMLCh)c; if(unicode) { if(!tables.fromTable[c]) tables.fromTable[c]=unicode; tables.toTable[tables.toTableSize].intCh=unicode; tables.toTable[tables.toTableSize].extCh=(XMLByte)c; tables.toTableSize++; } break; } } }; // parser charset tables declare only white-space before 0x20, thus adding the missing chars for(uint i=0; i<0x20; i++) if(!tables.fromTable[i]){ tables.fromTable[i]=i; tables.toTable[tables.toTableSize].intCh=i; tables.toTable[tables.toTableSize].extCh=(XMLByte)i; tables.toTableSize++; } // sort by the Unicode code point sort_ToTable(); } static int sort_cmp_Trans_rec_intCh(const void *a, const void *b) { return static_cast(a)->intCh- static_cast(b)->intCh; } void Charset::sort_ToTable() { qsort(tables.toTable, tables.toTableSize, sizeof(*tables.toTable), sort_cmp_Trans_rec_intCh); //FILE *f=fopen("c:\\temp\\a", "wb"); //fwrite(tables.toTable, tables.toTableSize, sizeof(*tables.toTable), f); //fclose(f); } // @todo: precache for spedup searching static XMLByte xlatOneTo(const XMLCh toXlat, const Charset::Tables& tables, XMLByte not_found) { int lo = 0; int hi = tables.toTableSize - 1; while(lo<=hi) { // Calc the mid point of the low and high offset. const unsigned int i = (lo + hi) / 2; XMLCh cur=tables.toTable[i].intCh; if(toXlat==cur) return tables.toTable[i].extCh; if(toXlat>cur) lo = i+1; else hi = i-1; } return not_found; } String::C Charset::transcode(const String::C src, const Charset& source_charset, const Charset& dest_charset) { if(!src.length) return String::C("", 0); switch((source_charset.isUTF8()?0x10:0x00)|(dest_charset.isUTF8()?0x01:0x00)) { default: // 0x00 return source_charset.transcodeToCharset(src, dest_charset); case 0x01: return source_charset.transcodeToUTF8(src); case 0x10: return dest_charset.transcodeFromUTF8(src); case 0x11: return src; } } // --------------------------------------------------------------------------- // Local static data // // gUTFBytes // A list of counts of trailing bytes for each initial byte in the input. // // gUTFOffsets // A list of values to offset each result char type, according to how // many source bytes when into making it. // // gFirstByteMark // A list of values to mask onto the first byte of an encoded sequence, // indexed by the number of bytes used to create the sequence. // --------------------------------------------------------------------------- static const XMLByte gUTFBytes[0x100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 , 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 }; static const uint gUTFOffsets[6] = { 0, 0x3080, 0xE2080, 0x3C82080, 0xFA082080, 0x82082080 }; static const XMLByte gFirstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; static int transcodeToUTF8(const XMLByte* srcData, int& srcLen, XMLByte *toFill, int& toFillLen, const Charset::Tables& tables) { const XMLByte* srcPtr=srcData; const XMLByte* srcEnd=srcData+srcLen; XMLByte* outPtr=toFill; XMLByte* outEnd=toFill+toFillLen; while(srcPtr outEnd) break; // We can do it, so update the source index srcPtr++; // And spit out the bytes. We spit them out in reverse order // here, so bump up the output pointer and work down as we go. outPtr+= encodedBytes; switch(encodedBytes) { case 6: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 5: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 4: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 3: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 2: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 1: *--outPtr = XMLByte(curVal | gFirstByteMark[encodedBytes]); } // Add the encoded bytes back in again to indicate we've eaten them outPtr+= encodedBytes; } // Update the bytes eaten srcLen = srcPtr - srcData; // Return the characters read toFillLen = outPtr - toFill; //return srcPtr==srcEnd?(int)toFillLen:-1; /* xmlCharEncodingInputFunc Returns : the number of byte written, or -1 by lack of space, or -2 if the transcoding failed. The value of inlen after return is the number of octets consumed as the return value is positive, else unpredictiable. The value of outlen after return is the number of ocetes consumed. */ return 0; } /// @todo digital entites only when xml/html output [at output in html/xml mode, in html part of a letter] static int transcodeFromUTF8(const XMLByte* srcData, int& srcLen, XMLByte* toFill, int& toFillLen, const Charset::Tables& tables) { const XMLByte* srcPtr=srcData; const XMLByte* srcEnd=srcData+srcLen; XMLByte* outPtr=toFill; XMLByte* outEnd=toFill+toFillLen; // We now loop until we either run out of input data, or room to store while ((srcPtr < srcEnd) && (outPtr < outEnd)) { // Get the next leading byte out const XMLByte firstByte =* srcPtr; // Special-case ASCII, which is a leading byte value of<= 127 if(firstByte<=127) { *outPtr++= firstByte; srcPtr++; continue; } // See how many trailing src bytes this sequence is going to require const unsigned int trailingBytes = gUTFBytes[firstByte]; // If there are not enough source bytes to do this one, then we // are done. Note that we done>= here because we are implicitly // counting the 1 byte we get no matter what. if(srcPtr+trailingBytes>= srcEnd) break; // Looks ok, so lets build up the value uint tmpVal=0; switch(trailingBytes) { case 5: tmpVal+=*srcPtr++; tmpVal<<=6; case 4: tmpVal+=*srcPtr++; tmpVal<<=6; case 3: tmpVal+=*srcPtr++; tmpVal<<=6; case 2: tmpVal+=*srcPtr++; tmpVal<<=6; case 1: tmpVal+=*srcPtr++; tmpVal<<=6; case 0: tmpVal+=*srcPtr++; break; default: throw Exception(0, 0, "transcodeFromUTF8 error: wrong trailingBytes value(%d)", trailingBytes); // never } tmpVal-=gUTFOffsets[trailingBytes]; // If it will fit into a single char, then put it in. Otherwise // fail [*encode it as a surrogate pair. If its not valid, use the // replacement char.*] if(!(tmpVal & 0xFFFF0000)) { if(XMLByte xlat=xlatOneTo(tmpVal, tables, 0)) *outPtr++=xlat; else { outPtr+=sprintf((char *)outPtr, "&#%u;", tmpVal); // &#decimal; } } else { const XMLByte* recoverPtr=srcPtr-trailingBytes-1; for(uint i=0; i<=trailingBytes; i++) outPtr+=sprintf((char*)outPtr, "%%%02X", *recoverPtr++); } } // Update the bytes eaten srcLen = srcPtr - srcData; // Return the characters read toFillLen = outPtr - toFill; //return srcPtr==srcEnd?(int)toFillLen:-1; /* xmlCharEncodingOutputFunc Returns : the number of byte written, or -1 by lack of space, or -2 if the transcoding failed. The value of inlen after return is the number of octets consumed as the return value is positive, else unpredictiable. The value of outlen after return is the number of ocetes consumed. */ return 0; } static bool need_escape(XMLByte c){ return !( (c<=127) && ( pa_isalnum((unsigned char)c) || strchr("*@-_+./", c)!=0 ) ); } // read one UTF8 char and return length of this char (in bytes) static unsigned int readUTF8Char(const XMLByte*& srcPtr, const XMLByte* srcEnd, XMLByte& firstByte, XMLCh& UTF8Char){ if(!srcPtr || !*srcPtr || srcPtr>=srcEnd) return 0; firstByte=*srcPtr; if(firstByte<=127){ UTF8Char=firstByte; srcPtr++; return 1; } unsigned int trailingBytes=gUTFBytes[firstByte]; if(srcPtr+trailingBytes>=srcEnd){ return 0; // not enough bytes in source string for reading } uint tmpVal=0; switch(trailingBytes){ case 5: tmpVal+=*srcPtr++; tmpVal<<=6; case 4: tmpVal+=*srcPtr++; tmpVal<<=6; case 3: tmpVal+=*srcPtr++; tmpVal<<=6; case 2: tmpVal+=*srcPtr++; tmpVal<<=6; case 1: tmpVal+=*srcPtr++; tmpVal<<=6; case 0: tmpVal+=*srcPtr++; } tmpVal-=gUTFOffsets[trailingBytes]; UTF8Char=tmpVal; return trailingBytes+1; } // skip UTF8 char and return length of this char (in bytes) static unsigned int skipUTF8Char(const XMLByte*& srcPtr, const XMLByte* srcEnd){ if(!srcPtr || !*srcPtr || srcPtr>=srcEnd) return 0; unsigned int trailingBytes=gUTFBytes[*srcPtr]+1; srcPtr+=trailingBytes; return trailingBytes; } // read non-UTF8 char, and return number of bytes needed for storing this char in UTF8 static unsigned int readChar(const XMLByte*& srcPtr, const XMLByte* srcEnd, XMLByte& firstByte, XMLCh& UTF8Char, const Charset::Tables& tables){ if(!srcPtr || !*srcPtr || srcPtr>=srcEnd) return 0; firstByte=*srcPtr++; UTF8Char=tables.fromTable[firstByte]; if(UTF8Char<0x80) return 1; else if(UTF8Char<0x800) return 2; else if(UTF8Char<0x10000) return 3; else if(UTF8Char<0x200000) return 4; else if(UTF8Char<0x4000000) return 5; else if(UTF8Char<= 0x7FFFFFFF) return 6; // will use the replacement character '?' firstByte=0; return 1; } size_t Charset::calc_escaped_length_UTF8(XMLByte* src, size_t src_length){ size_t dest_length=0; for(UTF8_string_iterator i(src, src_length); i.has_next(); ){ if(i.getCharSize()==1) dest_length+=!need_escape(i.getFirstByte())?1/*as-is*/:3/*%XX*/; else dest_length+=6; // %uXXXX } return dest_length; } size_t Charset::calc_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables){ const XMLByte* src_end=src+src_length; XMLByte first_byte; XMLCh UTF8_char; size_t dest_length=0; while(uint char_size=readChar(src, src_end, first_byte, UTF8_char, tables)){ if(char_size==1) dest_length+=(!first_byte/*replacement char '?'*/ || !need_escape(first_byte))?1:3/*'%XX'*/; else dest_length+=6; // %uXXXX } return dest_length; } size_t Charset::calc_escaped_length(const String::C src, const Charset& source_charset){ if(!src.length) return 0; #ifdef PRECALCULATE_DEST_LENGTH if(source_charset.isUTF8()) return calc_escaped_length_UTF8((XMLByte *)src.str, src.length); else return calc_escaped_length((XMLByte *)src.str, src.length, source_charset.tables); #else return src_length*6; // enough for %uXXXX but too memory-hungry #endif } #define escape_char(dest_ptr, char_size, first_byte, UTF8_char) \ if(char_size==1) \ if(first_byte){ \ if(need_escape(first_byte)) \ dest_ptr=append_hex_8(dest_ptr, first_byte, "%"); /* %XX */ \ else \ *dest_ptr++=first_byte; /*as is*/ \ } else \ *dest_ptr++='?'; /* replacement char '?' */ \ else \ dest_ptr=append_hex_16(dest_ptr, UTF8_char, "%u"); /* %uXXXX */ size_t Charset::escape_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest) { XMLByte* dest_ptr=dest; // loop until we either run out of input data for(UTF8_string_iterator i((XMLByte *)src, src_length); i.has_next(); ) escape_char(dest_ptr, i.getCharSize(), i.getFirstByte(), i.next()) return dest_ptr - dest; } size_t Charset::escape(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables) { const XMLByte* src_end=src+src_length; XMLByte* dest_ptr=dest; XMLByte first_byte; XMLCh UTF8_char; uint char_size; while(char_size=readChar(src, src_end, first_byte, UTF8_char, tables)) escape_char(dest_ptr, char_size, first_byte, UTF8_char) return dest_ptr - dest; } String::C Charset::escape(const String::C src, const Charset& source_charset){ if(!src.length) return String::C("", 0); size_t dest_calculated_length=calc_escaped_length(src, source_charset); XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_calculated_length+1/*terminator*/]; size_t dest_length; if(source_charset.isUTF8()) dest_length=escape_UTF8((XMLByte *)src.str, src.length, dest_body); else dest_length=escape((XMLByte *)src.str, src.length, dest_body, source_charset.tables); if(dest_length>dest_calculated_length) throw Exception(0, 0, "Charset::escape buffer overflow"); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } String::Body Charset::escape(const String::Body src, const Charset& source_charset) { String::C dest=Charset::escape(String::C(src.cstr(), src.length()), source_charset); return String::Body(dest.length ? dest.str:0); } String& Charset::escape(const String& src, const Charset& source_charset) { if(src.is_empty()) return *new String(); return *new String(escape((String::Body)src, source_charset), String::L_CLEAN); } inline bool need_json_escape(unsigned char c){ return strchr("\n\"\\/\t\r\b\f", c)!=0; } size_t Charset::calc_JSON_escaped_length_UTF8(XMLByte* src, size_t src_length){ size_t dest_length=0; for(UTF8_string_iterator i(src, src_length); i.has_next(); ){ if(i.getCharSize()==1){ XMLByte first_byte=i.getFirstByte(); dest_length+=need_json_escape(first_byte) ? 2 : (first_byte < 0x20 && first_byte /* 0 replacement char is '?' */) ? 6 : 1; } else dest_length+=6; // \uXXXX } return dest_length; } size_t Charset::calc_JSON_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables){ const XMLByte* src_end=src+src_length; XMLByte first_byte; XMLCh UTF8_char; size_t dest_length=0; while(uint char_size=readChar(src, src_end, first_byte, UTF8_char, tables)){ if(char_size==1) dest_length+=need_json_escape(first_byte) ? 2 : (first_byte < 0x20 && first_byte /* 0 replacement char is '?' */) ? 6 : 1; else dest_length+=6; // \uXXXX } return dest_length; } size_t Charset::calc_JSON_escaped_length(const String::C src, const Charset& source_charset){ if(!src.length) return 0; #ifdef PRECALCULATE_DEST_LENGTH if(source_charset.isUTF8()) return calc_JSON_escaped_length_UTF8((XMLByte *)src.str, src.length); else return calc_JSON_escaped_length((XMLByte *)src.str, src.length, source_charset.tables); #else return src_length*6; // enough for \uXXXX but too memory-hungry #endif } #define escape_char_JSON(dest_ptr, char_size, first_byte, UTF8_char) \ if(char_size==1) \ switch(first_byte){ \ case '\n': *dest_ptr++='\\'; *dest_ptr++='n'; break; \ case '"' : *dest_ptr++='\\'; *dest_ptr++='"'; break; \ case '\\': *dest_ptr++='\\'; *dest_ptr++='\\'; break; \ case '/' : *dest_ptr++='\\'; *dest_ptr++='/'; break; \ case '\t': *dest_ptr++='\\'; *dest_ptr++='t'; break; \ case '\r': *dest_ptr++='\\'; *dest_ptr++='r'; break; \ case '\b': *dest_ptr++='\\'; *dest_ptr++='b'; break; \ case '\f': *dest_ptr++='\\'; *dest_ptr++='f'; break; \ case 0 : *dest_ptr++='?'; break; /*replacement char*/ \ default : if(first_byte < 0x20) dest_ptr=append_hex_16(dest_ptr, UTF8_char, "\\u"); \ else *dest_ptr++=first_byte; \ } \ else \ dest_ptr=append_hex_16(dest_ptr, UTF8_char, "\\u"); // \uXXXX size_t Charset::escape_JSON_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest) { XMLByte* dest_ptr=dest; // loop until we either run out of input data for(UTF8_string_iterator i((XMLByte *)src, src_length); i.has_next(); ) escape_char_JSON(dest_ptr, i.getCharSize(), i.getFirstByte(), i.next()) return dest_ptr - dest; } size_t Charset::escape_JSON(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables) { const XMLByte* src_end=src+src_length; XMLByte* dest_ptr=dest; XMLByte first_byte; XMLCh UTF8_char; uint char_size; while(char_size=readChar(src, src_end, first_byte, UTF8_char, tables)) escape_char_JSON(dest_ptr, char_size, first_byte, UTF8_char) return dest_ptr - dest; } String::C Charset::escape_JSON(const String::C src, const Charset& source_charset){ if(!src.length) return String::C("", 0); size_t dest_calculated_length=calc_JSON_escaped_length(src, source_charset); XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_calculated_length+1/*terminator*/]; size_t dest_length; if(source_charset.isUTF8()) dest_length=escape_JSON_UTF8((XMLByte *)src.str, src.length, dest_body); else dest_length=escape_JSON((XMLByte *)src.str, src.length, dest_body, source_charset.tables); if(dest_length>dest_calculated_length) throw Exception(0, 0, "Charset::escape_JSON buffer overflow"); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } String::Body Charset::escape_JSON(const String::Body src, const Charset& source_charset) { String::C dest=Charset::escape_JSON(String::C(src.cstr(), src.length()), source_charset); return String::Body(dest.length ? dest.str:0); } String& Charset::escape_JSON(const String& src, const Charset& source_charset) { if(src.is_empty()) return *new String(); return *new String(escape_JSON((String::Body)src, source_charset), String::L_CLEAN); } const String::C Charset::transcodeToUTF8(const String::C src) const { int src_length=src.length; #ifdef PRECALCULATE_DEST_LENGTH int dest_length=0; const XMLByte* srcPtr=(XMLByte*)src.str; const XMLByte* srcEnd=srcPtr+src_length; XMLByte firstByte; XMLCh UTF8Char; while(uint charSize=readChar(srcPtr, srcEnd, firstByte, UTF8Char, tables)) dest_length+=charSize; #else int dest_length=src_length*6; // so that surly enough (max utf8 seq len=6) but too memory-hungry #endif #ifndef NDEBUG int saved_dest_length=dest_length; #endif XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_length+1/*for terminator*/]; if(::transcodeToUTF8( (XMLByte *)src.str, src_length, dest_body, dest_length, tables)<0) throw Exception(0, 0, "Charset::transcodeToUTF8 buffer overflow"); assert(dest_length<=saved_dest_length); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } static XMLCh change_case_UTF8(const XMLCh src, const Charset::UTF8CaseTable& table) { int lo = 0; int hi = table.size - 1; while(lo<=hi) { // Calc the mid point of the low and high offset. const unsigned int i = (lo + hi) / 2; XMLCh cur=table.records[i].from; if(src==cur) return table.records[i].to; if(src>cur) lo = i+1; else hi = i-1; } // not found return src; } static void store_UTF8(XMLCh src, XMLByte*& outPtr){ if(!src) { // use the replacement character *outPtr++= '?'; return; } // Figure out how many bytes we need unsigned int encodedBytes; if(src<0x80) encodedBytes = 1; else if(src<0x800) encodedBytes = 2; else if(src<0x10000) encodedBytes = 3; else if(src<0x200000) encodedBytes = 4; else if(src<0x4000000) encodedBytes = 5; else if(src<= 0x7FFFFFFF) encodedBytes = 6; else { // use the replacement character *outPtr++= '?'; return; } // And spit out the bytes. We spit them out in reverse order // here, so bump up the output pointer and work down as we go. outPtr+= encodedBytes; switch(encodedBytes) { case 6: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 5: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 4: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 3: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 2: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 1: *--outPtr = XMLByte(src | gFirstByteMark[encodedBytes]); } // Add the encoded bytes back in again to indicate we've eaten them outPtr+= encodedBytes; } static void change_case_UTF8(XMLCh src, XMLByte*& outPtr, const Charset::UTF8CaseTable& table) { store_UTF8(change_case_UTF8(src, table), outPtr); }; void change_case_UTF8(const XMLByte* srcData, size_t srcLen, XMLByte* toFill, size_t toFillLen, const Charset::UTF8CaseTable& table) { const XMLByte* srcPtr=srcData; const XMLByte* srcEnd=srcData+srcLen; XMLByte* outPtr=toFill; XMLByte* outEnd=toFill+toFillLen; // We now loop until we either run out of input data, or room to store while ((srcPtr < srcEnd) && (outPtr < outEnd)) { // Get the next leading byte out const XMLByte firstByte =* srcPtr; if(firstByte<=127) { change_case_UTF8(firstByte, outPtr, table); srcPtr++; continue; } // See how many trailing src bytes this sequence is going to require const unsigned int trailingBytes = gUTFBytes[firstByte]; // Looks ok, so lets build up the value uint tmpVal=0; switch(trailingBytes) { case 5: tmpVal+=*srcPtr++; tmpVal<<=6; case 4: tmpVal+=*srcPtr++; tmpVal<<=6; case 3: tmpVal+=*srcPtr++; tmpVal<<=6; case 2: tmpVal+=*srcPtr++; tmpVal<<=6; case 1: tmpVal+=*srcPtr++; tmpVal<<=6; case 0: tmpVal+=*srcPtr++; break; default: throw Exception(0, 0, "change_case_UTF8 error: wrong trailingBytes value(%d)", trailingBytes); } tmpVal-=gUTFOffsets[trailingBytes]; // If it will fit into a single char, then put it in. Otherwise // fail [*encode it as a surrogate pair. If its not valid, use the // replacement char.*] if(!(tmpVal & 0xFFFF0000)) change_case_UTF8(tmpVal, outPtr, table); else throw Exception(0, 0, "change_case_UTF8 error: too big tmpVal(0x%08X)", tmpVal); } if(srcPtr!=outPtr) throw Exception(0, 0, "change_case_UTF8 error: end pointers do not match"); } static size_t getDecNumLength(XMLCh UTF8Char){ return (UTF8Char < 100) ?2 :(UTF8Char < 1000) ?3 :(UTF8Char < 10000) ?4 :5; } const String::C Charset::transcodeFromUTF8(const String::C src) const { int src_length=src.length; #ifdef PRECALCULATE_DEST_LENGTH int dest_length=0; for(UTF8_string_iterator i((XMLByte *)src.str, src_length); i.has_next(); ){ dest_length += ( i.next() & 0xFFFF0000 ) ? 3*i.getCharSize() // %XX for each byte : ( xlatOneTo(i.next(), tables, 0) != 0 ) ? 1 // can convert it to a single char : 3+getDecNumLength( i.next() ); // print char as &#XX;, &#XXX;, &#XXXX; or &#XXXXX; } #else // so that surly enough, "&#XXX;" has max ratio (huh? 8 bytes needed for '&#XXXXX;') int dest_length=src_length*6; #endif #ifndef NDEBUG int saved_dest_length=dest_length; #endif XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_length+1/*for terminator*/]; if(::transcodeFromUTF8( (XMLByte *)src.str, src_length, dest_body, dest_length, tables)<0) throw Exception(0, 0, "Charset::transcodeFromUTF8 buffer overflow"); assert(dest_length<=saved_dest_length); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } /// transcode using both charsets const String::C Charset::transcodeToCharset(const String::C src, const Charset& dest_charset) const { if(&dest_charset==this) return src; else { size_t dest_length=src.length; XMLByte* dest_body=new(PointerFreeGC) XMLByte[dest_length+1/*for terminator*/]; XMLByte* output=dest_body; const XMLByte* input=(XMLByte *)src.str; while(XMLCh c=*input++) { XMLCh curVal = tables.fromTable[c]; *output++=curVal? xlatOneTo(curVal, dest_charset.tables, '?') // OK :'?'; // use the replacement character } dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } } void Charset::store_Char(XMLByte*& outPtr, XMLCh src, XMLByte not_found){ if(isUTF8()) store_UTF8(src, outPtr); else if(char ch=xlatOneTo(src, tables, not_found)) *outPtr++=ch; } #ifdef XML static const Charset::Tables* tables[MAX_CHARSETS]; #ifdef PA_PATCHED_LIBXML_BACKWARD #define declareXml256ioFuncs(i) \ static int xml256CharEncodingInputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen, void*) { \ return transcodeToUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } \ static int xml256CharEncodingOutputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen, void*) { \ return transcodeFromUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } #else #define declareXml256ioFuncs(i) \ static int xml256CharEncodingInputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen) { \ return transcodeToUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } \ static int xml256CharEncodingOutputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen) { \ return transcodeFromUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } #endif declareXml256ioFuncs(0) declareXml256ioFuncs(1) declareXml256ioFuncs(2) declareXml256ioFuncs(3) declareXml256ioFuncs(4) declareXml256ioFuncs(5) declareXml256ioFuncs(6) declareXml256ioFuncs(7) declareXml256ioFuncs(8) declareXml256ioFuncs(9) static xmlCharEncodingInputFunc inputFuncs[MAX_CHARSETS]={ xml256CharEncodingInputFunc0, xml256CharEncodingInputFunc1, xml256CharEncodingInputFunc2, xml256CharEncodingInputFunc3, xml256CharEncodingInputFunc4, xml256CharEncodingInputFunc5, xml256CharEncodingInputFunc6, xml256CharEncodingInputFunc7, xml256CharEncodingInputFunc8, xml256CharEncodingInputFunc9 }; static xmlCharEncodingOutputFunc outputFuncs[MAX_CHARSETS]={ xml256CharEncodingOutputFunc0, xml256CharEncodingOutputFunc1, xml256CharEncodingOutputFunc2, xml256CharEncodingOutputFunc3, xml256CharEncodingOutputFunc4, xml256CharEncodingOutputFunc5, xml256CharEncodingOutputFunc6, xml256CharEncodingOutputFunc7, xml256CharEncodingOutputFunc8, xml256CharEncodingOutputFunc9 }; static size_t handlers_count=0; void Charset::addEncoding(char *name_cstr) { if(handlers_count==MAX_CHARSETS) throw Exception(0, 0, "already allocated %d handlers, no space for new encoding '%s'", MAX_CHARSETS, name_cstr); xmlCharEncodingHandler* handler=new(UseGC) xmlCharEncodingHandler; { handler->name=name_cstr; handler->input=inputFuncs[handlers_count]; handler->output=outputFuncs[handlers_count]; ::tables[handlers_count]=&tables; handlers_count++; } xmlRegisterCharEncodingHandler(handler); } void Charset::initTranscoder(const String::Body NAME, const char* name_cstr) { ftranscoder=xmlFindCharEncodingHandler(name_cstr); transcoder(NAME); // check right way } xmlCharEncodingHandler& Charset::transcoder(const String::Body NAME) { if(!ftranscoder) throw Exception(PARSER_RUNTIME, new String(NAME, String::L_TAINTED), "unsupported encoding"); return *ftranscoder; } String::C Charset::transcode_cstr(const xmlChar* s) { if(!s) return String::C("", 0); int inlen=strlen((const char*)s); int outlen=inlen*6/*strlen("ÿ")*/; // max #ifndef NDEBUG int saved_outlen=outlen; #endif char *out=new(PointerFreeGC) char[outlen+1]; int error; if(xmlCharEncodingOutputFunc output=transcoder(FNAME).output) { error=output( (unsigned char*)out, &outlen, (const unsigned char*)s, &inlen #ifdef PA_PATCHED_LIBXML_BACKWARD ,0 #endif ); } else { memcpy(out, s, outlen=inlen); error=0; } if(error<0) throw Exception(0, 0, "transcode_cstr failed (%d)", error); assert(outlen<=saved_outlen); out[outlen]=0; return String::C(out, outlen); } const String& Charset::transcode(const xmlChar* s) { String::C cstr=transcode_cstr(s); return *new String(cstr.str, String::L_TAINTED); } /// @test less memory using -maybe- xmlParserInputBufferCreateMem xmlChar* Charset::transcode_buf2xchar(const char* buf, size_t buf_size) { xmlChar* out; int outlen; int error; #ifndef NDEBUG int saved_outlen; #endif if(xmlCharEncodingInputFunc input=transcoder(FNAME).input) { outlen=buf_size*6/*max UTF8 bytes per char*/; #ifndef NDEBUG saved_outlen=outlen; #endif out=(xmlChar*)xmlMalloc(outlen+1); error=input( out, &outlen, (const unsigned char*)buf, (int*)&buf_size #ifdef PA_PATCHED_LIBXML_BACKWARD ,0 #endif ); } else { outlen=buf_size; #ifndef NDEBUG saved_outlen=outlen; #endif out=(xmlChar*)xmlMalloc(outlen+1); memcpy(out, buf, outlen); error=0; } if(error<0) throw Exception(0, 0, "transcode_buf failed (%d)", error); assert(outlen<=saved_outlen); out[outlen]=0; return out; } xmlChar* Charset::transcode(const String& s) { String::Body sbody=s.cstr_to_string_body_untaint(String::L_AS_IS); return transcode_buf2xchar(sbody.cstr(), sbody.length()); } xmlChar* Charset::transcode(const String::Body s) { return transcode_buf2xchar(s.cstr(), s.length()); } #endif String::Body Charset::transcode(const String::Body src, const Charset& source_transcoder, const Charset& dest_transcoder) { const char *src_ptr=src.cstr(); size_t src_size=src.length(); String::C dest=Charset::transcode(String::C(src_ptr, src_size), source_transcoder, dest_transcoder); return String::Body(dest.length ? dest.str:0); } String& Charset::transcode(const String& src, const Charset& source_transcoder, const Charset& dest_transcoder) { if(src.is_empty()) return *new String(); return *new String(transcode((String::Body)src, source_transcoder, dest_transcoder), String::L_CLEAN); } void Charset::transcode(ArrayString& src, const Charset& source_transcoder, const Charset& dest_transcoder) { for(size_t i=0; isource_transcoder, *info->dest_transcoder); } void Charset::transcode(HashStringString& src, const Charset& source_transcoder, const Charset& dest_transcoder) { Transcode_pair_info info={&source_transcoder, &dest_transcoder}; src.for_each_ref(transcode_pair, &info); } size_t getUTF8BytePos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t charPos){ const XMLByte* ptr=srcBegin; while(charPos-- && skipUTF8Char(ptr, srcEnd)); return ptr-srcBegin; } size_t getUTF8CharPos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t bytePos){ size_t charPos=0; const XMLByte* ptr=srcBegin; const XMLByte* ptrEnd=srcBegin+bytePos; while(skipUTF8Char(ptr, srcEnd)){ if(ptr>ptrEnd) return charPos; charPos++; } // scan till end but position in bytes still too low throw Exception(0, 0, "Error convertion byte pos to char pos"); } size_t lengthUTF8(const XMLByte* srcBegin, const XMLByte* srcEnd){ size_t size=0; while(skipUTF8Char(srcBegin, srcEnd)) size++; return size; } unsigned int lengthUTF8Char(const XMLByte c){ return gUTFBytes[c]+1; } const char *fixUTF8(const char *src){ if(src && *src){ size_t length=strlen(src); int error_offset; if(_pcre_valid_utf((unsigned char *)src, length, &error_offset)){ char *result=(char *)pa_malloc_atomic(length+1); char *dst=result; do { if(error_offset){ strncpy(dst, src, error_offset); dst+=error_offset; src+=error_offset; length-=error_offset; } *dst++='?'; src++; length--; } while (length && _pcre_valid_utf((unsigned char *)src, length, &error_offset)); if(length){ strcpy(dst, src); } else { *dst='\0'; } return result; } } return src; } bool UTF8_string_iterator::has_next(){ fcharSize=readUTF8Char(fsrcPtr, fsrcEnd, ffirstByte, fUTF8Char); return fcharSize!=0; } parser-3.4.3/src/main/compile.tab.C000644 000000 000000 00000341171 12222352220 017127 0ustar00rootwheel000000 000000 /* A Bison parser, made by GNU Bison 2.4.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 1 "compile.y" /** @file Parser: compiler(lexical parser and grammar). Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) */ volatile const char * IDENT_COMPILE_Y = "$Id: compile.tab.C,v 1.157 2013/09/30 19:44:16 moko Exp $"; /** @todo parser4: - cache compiled code from request to request. to do that... -#: make method definitions, @CLASS, @BASE, @USE instructions, which would be executed afterwards, and actions now performed at compile time would be delayed to run time. -#: make cache expiration on time and on disk-change of class source -#: in apache use subpools for compiled class storage -#: in iis make up specialized Pool object for that */ #define YYSTYPE ArrayOperation* #define YYPARSE_PARAM pc #define YYLEX_PARAM pc #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define yyerror(msg) real_yyerror((Parse_control *)pc, msg) #define YYPRINT(file, type, value) yyprint(file, type, value) // includes #include "compile_tools.h" #include "pa_value.h" #include "pa_request.h" #include "pa_vobject.h" #include "pa_vdouble.h" #include "pa_globals.h" #include "pa_vmethod_frame.h" // defines #define USE_CONTROL_METHOD_NAME "USE" #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS" #define OPTION_ALL_VARS_LOCAL_NAME "locals" #define OPTION_PARTIAL_CLASS "partial" #define REM_OPERATOR_NAME "rem" // forwards static int real_yyerror(Parse_control* pc, const char* s); static void yyprint(FILE* file, int type, YYSTYPE value); static int yylex(YYSTYPE* lvalp, void* pc); static const VBool vfalse(false); static const VBool vtrue(true); static const VString vempty; // local convinient inplace typecast & var #undef PC #define PC (*(Parse_control *)pc) #undef POOL #define POOL (*PC.pool) #ifndef DOXYGEN #define CLASS_ADD if(PC.class_add()){ \ strncpy(PC.error, PC.cclass->name().cstr(), MAX_STRING/2); \ strcat(PC.error, " - class is already defined"); \ YYERROR; \ } /* Line 189 of yacc.c */ #line 147 "compile.tab.C" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { EON = 258, STRING = 259, BOGUS = 260, BAD_STRING_COMPARISON_OPERATOR = 261, BAD_HEX_LITERAL = 262, BAD_METHOD_DECL_START = 263, BAD_METHOD_PARAMETER_NAME_CHARACTER = 264, BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE = 265, LAND = 266, LOR = 267, LXOR = 268, NXOR = 269, NLE = 270, NGE = 271, NEQ = 272, NNE = 273, NSL = 274, NSR = 275, SLT = 276, SGT = 277, SLE = 278, SGE = 279, SEQ = 280, SNE = 281, DEF = 282, IN = 283, FEXISTS = 284, DEXISTS = 285, IS = 286, LITERAL_TRUE = 287, LITERAL_FALSE = 288, NUNARY = 289 }; #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 223 "compile.tab.C" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 51 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 470 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 62 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 89 /* YYNRULES -- Number of rules. */ #define YYNRULES 172 /* YYNRULES -- Number of states. */ #define YYNSTATES 263 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 289 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 46, 60, 2, 52, 43, 37, 61, 56, 57, 40, 38, 2, 39, 55, 41, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 59, 51, 34, 2, 35, 2, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49, 42, 50, 58, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53, 36, 54, 45, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 44 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 7, 9, 12, 14, 16, 18, 23, 25, 27, 29, 32, 35, 37, 39, 40, 49, 51, 53, 57, 59, 61, 63, 67, 69, 71, 73, 75, 77, 80, 82, 84, 86, 88, 90, 92, 95, 98, 100, 104, 106, 108, 110, 113, 115, 118, 122, 124, 126, 128, 130, 133, 136, 138, 140, 142, 143, 144, 150, 154, 158, 160, 162, 164, 166, 168, 170, 173, 175, 176, 177, 184, 186, 188, 191, 193, 195, 197, 198, 199, 205, 209, 213, 215, 219, 221, 225, 227, 231, 233, 235, 237, 239, 241, 243, 245, 248, 250, 253, 256, 258, 260, 263, 265, 267, 269, 271, 274, 277, 278, 279, 285, 287, 289, 292, 295, 297, 299, 302, 305, 307, 309, 311, 313, 315, 317, 321, 325, 329, 332, 335, 338, 341, 344, 347, 350, 353, 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397, 401, 405, 409, 413, 417, 421, 425, 429, 433, 437, 441, 445, 449, 453, 457, 461, 463, 465, 467, 468, 470, 472 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { 63, 0, -1, 65, -1, 64, -1, 66, -1, 64, 66, -1, 79, -1, 67, -1, 72, -1, 47, 4, 48, 68, -1, 150, -1, 69, -1, 70, -1, 69, 70, -1, 71, 48, -1, 150, -1, 4, -1, -1, 47, 4, 75, 74, 78, 48, 73, 79, -1, 150, -1, 75, -1, 49, 76, 50, -1, 150, -1, 77, -1, 4, -1, 77, 51, 4, -1, 150, -1, 4, -1, 150, -1, 80, -1, 81, -1, 80, 81, -1, 146, -1, 82, -1, 83, -1, 91, -1, 106, -1, 84, -1, 52, 85, -1, 87, 3, -1, 86, -1, 53, 87, 54, -1, 88, -1, 89, -1, 90, -1, 139, 90, -1, 129, -1, 126, 129, -1, 52, 92, 96, -1, 93, -1, 94, -1, 95, -1, 125, -1, 55, 125, -1, 139, 125, -1, 97, -1, 100, -1, 101, -1, -1, -1, 49, 98, 102, 99, 50, -1, 56, 142, 57, -1, 53, 79, 54, -1, 147, -1, 4, -1, 103, -1, 104, -1, 105, -1, 82, -1, 81, 80, -1, 107, -1, -1, -1, 58, 108, 110, 109, 111, 3, -1, 87, -1, 112, -1, 111, 112, -1, 113, -1, 116, -1, 117, -1, -1, -1, 49, 114, 118, 115, 50, -1, 56, 119, 57, -1, 53, 120, 54, -1, 121, -1, 118, 51, 121, -1, 122, -1, 119, 51, 122, -1, 123, -1, 120, 51, 123, -1, 124, -1, 142, -1, 79, -1, 147, -1, 4, -1, 103, -1, 130, -1, 126, 130, -1, 127, -1, 126, 127, -1, 128, 55, -1, 130, -1, 130, -1, 4, 5, -1, 4, -1, 131, -1, 132, -1, 133, -1, 52, 136, -1, 4, 137, -1, -1, -1, 49, 134, 80, 135, 50, -1, 4, -1, 138, -1, 137, 138, -1, 52, 136, -1, 140, -1, 141, -1, 4, 59, -1, 140, 59, -1, 143, -1, 144, -1, 148, -1, 149, -1, 84, -1, 107, -1, 60, 145, 60, -1, 61, 145, 61, -1, 56, 143, 57, -1, 39, 143, -1, 38, 143, -1, 45, 143, -1, 46, 143, -1, 27, 143, -1, 28, 143, -1, 29, 143, -1, 30, 143, -1, 143, 39, 143, -1, 143, 38, 143, -1, 143, 40, 143, -1, 143, 41, 143, -1, 143, 43, 143, -1, 143, 42, 143, -1, 143, 19, 143, -1, 143, 20, 143, -1, 143, 37, 143, -1, 143, 36, 143, -1, 143, 14, 143, -1, 143, 11, 143, -1, 143, 12, 143, -1, 143, 13, 143, -1, 143, 34, 143, -1, 143, 35, 143, -1, 143, 15, 143, -1, 143, 16, 143, -1, 143, 17, 143, -1, 143, 18, 143, -1, 143, 21, 143, -1, 143, 22, 143, -1, 143, 23, 143, -1, 143, 24, 143, -1, 143, 25, 143, -1, 143, 26, 143, -1, 143, 31, 143, -1, 4, -1, 79, -1, 4, -1, -1, 32, -1, 33, -1, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 140, 140, 147, 149, 149, 150, 152, 152, 154, 263, 263, 264, 264, 265, 266, 266, 268, 268, 316, 316, 317, 318, 318, 319, 319, 321, 321, 325, 325, 327, 327, 328, 328, 329, 329, 329, 333, 374, 375, 375, 376, 378, 379, 380, 433, 434, 434, 438, 451, 452, 453, 454, 480, 485, 488, 489, 490, 492, 495, 492, 503, 511, 518, 519, 520, 522, 528, 529, 529, 533, 545, 548, 545, 593, 595, 595, 597, 598, 599, 601, 604, 601, 607, 608, 610, 611, 614, 615, 618, 619, 621, 624, 638, 643, 644, 645, 650, 650, 652, 652, 653, 654, 662, 667, 670, 671, 672, 673, 675, 679, 688, 691, 688, 699, 704, 704, 705, 711, 712, 714, 727, 739, 741, 742, 743, 744, 745, 746, 747, 748, 750, 751, 752, 753, 754, 755, 756, 757, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 788, 793, 814, 819, 820, 821, 823 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "EON", "STRING", "BOGUS", "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL", "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER", "BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE", "\"&&\"", "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"", "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"", "\"false\"", "'<'", "'>'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", "'\\\\'", "'%'", "NUNARY", "'~'", "'!'", "'@'", "'\\n'", "'['", "']'", "';'", "'$'", "'{'", "'}'", "'.'", "'('", "')'", "'^'", "':'", "'\"'", "'\\''", "$accept", "all", "methods", "one_big_piece", "method", "control_method", "maybe_control_strings", "control_strings", "control_string", "maybe_string", "code_method", "@1", "maybe_bracketed_strings", "bracketed_maybe_strings", "maybe_strings", "strings", "maybe_comment", "maybe_codes", "codes", "code", "action", "get", "get_value", "get_name_value", "name_in_curly_rdive", "name_without_curly_rdive", "name_without_curly_rdive_read", "name_without_curly_rdive_class", "name_without_curly_rdive_code", "put", "name_expr_wdive", "name_expr_wdive_root", "name_expr_wdive_write", "name_expr_wdive_class", "construct", "construct_square", "@2", "$@3", "construct_round", "construct_curly", "any_constructor_code_value", "constructor_code_value", "constructor_code", "codes__excluding_sole_str_literal", "call", "call_value", "$@4", "$@5", "call_name", "store_params", "store_param", "store_square_param", "@6", "$@7", "store_round_param", "store_curly_param", "store_code_param_parts", "store_expr_param_parts", "store_curly_param_parts", "store_code_param_part", "store_expr_param_part", "store_curly_param_part", "code_param_value", "name_expr_dive_code", "name_path", "name_step", "name_advance1", "name_advance2", "name_expr_value", "name_expr_subvar_value", "name_expr_with_subvar_value", "name_square_code_value", "@8", "$@9", "subvar_ref_name_rdive", "subvar_get_writes", "subvar__get_write", "class_prefix", "class_static_prefix", "class_constructor_prefix", "expr_value", "expr", "double_or_STRING", "string_inside_quotes_value", "write_string", "empty_value", "true_value", "false_value", "empty", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 60, 62, 124, 38, 43, 45, 42, 47, 92, 37, 289, 126, 33, 64, 10, 91, 93, 59, 36, 123, 125, 46, 40, 41, 94, 58, 34, 39 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 62, 63, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 73, 72, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 82, 83, 84, 85, 85, 86, 87, 87, 88, 89, 90, 90, 91, 92, 92, 92, 93, 94, 95, 96, 96, 96, 98, 99, 97, 100, 101, 102, 102, 102, 103, 104, 105, 105, 106, 108, 109, 107, 110, 111, 111, 112, 112, 112, 114, 115, 113, 116, 117, 118, 118, 119, 119, 120, 120, 121, 122, 123, 124, 124, 124, 125, 125, 126, 126, 127, 128, 129, 129, 130, 130, 130, 130, 131, 132, 134, 135, 133, 136, 137, 137, 138, 139, 139, 140, 141, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 145, 146, 147, 148, 149, 150 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 2, 1, 1, 0, 8, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 2, 1, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 5, 3, 3, 1, 1, 1, 1, 1, 1, 2, 1, 0, 0, 6, 1, 1, 2, 1, 1, 1, 0, 0, 5, 3, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 0, 0, 5, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 0, 1, 1, 0 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 172, 168, 0, 0, 71, 0, 3, 2, 4, 7, 8, 6, 29, 30, 33, 34, 37, 35, 36, 70, 32, 28, 0, 105, 111, 0, 0, 0, 38, 40, 0, 42, 43, 44, 0, 49, 50, 51, 52, 0, 99, 0, 46, 97, 106, 107, 108, 0, 118, 119, 0, 1, 5, 31, 172, 172, 172, 104, 0, 120, 110, 115, 0, 114, 109, 0, 0, 103, 0, 105, 53, 0, 97, 39, 58, 172, 0, 48, 55, 56, 57, 105, 100, 47, 98, 101, 45, 54, 121, 74, 72, 16, 9, 11, 12, 0, 10, 24, 0, 23, 22, 172, 20, 19, 117, 116, 112, 41, 98, 169, 0, 166, 0, 0, 0, 0, 170, 171, 0, 0, 0, 0, 0, 0, 172, 172, 126, 127, 0, 122, 123, 124, 125, 0, 13, 15, 14, 21, 0, 27, 0, 26, 0, 168, 0, 33, 59, 65, 66, 67, 63, 62, 135, 136, 137, 138, 132, 131, 133, 134, 0, 167, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 172, 0, 0, 75, 77, 78, 79, 25, 17, 113, 69, 0, 130, 128, 129, 150, 151, 152, 149, 155, 156, 157, 158, 145, 146, 159, 160, 161, 162, 163, 164, 165, 153, 154, 148, 147, 140, 139, 141, 142, 144, 143, 169, 93, 0, 89, 0, 87, 92, 73, 76, 172, 60, 168, 96, 81, 85, 91, 94, 172, 84, 0, 83, 18, 169, 0, 90, 88, 86, 82 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 5, 6, 7, 8, 9, 92, 93, 94, 95, 10, 244, 101, 56, 98, 99, 140, 161, 12, 13, 14, 15, 126, 28, 29, 30, 31, 32, 33, 17, 34, 35, 36, 37, 77, 78, 109, 204, 79, 80, 146, 247, 148, 149, 18, 127, 50, 133, 90, 195, 196, 197, 235, 258, 198, 199, 248, 239, 237, 249, 240, 238, 250, 38, 66, 40, 41, 42, 67, 44, 45, 46, 62, 142, 64, 60, 61, 68, 48, 49, 241, 129, 130, 162, 20, 251, 131, 132, 21 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -107 static const yytype_int16 yypact[] = { 14, -107, 13, 45, -107, 28, -15, -107, -107, -107, -107, -107, 21, -107, -107, -107, -107, -107, -107, -107, -107, -107, 73, 19, -107, 50, 6, 44, -107, -107, 87, -107, -107, -107, -34, -107, -107, -107, -107, 65, -107, 48, -107, 5, -107, -107, -107, 65, 24, -107, 6, -107, -107, -107, 88, 109, 74, -107, 50, -107, 76, -107, 21, -107, -107, 86, 65, 101, 65, 76, -107, 44, 101, -107, -107, 21, 7, -107, -107, -107, -107, 18, -107, -107, 5, -107, -107, -107, -107, -107, -107, -107, -107, 9, -107, 94, 99, -107, 93, 112, -107, 146, -107, -107, -107, -107, 21, -107, 101, 29, 110, -107, 7, 7, 7, 7, -107, -107, 7, 7, 7, 7, 52, 7, 21, 21, -107, -107, 113, 323, -107, -107, -107, 92, -107, -107, -107, -107, 165, -107, 144, -107, 147, 149, 21, 80, -107, -107, -107, -107, -107, -107, 96, 96, 96, 96, -107, -107, -107, -107, 276, -107, 138, 139, -107, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -107, 21, 7, 35, -107, -107, -107, -107, -107, -107, -107, 21, 154, -107, -107, -107, 419, 389, 356, 284, 135, 135, 148, 148, 191, 191, 135, 135, 135, 135, 148, 148, 96, 135, 135, 182, 427, 140, 140, -107, -107, -107, -107, 37, -107, 31, -107, -30, -107, -107, -107, -107, 21, -107, 108, -107, 155, -107, -107, -107, 21, -107, 7, -107, -107, 37, 161, -107, -107, -107, -107 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -107, -107, -107, -107, 206, -107, -107, -107, 124, -107, -107, -107, -107, 170, -107, -107, -107, 1, -58, -7, -106, -107, 0, -107, -107, -6, -107, -107, -21, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, 118, -107, -107, -107, 2, -107, -107, -107, -107, 43, -107, -107, -107, -107, -107, -107, -107, -107, -17, -13, -16, -107, -18, 4, 41, -107, -23, 3, -107, -107, -107, -107, -107, 181, -107, 183, 239, -107, -107, 171, 95, -107, 123, -107, 142, -107, -107, 64 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -173 static const yytype_int16 yytable[] = { 16, 11, 19, 145, 106, 53, 43, 39, -103, 70, 23, 111, 16, 91, 19, 74, 83, 22, 1, 75, 65, 254, 76, 57, 57, 1, 86, 255, 51, 87, 72, 71, 2, 143, 112, 113, 114, 115, 242, 116, 117, 246, 84, 83, 89, 118, 119, 86, 69, 23, 43, 39, 120, 121, 63, 24, 23, -172, 25, 122, -102, 2, 16, 123, 19, 4, 3, 124, 125, 81, 58, 58, 4, 3, 108, 16, 110, 19, 59, 4, 82, 3, 252, 88, 192, 253, 203, 4, 193, 3, 73, 194, 91, 24, 24, 4, 25, 25, 26, 53, 27, 24, 144, 85, 25, 26, 16, 82, 19, 16, 168, 19, 82, 97, 24, 173, 174, 25, 96, 100, 103, 54, 55, 55, 16, 16, 19, 19, 58, 145, -68, -68, 184, 185, 186, 187, 188, 189, 190, 191, 107, 192, 136, 137, 16, 193, 19, -15, 194, 168, 139, 145, 171, 172, 173, 174, -102, 135, -95, -95, 179, 180, 168, 138, 151, 141, 181, 173, 174, 200, 164, 184, 185, 186, 187, 188, 189, 190, 191, 181, 188, 189, 190, 191, 184, 185, 186, 187, 188, 189, 190, 191, 201, 16, 236, 19, 53, 202, 206, -64, 207, 173, 174, 16, 245, 19, 257, 152, 153, 154, 155, 262, 52, 156, 157, 158, 159, 134, 160, 185, 186, 187, 188, 189, 190, 191, 102, 147, 144, 186, 187, 188, 189, 190, 191, 16, 259, 19, 243, 104, 261, 260, 47, 105, 16, 256, 19, 128, 163, 0, 144, 150, 16, 236, 19, 0, 0, 16, 0, 19, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 173, 174, 0, 0, 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 184, 185, 186, 187, 188, 189, 190, 191, 0, 0, 0, 0, 0, 205, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, 0, 0, 0, 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 165, 166, 0, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, 0, 0, 0, 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 165, 0, 0, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, 0, 0, 0, 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 173, 174, 0, 0, 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 0, 0, 186, 187, 188, 189, 190, 191 }; static const yytype_int16 yycheck[] = { 0, 0, 0, 109, 62, 12, 3, 3, 3, 27, 4, 4, 12, 4, 12, 49, 39, 4, 4, 53, 26, 51, 56, 5, 5, 4, 47, 57, 0, 47, 27, 27, 47, 4, 27, 28, 29, 30, 3, 32, 33, 4, 39, 66, 50, 38, 39, 68, 4, 4, 47, 47, 45, 46, 4, 49, 4, 48, 52, 52, 55, 47, 62, 56, 62, 58, 52, 60, 61, 4, 52, 52, 58, 52, 71, 75, 75, 75, 59, 58, 39, 52, 51, 59, 49, 54, 144, 58, 53, 52, 3, 56, 4, 49, 49, 58, 52, 52, 53, 106, 55, 49, 109, 55, 52, 53, 106, 66, 106, 109, 14, 109, 71, 4, 49, 19, 20, 52, 54, 55, 56, 48, 49, 49, 124, 125, 124, 125, 52, 235, 50, 51, 36, 37, 38, 39, 40, 41, 42, 43, 54, 49, 48, 50, 144, 53, 144, 48, 56, 14, 4, 257, 17, 18, 19, 20, 55, 93, 50, 51, 25, 26, 14, 51, 54, 101, 31, 19, 20, 4, 57, 36, 37, 38, 39, 40, 41, 42, 43, 31, 40, 41, 42, 43, 36, 37, 38, 39, 40, 41, 42, 43, 48, 193, 193, 193, 203, 50, 60, 50, 61, 19, 20, 203, 50, 203, 51, 112, 113, 114, 115, 50, 6, 118, 119, 120, 121, 93, 123, 37, 38, 39, 40, 41, 42, 43, 56, 109, 235, 38, 39, 40, 41, 42, 43, 235, 252, 235, 195, 58, 257, 254, 3, 60, 244, 244, 244, 76, 125, -1, 257, 109, 252, 252, 252, -1, -1, 257, -1, 257, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 19, 20, -1, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 36, 37, 38, 39, 40, 41, 42, 43, -1, -1, -1, -1, -1, 57, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 11, 12, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 11, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 19, 20, -1, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, -1, 38, 39, 40, 41, 42, 43 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 4, 47, 52, 58, 63, 64, 65, 66, 67, 72, 79, 80, 81, 82, 83, 84, 91, 106, 107, 146, 150, 4, 4, 49, 52, 53, 55, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 125, 126, 127, 128, 129, 130, 131, 132, 133, 139, 140, 141, 108, 0, 66, 81, 48, 49, 75, 5, 52, 59, 137, 138, 134, 4, 136, 87, 126, 130, 139, 4, 125, 126, 130, 3, 49, 53, 56, 96, 97, 100, 101, 4, 127, 129, 130, 55, 90, 125, 59, 87, 110, 4, 68, 69, 70, 71, 150, 4, 76, 77, 150, 74, 75, 150, 136, 138, 80, 54, 130, 98, 79, 4, 27, 28, 29, 30, 32, 33, 38, 39, 45, 46, 52, 56, 60, 61, 84, 107, 142, 143, 144, 148, 149, 109, 70, 150, 48, 50, 51, 4, 78, 150, 135, 4, 81, 82, 102, 103, 104, 105, 147, 54, 143, 143, 143, 143, 143, 143, 143, 143, 143, 79, 145, 145, 57, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 49, 53, 56, 111, 112, 113, 116, 117, 4, 48, 50, 80, 99, 57, 60, 61, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 114, 79, 120, 123, 119, 122, 142, 3, 112, 73, 50, 4, 103, 118, 121, 124, 147, 51, 54, 51, 57, 79, 51, 115, 123, 122, 121, 50 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. However, YYFAIL appears to be in use. Nevertheless, it is formally deprecated in Bison 2.4.2's NEWS entry, where a plan to phase it out is discussed. */ #define YYFAIL goto yyerrlab #if defined YYFAIL /* This is here to suppress warnings from the GCC cpp's -Wunused-macros. Normally we don't worry about that warning, but some users do, and we want to make it easy for users to remove YYFAIL uses, which will produce warnings from Bison 2.5. */ #endif #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else # define YYLEX yylex (&yylval) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* Line 1464 of yacc.c */ #line 140 "compile.y" { Method* method=new Method(Method::CT_ANY, 0, 0, /*min, max numbered_params_count*/ 0/*param_names*/, 0/*local_names*/, (yyvsp[(1) - (1)])/*parser_code*/, 0/*native_code*/); PC.cclass->set_method(PC.alias_method(main_method_name), method); ;} break; case 9: /* Line 1464 of yacc.c */ #line 155 "compile.y" { const String& command=LA2S(*(yyvsp[(2) - (4)]))->trim(String::TRIM_END); YYSTYPE strings_code=(yyvsp[(4) - (4)]); if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) { strcpy(PC.error, "@"); strcat(PC.error, command.cstr()); strcat(PC.error, " is empty"); YYERROR; } if(command==CLASS_NAME) { if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { CLASS_ADD; // new class' name const String& name=LA2S(*strings_code)->trim(String::TRIM_END); // creating the class VStateless_class* cclass=new VClass; PC.cclass_new=cclass; PC.cclass_new->set_name(name); } else { strcpy(PC.error, "@"CLASS_NAME" must contain only one line with class name (contains more then one)"); YYERROR; } } else if(command==USE_CONTROL_METHOD_NAME) { CLASS_ADD; for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) PC.request.use_file(PC.request.main_class, LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filename(PC.file_no)); } else if(command==BASE_NAME) { if(PC.append){ strcpy(PC.error, "can't set base while appending methods to class '"); strncat(PC.error, PC.cclass->name().cstr(), MAX_STRING/2); strcat(PC.error, "'"); YYERROR; } CLASS_ADD; if(PC.cclass->base_class()) { // already changed from default? strcpy(PC.error, "class already have a base '"); strncat(PC.error, PC.cclass->base_class()->name().cstr(), MAX_STRING/2); strcat(PC.error, "'"); YYERROR; } if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { const String& base_name=LA2S(*strings_code)->trim(String::TRIM_END); if(Value* base_class_value=PC.request.get_class(base_name)) { // @CLASS == @BASE sanity check if(VStateless_class *base_class=base_class_value->get_class()) { if(PC.cclass==base_class) { strcpy(PC.error, "@"CLASS_NAME" equals @"BASE_NAME); YYERROR; } PC.cclass->get_class()->set_base(base_class); } else { // they asked to derive from a class without methods ['env' & co] strcpy(PC.error, base_name.cstr()); strcat(PC.error, ": you can not derive from this class in @"BASE_NAME); YYERROR; } } else { strcpy(PC.error, base_name.cstr()); strcat(PC.error, ": undefined class in @"BASE_NAME); YYERROR; } } else { strcpy(PC.error, "@"BASE_NAME" must contain sole name"); YYERROR; } } else if(command==OPTIONS_CONTROL_METHOD_NAME) { for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) { const String& option=LA2S(*strings_code, i)->trim(String::TRIM_END); if(option==OPTION_ALL_VARS_LOCAL_NAME){ PC.set_all_vars_local(); } else if(option==OPTION_PARTIAL_CLASS){ if(PC.cclass_new){ if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){ if(!PC.reuse_existed_class(existed)){ strcpy(PC.error, "can't append methods to '"); strncat(PC.error, PC.cclass_new->name().cstr(), MAX_STRING/2); strcat(PC.error, "' - the class wasn't marked as partial"); YYERROR; } } else { // marks the new class as partial. we will be able to add methods here later. PC.cclass_new->set_partial(); } } else { strcpy(PC.error, "'"OPTION_PARTIAL_CLASS"' option should be used straight after @"CLASS_NAME); YYERROR; } } else if(option==method_call_type_static){ PC.set_methods_call_type(Method::CT_STATIC); } else if(option==method_call_type_dynamic){ PC.set_methods_call_type(Method::CT_DYNAMIC); } else { strcpy(PC.error, "'"); strncat(PC.error, option.cstr(), MAX_STRING/2); strcat(PC.error, "' invalid option. valid options are " "'"OPTION_PARTIAL_CLASS"', '"OPTION_ALL_VARS_LOCAL_NAME"'" ", '"METHOD_CALL_TYPE_STATIC"' and '"METHOD_CALL_TYPE_DYNAMIC"'" ); YYERROR; } } } else { strcpy(PC.error, "'"); strncat(PC.error, command.cstr(), MAX_STRING/2); strcat(PC.error, "' invalid special name. valid names are " "'"CLASS_NAME"', '"USE_CONTROL_METHOD_NAME"', '"BASE_NAME"' and '"OPTIONS_CONTROL_METHOD_NAME"'."); YYERROR; } ;} break; case 13: /* Line 1464 of yacc.c */ #line 264 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 17: /* Line 1464 of yacc.c */ #line 268 "compile.y" { CLASS_ADD; PC.explicit_result=false; YYSTYPE params_names_code=(yyvsp[(3) - (6)]); ArrayString* params_names=0; if(int size=params_names_code->count()) { params_names=new ArrayString; for(int i=0; icount()) { locals_names=new ArrayString; for(int i=0; iis_vars_local()) all_vars_local=true; Method* method=new Method( //name, GetMethodCallType(PC, *(yyvsp[(2) - (6)])), 0, 0/*min,max numbered_params_count*/, params_names, locals_names, 0/*to be filled later in next {} */, 0, all_vars_local); *reinterpret_cast(&(yyval))=method; ;} break; case 18: /* Line 1464 of yacc.c */ #line 306 "compile.y" { Method* method=reinterpret_cast((yyvsp[(7) - (8)])); // fill in the code method->parser_code=(yyvsp[(8) - (8)]); // register in class const String& name=*LA2S(*(yyvsp[(2) - (8)])); PC.cclass->set_method(PC.alias_method(name), method); ;} break; case 21: /* Line 1464 of yacc.c */ #line 317 "compile.y" {(yyval)=(yyvsp[(2) - (3)]);;} break; case 25: /* Line 1464 of yacc.c */ #line 319 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); ;} break; case 31: /* Line 1464 of yacc.c */ #line 327 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 37: /* Line 1464 of yacc.c */ #line 333 "compile.y" { (yyval)=N(); YYSTYPE code=(yyvsp[(1) - (1)]); size_t count=code->count(); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if( count!=3 || !maybe_change_first_opcode(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT if( count!=3 || !maybe_change_first_opcode(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if( count!=5 || !maybe_change_first_opcode(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if( count!=5 || !maybe_change_first_opcode(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE) ) #endif { changetail_or_append(*code, OP::OP_GET_ELEMENT, false, /*=>*/OP::OP_GET_ELEMENT__WRITE, /*or */OP::OP_WRITE_VALUE ); /* value=pop; wcontext.write(value) */ } P(*(yyval), *code); ;} break; case 38: /* Line 1464 of yacc.c */ #line 374 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); ;} break; case 41: /* Line 1464 of yacc.c */ #line 376 "compile.y" { (yyval)=(yyvsp[(2) - (3)]); ;} break; case 44: /* Line 1464 of yacc.c */ #line 380 "compile.y" { (yyval)=N(); YYSTYPE diving_code=(yyvsp[(1) - (1)]); size_t count=diving_code->count(); if(maybe_make_self(*(yyval), *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if(maybe_make_get_object_element(*(yyval), *diving_code, count)){ // optimization for $object.field + ^object.method[ } else #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if(maybe_make_get_object_var_element(*(yyval), *diving_code, count)){ // optimization for $object.$var } else #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if( count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ // optimization O(*(yyval), (PC.in_call_value && count==4) ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string : OP::OP_VALUE__GET_ELEMENT // $object : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string ); P(*(yyval), *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*(yyval), *diving_code, 4); // copy tail } else { O(*(yyval), OP::OP_WITH_READ); /* stack: starting context */ P(*(yyval), *diving_code); } #else { O(*(yyval), OP::OP_WITH_READ); /* stack: starting context */ // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR. if(PC.in_call_value && count==4) diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR); P(*(yyval), *diving_code); } #endif /* diving code; stack: current context */ ;} break; case 45: /* Line 1464 of yacc.c */ #line 433 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 47: /* Line 1464 of yacc.c */ #line 434 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 48: /* Line 1464 of yacc.c */ #line 438 "compile.y" { (yyval)=N(); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT if(maybe_optimize_construct(*(yyval), *(yyvsp[(2) - (3)]), *(yyvsp[(3) - (3)]))){ // $a(expr), $.a(expr), $a[value], $.a[value], $self.a[value], $self.a(expr) } else #endif { P(*(yyval), *(yyvsp[(2) - (3)])); /* stack: context,name */ P(*(yyval), *(yyvsp[(3) - (3)])); /* stack: context,name,constructor_value */ } ;} break; case 52: /* Line 1464 of yacc.c */ #line 454 "compile.y" { (yyval)=N(); YYSTYPE diving_code=(yyvsp[(1) - (1)]); size_t count=diving_code->count(); if(maybe_make_self(*(yyval), *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if( count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ O(*(yyval), OP::OP_WITH_ROOT__VALUE__GET_ELEMENT); P(*(yyval), *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*(yyval), *diving_code, 4); // tail } else #endif { O(*(yyval), OP::OP_WITH_ROOT); /* stack: starting context */ P(*(yyval), *diving_code); } /* diving code; stack: current context */ ;} break; case 53: /* Line 1464 of yacc.c */ #line 480 "compile.y" { (yyval)=N(); O(*(yyval), OP::OP_WITH_WRITE); /* stack: starting context */ P(*(yyval), *(yyvsp[(2) - (2)])); /* diving code; stack: context,name */ ;} break; case 54: /* Line 1464 of yacc.c */ #line 485 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 58: /* Line 1464 of yacc.c */ #line 492 "compile.y" { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&(yyval))=PC.explicit_result; PC.explicit_result=false; ;} break; case 59: /* Line 1464 of yacc.c */ #line 495 "compile.y" { PC.explicit_result=*reinterpret_cast(&(yyvsp[(2) - (3)])); ;} break; case 60: /* Line 1464 of yacc.c */ #line 497 "compile.y" { // stack: context, name (yyval)=(yyvsp[(3) - (5)]); // stack: context, name, value O(*(yyval), OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ ;} break; case 61: /* Line 1464 of yacc.c */ #line 503 "compile.y" { (yyval)=N(); O(*(yyval), OP::OP_PREPARE_TO_EXPRESSION); // stack: context, name P(*(yyval), *(yyvsp[(2) - (3)])); // stack: context, name, value O(*(yyval), OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ ;} break; case 62: /* Line 1464 of yacc.c */ #line 511 "compile.y" { // stack: context, name (yyval)=N(); OA(*(yyval), OP::OP_CURLY_CODE__CONSTRUCT, (yyvsp[(2) - (3)])); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ ;} break; case 66: /* Line 1464 of yacc.c */ #line 522 "compile.y" { (yyval)=N(); OA(*(yyval), OP::OP_OBJECT_POOL, (yyvsp[(1) - (1)])); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ ;} break; case 69: /* Line 1464 of yacc.c */ #line 529 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 70: /* Line 1464 of yacc.c */ #line 533 "compile.y" { #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR if((*(yyvsp[(1) - (1)])).count()) #endif { (yyval)=(yyvsp[(1) - (1)]); /* stack: value */ if(!maybe_change_first_opcode(*(yyval), OP::OP_CONSTRUCT_OBJECT, /*=>*/OP::OP_CONSTRUCT_OBJECT__WRITE)) changetail_or_append(*(yyval), OP::OP_CALL, true, /*=>*/ OP::OP_CALL__WRITE, /*or */OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ } ;} break; case 71: /* Line 1464 of yacc.c */ #line 545 "compile.y" { PC.in_call_value=true; ;} break; case 72: /* Line 1464 of yacc.c */ #line 548 "compile.y" { PC.in_call_value=false; ;} break; case 73: /* Line 1464 of yacc.c */ #line 551 "compile.y" { /* ^field.$method{vasya} */ #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT const String* operator_name=LA2S(*(yyvsp[(3) - (6)]), 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR); #else const String* operator_name=LA2S(*(yyvsp[(3) - (6)]), 1); #endif if(operator_name && *operator_name==REM_OPERATOR_NAME){ (yyval)=N(); } else #endif { YYSTYPE params_code=(yyvsp[(5) - (6)]); if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? if(const String * string=value->get_string()) if(string->is_empty()) // value is empty string? params_code=0; // ^zzz[] case. don't append lone empty param. } /* stack: context, method_junction */ YYSTYPE var_code=(yyvsp[(3) - (6)]); if( var_code->count()==8 && (*var_code)[0].code==OP::OP_VALUE__GET_CLASS && (*var_code)[3].code==OP::OP_PREPARE_TO_CONSTRUCT_OBJECT && (*var_code)[4].code==OP::OP_VALUE && (*var_code)[7].code==OP::OP_GET_ELEMENT ){ yyval=N(); O(*(yyval), OP::OP_CONSTRUCT_OBJECT); P(*(yyval), *var_code, 1/*offset*/, 2/*limit*/); // class name P(*(yyval), *var_code, 5/*offset*/, 2/*limit*/); // constructor name OA(*(yyval), params_code); } else { (yyval)=var_code; /* with_xxx,diving code; stack: context,method_junction */ OA(*(yyval), OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value } } ;} break; case 76: /* Line 1464 of yacc.c */ #line 595 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 80: /* Line 1464 of yacc.c */ #line 601 "compile.y" { // allow ^call[ letters here any time ] *reinterpret_cast(&(yyval))=PC.explicit_result; PC.explicit_result=false; ;} break; case 81: /* Line 1464 of yacc.c */ #line 604 "compile.y" { PC.explicit_result=*reinterpret_cast(&(yyvsp[(2) - (3)])); ;} break; case 82: /* Line 1464 of yacc.c */ #line 606 "compile.y" {(yyval)=(yyvsp[(3) - (5)]);;} break; case 83: /* Line 1464 of yacc.c */ #line 607 "compile.y" {(yyval)=(yyvsp[(2) - (3)]);;} break; case 84: /* Line 1464 of yacc.c */ #line 608 "compile.y" {(yyval)=(yyvsp[(2) - (3)]);;} break; case 86: /* Line 1464 of yacc.c */ #line 611 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); ;} break; case 88: /* Line 1464 of yacc.c */ #line 615 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); ;} break; case 90: /* Line 1464 of yacc.c */ #line 619 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); ;} break; case 91: /* Line 1464 of yacc.c */ #line 621 "compile.y" { (yyval)=(yyvsp[(1) - (1)]); ;} break; case 92: /* Line 1464 of yacc.c */ #line 624 "compile.y" { YYSTYPE expr_code=(yyvsp[(1) - (1)]); if(expr_code->count()==3 && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating (yyval)=expr_code; } else { YYSTYPE code=N(); O(*code, OP::OP_PREPARE_TO_EXPRESSION); P(*code, *expr_code); O(*code, OP::OP_WRITE_EXPR_RESULT); (yyval)=N(); OA(*(yyval), OP::OP_EXPR_CODE__STORE_PARAM, code); } ;} break; case 93: /* Line 1464 of yacc.c */ #line 638 "compile.y" { (yyval)=N(); OA(*(yyval), OP::OP_CURLY_CODE__STORE_PARAM, (yyvsp[(1) - (1)])); ;} break; case 98: /* Line 1464 of yacc.c */ #line 650 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 100: /* Line 1464 of yacc.c */ #line 652 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 102: /* Line 1464 of yacc.c */ #line 654 "compile.y" { // we know that name_advance1 not called from ^xxx context // so we'll not check for operator call possibility as we do in name_advance2 /* stack: context */ (yyval)=(yyvsp[(1) - (1)]); /* stack: context,name */ O(*(yyval), OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ ;} break; case 103: /* Line 1464 of yacc.c */ #line 662 "compile.y" { /* stack: context */ (yyval)=(yyvsp[(1) - (1)]); /* stack: context,name */ O(*(yyval), OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ ;} break; case 109: /* Line 1464 of yacc.c */ #line 675 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_GET_ELEMENT); ;} break; case 110: /* Line 1464 of yacc.c */ #line 679 "compile.y" { YYSTYPE code; { change_string_literal_to_write_string_literal(*(code=(yyvsp[(1) - (2)]))); P(*code, *(yyvsp[(2) - (2)])); } (yyval)=N(); OA(*(yyval), OP::OP_STRING_POOL, code); ;} break; case 111: /* Line 1464 of yacc.c */ #line 688 "compile.y" { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&(yyval))=PC.explicit_result; PC.explicit_result=false; ;} break; case 112: /* Line 1464 of yacc.c */ #line 691 "compile.y" { PC.explicit_result=*reinterpret_cast(&(yyvsp[(2) - (3)])); ;} break; case 113: /* Line 1464 of yacc.c */ #line 693 "compile.y" { (yyval)=N(); OA(*(yyval), OP::OP_OBJECT_POOL, (yyvsp[(3) - (5)])); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ ;} break; case 114: /* Line 1464 of yacc.c */ #line 699 "compile.y" { (yyval)=N(); O(*(yyval), OP::OP_WITH_READ); P(*(yyval), *(yyvsp[(1) - (1)])); ;} break; case 116: /* Line 1464 of yacc.c */ #line 704 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); P(*(yyval), *(yyvsp[(2) - (2)])); ;} break; case 117: /* Line 1464 of yacc.c */ #line 705 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_GET_ELEMENT__WRITE); ;} break; case 120: /* Line 1464 of yacc.c */ #line 714 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); // stack: class name string if(*LA2S(*(yyval)) == BASE_NAME) { // pseudo BASE class if(VStateless_class* base=PC.cclass->base_class()) { change_string_literal_value(*(yyval), base->name()); } else { strcpy(PC.error, "no base class declared"); YYERROR; } } // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string maybe_change_first_opcode(*(yyval), OP::OP_VALUE, OP::OP_VALUE__GET_CLASS); ;} break; case 121: /* Line 1464 of yacc.c */ #line 727 "compile.y" { (yyval)=(yyvsp[(1) - (2)]); if(!PC.in_call_value) { strcpy(PC.error, ":: not allowed here"); YYERROR; } O(*(yyval), OP::OP_PREPARE_TO_CONSTRUCT_OBJECT); ;} break; case 128: /* Line 1464 of yacc.c */ #line 746 "compile.y" { (yyval) = (yyvsp[(2) - (3)]); ;} break; case 129: /* Line 1464 of yacc.c */ #line 747 "compile.y" { (yyval) = (yyvsp[(2) - (3)]); ;} break; case 130: /* Line 1464 of yacc.c */ #line 748 "compile.y" { (yyval) = (yyvsp[(2) - (3)]); ;} break; case 131: /* Line 1464 of yacc.c */ #line 750 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_NEG); ;} break; case 132: /* Line 1464 of yacc.c */ #line 751 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); ;} break; case 133: /* Line 1464 of yacc.c */ #line 752 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_INV); ;} break; case 134: /* Line 1464 of yacc.c */ #line 753 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_NOT); ;} break; case 135: /* Line 1464 of yacc.c */ #line 754 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_DEF); ;} break; case 136: /* Line 1464 of yacc.c */ #line 755 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_IN); ;} break; case 137: /* Line 1464 of yacc.c */ #line 756 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_FEXISTS); ;} break; case 138: /* Line 1464 of yacc.c */ #line 757 "compile.y" { (yyval)=(yyvsp[(2) - (2)]); O(*(yyval), OP::OP_DEXISTS); ;} break; case 139: /* Line 1464 of yacc.c */ #line 759 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_SUB); ;} break; case 140: /* Line 1464 of yacc.c */ #line 760 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_ADD); ;} break; case 141: /* Line 1464 of yacc.c */ #line 761 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_MUL); ;} break; case 142: /* Line 1464 of yacc.c */ #line 762 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_DIV); ;} break; case 143: /* Line 1464 of yacc.c */ #line 763 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_MOD); ;} break; case 144: /* Line 1464 of yacc.c */ #line 764 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_INTDIV); ;} break; case 145: /* Line 1464 of yacc.c */ #line 765 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_BIN_SL); ;} break; case 146: /* Line 1464 of yacc.c */ #line 766 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_BIN_SR); ;} break; case 147: /* Line 1464 of yacc.c */ #line 767 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_BIN_AND); ;} break; case 148: /* Line 1464 of yacc.c */ #line 768 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_BIN_OR); ;} break; case 149: /* Line 1464 of yacc.c */ #line 769 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_BIN_XOR); ;} break; case 150: /* Line 1464 of yacc.c */ #line 770 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); OA(*(yyval), OP::OP_NESTED_CODE, (yyvsp[(3) - (3)])); O(*(yyval), OP::OP_LOG_AND); ;} break; case 151: /* Line 1464 of yacc.c */ #line 771 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); OA(*(yyval), OP::OP_NESTED_CODE, (yyvsp[(3) - (3)])); O(*(yyval), OP::OP_LOG_OR); ;} break; case 152: /* Line 1464 of yacc.c */ #line 772 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_LOG_XOR); ;} break; case 153: /* Line 1464 of yacc.c */ #line 773 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_NUM_LT); ;} break; case 154: /* Line 1464 of yacc.c */ #line 774 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_NUM_GT); ;} break; case 155: /* Line 1464 of yacc.c */ #line 775 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_NUM_LE); ;} break; case 156: /* Line 1464 of yacc.c */ #line 776 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_NUM_GE); ;} break; case 157: /* Line 1464 of yacc.c */ #line 777 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_NUM_EQ); ;} break; case 158: /* Line 1464 of yacc.c */ #line 778 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_NUM_NE); ;} break; case 159: /* Line 1464 of yacc.c */ #line 779 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_STR_LT); ;} break; case 160: /* Line 1464 of yacc.c */ #line 780 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_STR_GT); ;} break; case 161: /* Line 1464 of yacc.c */ #line 781 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_STR_LE); ;} break; case 162: /* Line 1464 of yacc.c */ #line 782 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_STR_GE); ;} break; case 163: /* Line 1464 of yacc.c */ #line 783 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_STR_EQ); ;} break; case 164: /* Line 1464 of yacc.c */ #line 784 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_STR_NE); ;} break; case 165: /* Line 1464 of yacc.c */ #line 785 "compile.y" { (yyval)=(yyvsp[(1) - (3)]); P(*(yyval), *(yyvsp[(3) - (3)])); O(*(yyval), OP::OP_IS); ;} break; case 166: /* Line 1464 of yacc.c */ #line 788 "compile.y" { // optimized OP_STRING => OP_VALUE for doubles maybe_change_string_literal_to_double_literal(*((yyval)=(yyvsp[(1) - (1)]))); ;} break; case 167: /* Line 1464 of yacc.c */ #line 793 "compile.y" { #ifdef OPTIMIZE_BYTECODE_STRING_POOL // it brakes ^if(" 09 "){...} YYSTYPE code=(yyvsp[(1) - (1)]); (yyval)=N(); if(code->count()==3 && maybe_change_first_opcode(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){ // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL P(*(yyval), *code); } else { OA(*(yyval), OP::OP_STRING_POOL, code); /* stack: empty write context */ } #else (yyval)=N(); OA(*(yyval), OP::OP_STRING_POOL, (yyvsp[(1) - (1)])); /* stack: empty write context */ #endif /* some code that writes to that context */ /* context=pop; stack: context.get_string() */ ;} break; case 168: /* Line 1464 of yacc.c */ #line 814 "compile.y" { // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE change_string_literal_to_write_string_literal(*((yyval)=(yyvsp[(1) - (1)]))); ;} break; case 169: /* Line 1464 of yacc.c */ #line 819 "compile.y" { (yyval)=VL(/*we know that we will not change it*/const_cast(&vempty), 0, 0, 0); ;} break; case 170: /* Line 1464 of yacc.c */ #line 820 "compile.y" { (yyval) = VL(/*we know that we will not change it*/const_cast(&vtrue), 0, 0, 0); ;} break; case 171: /* Line 1464 of yacc.c */ #line 821 "compile.y" { (yyval) = VL(/*we know that we will not change it*/const_cast(&vfalse), 0, 0, 0); ;} break; case 172: /* Line 1464 of yacc.c */ #line 823 "compile.y" { (yyval)=N(); ;} break; /* Line 1464 of yacc.c */ #line 2927 "compile.tab.C" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1684 of yacc.c */ #line 825 "compile.y" #endif /* 000$111(2222)00 000$111{3333}00 $,^: push,=0 1:( { break=pop 2:( ) pop 3:{ } pop 000^111(2222)4444{33333}4000 $,^: push,=0 1:( { break=pop 2:( )=4 3:{ }=4 4:[^({]=pop */ inline void ungetc(Parse_control& pc, uint last_line_end_col) { pc.source--; if(pc.pos.col==0) { --pc.pos.line; pc.pos.col=last_line_end_col; } else --pc.pos.col; } static int yylex(YYSTYPE *lvalp, void *apc) { register Parse_control& pc=*static_cast(apc); #define lexical_brackets_nestage pc.brackets_nestages[pc.ls_sp] #define RC {result=c; goto break2; } register int c; int result; if(pc.pending_state) { result=pc.pending_state; pc.pending_state=0; return result; } const char *begin=pc.source; Pos begin_pos=pc.pos; const char *end; int skip_analized=0; while(true) { c=*(end=(pc.source++)); // fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp); if(c=='\n') pc.pos_next_line(); else pc.pos_next_c(c); // fprintf(stderr, "\nchar: %c file(%d:%d)", c, pc.pos.line, pc.pos.col); if(pc.pos.col==0+1 && c=='@') { if(pc.ls==LS_DEF_SPECIAL_BODY) { // @SPECIAL // ... // @punctuation begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; // converting ^#HH into char(hex(HH)) case '#': if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till ^ pc.string.append_strdup_know_length(begin, end-begin); } // #HH ? if(pc.source[1] && isxdigit(pc.source[1]) && pc.source[2] && isxdigit(pc.source[2])) { char c=(char)( hex_value[(unsigned char)pc.source[1]]*0x10+ hex_value[(unsigned char)pc.source[2]]); if(c==0) { result=BAD_HEX_LITERAL; goto break2; // wrong hex value[no ^#00 chars allowed]: bail out } // append char(hex(HH)) pc.string.append(c); // skip over ^#HH pc.source+=3; pc.pos.col+=3; // reset piece 'begin' position & line begin=pc.source; // ->after ^#HH begin_pos=pc.pos; // skip analysis = forced literal continue; } // just escaped char // reset piece 'begin' position & line begin=pc.source; begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; } break; } } // #comment start skipping if(c=='#' && pc.pos.col==1) { if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_USER_COMMENT); continue; } switch(pc.ls) { // USER'S = NOT OURS case LS_USER: case LS_NAME_SQUARE_PART: // name.[here].xxx if(pc.trim_bof) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: pc.trim_bof=false; } switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(pc.ls==LS_NAME_SQUARE_PART) if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?> pop_LS(pc); // $name.[co<]>de<]!> RC; } break; case '[': // $name.[co<[>de] if(pc.ls==LS_NAME_SQUARE_PART) lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE; goto break2; } break; // #COMMENT case LS_USER_COMMENT: if(c=='\n') { // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // STRING IN EXPRESSION case LS_EXPRESSION_STRING_QUOTED: case LS_EXPRESSION_STRING_APOSTROFED: switch(c) { case '"': case '\'': if( pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"' || pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') { pop_LS(pc); //"abc". | 'abc'. RC; } break; case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; } break; // METHOD DEFINITION case LS_DEF_NAME: switch(c) { case '[': pc.ls=LS_DEF_PARAMS; RC; case '\n': pc.ls=LS_DEF_SPECIAL_BODY; RC; } break; case LS_DEF_PARAMS: switch(c) { case '$': // common error result=BAD_METHOD_PARAMETER_NAME_CHARACTER; goto break2; case ';': RC; case ']': pc.ls=*pc.source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_LOCALS: switch(c) { case '[': case ';': RC; case ']': pc.ls=LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_COMMENT: if(c=='\n') { pop_LS(pc); RC; } break; case LS_DEF_SPECIAL_BODY: if(c=='\n') RC; break; // (EXPRESSION) case LS_VAR_ROUND: case LS_METHOD_ROUND: switch(c) { case ')': if(--lexical_brackets_nestage==0) if(pc.ls==LS_METHOD_ROUND) // method round param ended pc.ls=LS_METHOD_AFTER; // look for method end else // pc.ls==LS_VAR_ROUND // variable constructor ended pop_LS(pc); // return to normal life RC; case '#': // comment start skipping if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_EXPRESSION_COMMENT); lexical_brackets_nestage=1; continue; case '$': push_LS(pc, LS_EXPRESSION_VAR_NAME_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '(': lexical_brackets_nestage++; RC; case '-': switch(*pc.source) { case 'f': // -f skip_analized=1; result=FEXISTS; goto break2; case 'd': // -d skip_analized=1; result=DEXISTS; goto break2; default: // minus result=c; goto break2; } goto break2; case '+': case '*': case '/': case '%': case '\\': case '~': case ';': RC; case '&': case '|': if(*pc.source==c) { // && || result=c=='&'?LAND:LOR; skip_analized=1; } else result=c; goto break2; case '!': switch(pc.source[0]) { case '|': // !| !|| skip_analized=1; if(pc.source[1]=='|') { skip_analized++; result=LXOR; } else result=NXOR; goto break2; case '=': // != skip_analized=1; result=NNE; goto break2; } RC; case '<': // <<, <=, < switch(*pc.source) { case '<': // <[<] skip_analized=1; result=NSL; break; case '=': // <[=] skip_analized=1; result=NLE; break; default: // <[] result=c; break; } goto break2; case '>': // >>, >=, > switch(*pc.source) { case '>': // >[>] skip_analized=1; result=NSR; break; case '=': // >[=] skip_analized=1; result=NGE; break; default: // >[] result=c; break; } goto break2; case '=': // == switch(*pc.source) { case '=': // =[=] skip_analized=1; result=NEQ; break; default: // =[] result=c; break; // not used now } goto break2; case '"': push_LS(pc, LS_EXPRESSION_STRING_QUOTED); RC; case '\'': push_LS(pc, LS_EXPRESSION_STRING_APOSTROFED); RC; case 'l': case 'g': case 'e': case 'n': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(*pc.source) { // case '?': // ok [and bad cases, yacc would bark at them] case 't': // lt gt [et nt] result=c=='l'?SLT:c=='g'?SGT:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'e': // le ge ne [ee] result=c=='l'?SLE:c=='g'?SGE:c=='n'?SNE:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'q': // eq [lq gq nq] result=c=='e'?SEQ:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; } } break; case 'i': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(pc.source[0]) { case 'n': // in skip_analized=1; result=IN; goto break2; case 's': // is skip_analized=1; result=IS; goto break2; } } break; case 'd': if(end==begin) // right after whitespace if(pc.source[0]=='e' && pc.source[1]=='f') { // def switch(pc.source[2]){ case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed skip_analized=2; result=DEF; goto break2; } // error: incorrect char after 'def' } break; case 't': if(end==begin) // right after whitespace if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true skip_analized=3; result=LITERAL_TRUE; goto break2; } break; case 'f': if(end==begin) // right after whitespace if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false skip_analized=4; result=LITERAL_FALSE; goto break2; } break; case ' ': case '\t': case '\n': if(end!=begin) { // there were a string after previous operator? result=0; // return that string goto break2; } // that's a leading|traling space or after-operator-space // ignoring it // reset piece 'begin' position & line begin=pc.source; // after whitespace char begin_pos=pc.pos; continue; } break; case LS_EXPRESSION_COMMENT: if(c=='(') lexical_brackets_nestage++; switch(*pc.source) { case '\n': case ')': if(*pc.source==')') if(--lexical_brackets_nestage!=0) continue; // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // VARIABLE GET/PUT/WITH case LS_VAR_NAME_SIMPLE_WITH_COLON: case LS_VAR_NAME_SIMPLE_WITHOUT_COLON: case LS_EXPRESSION_VAR_NAME_WITH_COLON: case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON: if( pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name in expr ends also before switch(c) { // expression minus case '-': // expression integer division case '\\': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } if( pc.ls==LS_VAR_NAME_SIMPLE_WITHOUT_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name already has ':', stop before next switch(c) { case ':': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } switch(c) { case 0: case ' ': case '\t': case '\n': case ';': case ']': case '}': case ')': case '"': case '\'': case '<': case '>': // these stand for HTML brackets AND expression binary ops case '+': case '*': case '/': case '\\': case '%': case '&': case '|': case '=': case '!': // common delimiters case ',': case '?': case '#': // mysql column separators case '`': // before call case '^': pop_LS(pc); pc.ungetc(); result=EON; goto break2; case '[': // $name.<[>code] if(pc.pos.col>1/*not first column*/ && ( end[-1]=='$'/*was start of get*/ || end[-1]==':'/*was class name delim */ || end[-1]=='.'/*was name delim */ )) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_VAR_SQUARE; lexical_brackets_nestage=1; RC; case '{': if(begin==end) { // ${name}, no need of EON, switching LS pc.ls=LS_VAR_NAME_CURLY; } else { pc.ls=LS_VAR_CURLY; lexical_brackets_nestage=1; } RC; case '(': pc.ls=LS_VAR_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // class<:>name // go to _WITHOUT_COLON state variant... if(pc.ls==LS_VAR_NAME_SIMPLE_WITH_COLON) pc.ls=LS_VAR_NAME_SIMPLE_WITHOUT_COLON; else if(pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON) pc.ls=LS_EXPRESSION_VAR_NAME_WITHOUT_COLON; // ...stop before next ':' RC; } break; case LS_VAR_NAME_CURLY: switch(c) { case '[': // ${name.<[>code]} push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; case '}': // ${name} finished, restoring LS pop_LS(pc); RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' RC; } break; case LS_VAR_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case ';': // operator_or_fmt;value delim RC; case '[': lexical_brackets_nestage++; break; } break; case LS_VAR_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '}': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case '{': lexical_brackets_nestage++; break; } break; // METHOD CALL case LS_METHOD_NAME: switch(c) { case '[': // ^name.<[>code].xxx if(pc.pos.col>1/*not first column*/ && ( end[-1]=='^'/*was start of call*/ || // never, ^[ is literal... end[-1]==':'/*was class name delim */ || end[-1]=='.'/*was name delim */ )) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; case '{': pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; case '(': pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' case '^': // ^abc^xxx wrong. bailing out case ']': case '}': case ')': // ^abc]}) wrong. bailing out case ' ': // ^if ( wrong. bailing out RC; } break; case LS_METHOD_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case ']': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '[': lexical_brackets_nestage++; break; } break; case LS_METHOD_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case '}': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '{': lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE; goto break2; } break; case LS_METHOD_AFTER: if(c=='[') {/* ][ }[ )[ */ pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; } if(c=='{') {/* ]{ }{ ){ */ pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; } if(c=='(') {/* ]( }( )( */ pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; } pop_LS(pc); pc.ungetc(); result=EON; goto break2; } if(c==0) { result=-1; break; } } break2: if(end!=begin) { // there is last piece? if(c=='@' || c==0) // we are before LS_DEF_NAME or EOF? while(end!=begin && end[-1]=='\n') // trim all empty lines before LS_DEF_NAME and EOF end--; if(end!=begin && pc.ls!=LS_USER_COMMENT) { // last piece still alive and not comment? if(!pc.string_start) pc.string_start=begin_pos; // append it pc.string.append_strdup_know_length(begin, end-begin); } } if(!pc.string.is_empty()) { // something accumulated? // create STRING value: array of OP_VALUE+origin+vstring *lvalp=VL( new VString(*new String(pc.string, String::L_CLEAN)), pc.file_no, pc.string_start.line, pc.string_start.col); // new pieces storage pc.string.clear(); pc.string_start.clear(); // make current result be pending for next call, return STRING for now pc.pending_state=result; result=STRING; } if(skip_analized) { pc.source+=skip_analized; pc.pos.col+=skip_analized; } return result; } static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error strncpy(PC.error, s, MAX_STRING); return 1; } static void yyprint(FILE *file, int type, YYSTYPE value) { if(type==STRING) fprintf(file, " \"%s\"", LA2S(*value)->cstr()); } parser-3.4.3/src/main/compile_tools.h000644 000000 000000 00000025235 12222644065 017662 0ustar00rootwheel000000 000000 /** @file Parser: compiler support helper functions decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef COMPILE_TOOLS #define COMPILE_TOOLS #define IDENT_COMPILE_TOOLS_H "$Id: compile_tools.h,v 1.105 2013/10/01 22:09:57 moko Exp $" #include "pa_opcode.h" #include "pa_types.h" #include "pa_vstring.h" #include "pa_request.h" /// used to track source column number #define TAB_SIZE 8 #define METHOD_CALL_TYPE_STATIC "static" #define METHOD_CALL_TYPE_DYNAMIC "dynamic" const String method_call_type_static(METHOD_CALL_TYPE_STATIC); const String method_call_type_dynamic(METHOD_CALL_TYPE_DYNAMIC); enum lexical_state { LS_USER, LS_NAME_SQUARE_PART, LS_USER_COMMENT, LS_DEF_NAME, LS_DEF_PARAMS, LS_DEF_LOCALS, LS_DEF_COMMENT, LS_DEF_SPECIAL_BODY, LS_EXPRESSION_STRING_QUOTED, LS_EXPRESSION_STRING_APOSTROFED, LS_EXPRESSION_VAR_NAME_WITH_COLON, LS_EXPRESSION_VAR_NAME_WITHOUT_COLON, LS_EXPRESSION_COMMENT, LS_VAR_NAME_SIMPLE_WITH_COLON, LS_VAR_NAME_SIMPLE_WITHOUT_COLON, LS_VAR_NAME_CURLY, LS_VAR_ROUND, LS_VAR_SQUARE, LS_VAR_CURLY, LS_METHOD_NAME, LS_METHOD_SQUARE, LS_METHOD_CURLY, LS_METHOD_ROUND, LS_METHOD_AFTER }; struct Pos { int line; int col; Pos(int aline, int acol): line(aline), col(acol) {} Pos(): line(0), col(0) {} void clear() { line=col=0; } operator bool() { return col!=0; } }; /// compiler status class Parse_control { const String* main_alias; uint last_line_end_col; public: const String& alias_method(const String& name); //@{ /// @name input Request& request; VStateless_class* cclass; VStateless_class* cclass_new; ArrayClass* cclasses; const char* source; uint file_no; Pos pos; //@} //@{ /// @name state; initially bool trim_bof; int pending_state; ///< i=0 String::Body string; ///< lexical string accumulator Pos string_start; #define MAX_LEXICAL_STATES 100 enum lexical_state ls; ///< =LS_USER; int ls_sp; ///< =0 enum lexical_state ls_stack[MAX_LEXICAL_STATES]; int brackets_nestages[MAX_LEXICAL_STATES]; ///< brackets nestage on each state bool in_call_value; bool explicit_result; bool append; //@} /// output: filled input 'methods' and 'error' if any char error[MAX_STRING]; Parse_control(Request& arequest, VStateless_class* aclass, const char* asource, const String* amain_alias, uint afile_no, int line_no_offset): main_alias(amain_alias), last_line_end_col(0), request(arequest), // input // we were told the class to compile to? cclass(aclass), // until changed with @CLASS would consider operators loading cclass_new(0), cclasses(new ArrayClass(1)), source(asource), file_no(afile_no), pos(line_no_offset, 0), // initialize state trim_bof(true), pending_state(0), ls(LS_USER), ls_sp(0), in_call_value(false), explicit_result(false), append(false) { *cclasses+=aclass; } /// true if exception should be rised bool class_add(){ if(cclass_new){ cclass=cclass_new; *cclasses+=cclass; cclass_new=0; append=false; // append to request's classes if(!request.allow_class_replace) return request.classes().put_dont_replace(cclass->name(), cclass) != 0; request.classes().put(cclass->name(), cclass); } return false; } VStateless_class* get_existed_class(VStateless_class* aclass){ // checking existence of the class during processing @OPTIONS\npartial // method should't use get_class because the last one will call operator @autouse[] if the class wasn't loaded if(aclass) if(Value* class_value=request.classes().get(aclass->name())) return class_value->get_class(); return 0; } bool reuse_existed_class(VStateless_class* aclass){ if(aclass->is_partial()){ cclass=aclass; cclass_new=0; append=true; return true; } else { return false; } } void set_all_vars_local(){ (cclass_new ? cclass_new : cclass)->set_all_vars_local(); } void set_methods_call_type(Method::Call_type call_type){ (cclass_new ? cclass_new : cclass)->set_methods_call_type(call_type); } Method::Call_type get_methods_call_type(){ return (cclass_new ? cclass_new : cclass)->get_methods_call_type(); } void pos_next_line() { pos.line++; last_line_end_col=pos.col; pos.col=0; } void pos_next_c(int c) { if(c=='\t') pos.col=(pos.col+TAB_SIZE)&~(TAB_SIZE-1); else pos.col++; } /// not precise in case of \t in the middle of the text void pos_prev_c() { if(pos.col==0) { --pos.line; pos.col=last_line_end_col; } else --pos.col; } void ungetc() { source--; pos_prev_c(); } }; /// New array // return empty array inline ArrayOperation* N() { return new ArrayOperation; } /// Assembler instruction // append ordinary instruction to ops inline void O(ArrayOperation& result, OP::OPCODE code) { result+=Operation(code); } /// aPpend 'code_array' to 'result' inline void P(ArrayOperation& result, ArrayOperation& code_array) { result.append(code_array); } /// aPpend part of 'code_array', starting from offset, to 'result' inline void P(ArrayOperation& result, ArrayOperation& code_array, int offset) { result.append(code_array, offset); } /// aPpend part of 'code_array', starting from offset, to 'result' inline void P(ArrayOperation& result, ArrayOperation& code_array, int offset, int limit) { result.append(code_array, offset, limit); } /// append cOde Array inline void OA(ArrayOperation& result, ArrayOperation* code_array) { result+=Operation(code_array); // append 'code_array' } inline void OA(ArrayOperation& result, OP::OPCODE code, ArrayOperation* code_array) { result+=Operation(code); // append OP_CODE result+=Operation(code_array); // append 'code_array' } /** Value Literal // returns array with - first op: OP_VALUE instruction - second op: origin (debug information) - third op: string itself */ inline ArrayOperation* VL(Value* value, uint file_no, uint line, uint col) { // empty ops array ArrayOperation& result=*N(); // append 'value' to 'result' result+=Operation(OP::OP_VALUE); result+=Operation(file_no, line, col); // append origin result+=Operation(value); // append 'value' return &result; } /// Literal Array to(2) Value @return Value from literal Array OP+origin+Value Value* LA2V(ArrayOperation& literal_string_array, int offset=0, OP::OPCODE code=OP::OP_VALUE); /// Literal Array to(2) String @return String value from literal Array OP+origin+String array inline const String* LA2S(ArrayOperation& literal_string_array, int offset=0, OP::OPCODE code=OP::OP_VALUE) { if(Value* value=LA2V(literal_string_array, offset, code)) return value->get_string(); return 0; } inline void change_string_literal_to_write_string_literal(ArrayOperation& literal_string_array) { literal_string_array.put(0, OP::OP_STRING__WRITE); } void maybe_change_string_literal_to_double_literal(ArrayOperation& literal_string_array); void change_string_literal_value(ArrayOperation& literal_string_array, const String& new_value); void changetail_or_append(ArrayOperation& opcodes, OP::OPCODE find, bool with_argument, OP::OPCODE replace, OP::OPCODE notfound); bool maybe_change_first_opcode(ArrayOperation& opcodes, OP::OPCODE find, OP::OPCODE replace); #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT // OP_VALUE+origin+value+OP_GET_ELEMENT+OP_VALUE+origin+value+OP_GET_ELEMENT => OP_GET_OBJECT_ELEMENT+origin+value+origin+value inline bool maybe_make_get_object_element(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t divine_count){ if(divine_count<8) return false; assert(diving_code[0].code==OP::OP_VALUE); if( diving_code[3].code==OP::OP_GET_ELEMENT && diving_code[4].code==OP::OP_VALUE && diving_code[7].code==OP::OP_GET_ELEMENT ){ O(opcodes, OP::OP_GET_OBJECT_ELEMENT); P(opcodes, diving_code, 1/*offset*/, 2/*limit*/); // copy first origin+value P(opcodes, diving_code, 5, 2); // second origin+value if(divine_count>8) P(opcodes, diving_code, 8/*offset*/); // tail return true; } return false; } #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT // OP_VALUE+origin+value+OP_GET_ELEMENT+OP_WITH_READ+OP_VALUE+origin+value+OP_GET_ELEMENT+OP_GET_ELEMENT => OP_GET_OBJECT_VAR_ELEMENT+origin+value+origin+value inline bool maybe_make_get_object_var_element(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t divine_count){ if(divine_count!=10) return false; assert(diving_code[0].code==OP::OP_VALUE); if( diving_code[3].code==OP::OP_GET_ELEMENT && diving_code[4].code==OP::OP_WITH_READ && diving_code[5].code==OP::OP_VALUE && diving_code[8].code==OP::OP_GET_ELEMENT && diving_code[9].code==OP::OP_GET_ELEMENT ){ O(opcodes, OP::OP_GET_OBJECT_VAR_ELEMENT); P(opcodes, diving_code, 1/*offset*/, 2/*limit*/); // copy first origin+value P(opcodes, diving_code, 6, 2); // second origin+value return true; } return false; } #endif bool maybe_make_self(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t divine_count); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT inline bool maybe_optimize_construct(ArrayOperation& opcodes, ArrayOperation& var_ops, ArrayOperation& expr_ops){ size_t expr_count=expr_ops.count(); OP::OPCODE construct_op=expr_ops[expr_count-1].code; size_t construct=(construct_op==OP::OP_CONSTRUCT_VALUE)?0x01:(construct_op==OP::OP_CONSTRUCT_EXPR)?0x02:0x00; if(construct){ P(opcodes, expr_ops, 0/*offset*/, expr_count-1/*limit*/); // copy constructor body without CONSTRUCT_(VALUE|EXPR) size_t with=0x00; switch(var_ops[0].code){ case OP::OP_WITH_ROOT: { with=0x10; break; } case OP::OP_WITH_WRITE: { with=0x20; break; } case OP::OP_WITH_SELF: { with=0x30; break; } } if(with && var_ops[1].code==OP::OP_VALUE && var_ops.count()==4){ OP::OPCODE code=OP::OP_VALUE; // calm down compiler. will be reassigned for sure. switch( with | construct ) { case 0x11: { code=OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE; break; } case 0x12: { code=OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR; break; } case 0x21: { code=OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE; break; } case 0x22: { code=OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR; break; } case 0x31: { code=OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE; break; } case 0x32: { code=OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR; break; } } O(opcodes, code); P(opcodes, var_ops, 2/*offset*/, 2/*limit*/); // copy origin+value } else { P(opcodes, var_ops); O(opcodes, construct_op); } return true; } return false; } #endif Method::Call_type GetMethodCallType(Parse_control& pc, ArrayOperation& literal_string_array); void push_LS(Parse_control& pc, lexical_state new_state); void pop_LS(Parse_control& pc); #endif parser-3.4.3/src/main/pa_random.C000644 000000 000000 00000006523 12173056751 016710 0ustar00rootwheel000000 000000 /** @file Parser: random related functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ // includes #include "pa_random.h" #include "pa_exception.h" #include "pa_threads.h" volatile const char * IDENT_PA_RANDOM_C="$Id: pa_random.C,v 1.5 2013/07/21 22:17:13 moko Exp $" IDENT_PA_RANDOM_H; #ifdef _MSC_VER #include class Random_provider { HCRYPTPROV fhProv; void acquire() { SYNCHRONIZED; if(fhProv) return; if(!CryptAcquireContext(&fhProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) throw Exception(0, 0, "CryptAcquireContext failed"); } void release() { if(fhProv) CryptReleaseContext(fhProv, 0); } public: Random_provider(): fhProv(0) {} ~Random_provider() { release(); } void generate(void *buffer, size_t size) { acquire(); if(!CryptGenRandom(fhProv, size, (BYTE*)buffer)) throw Exception(0, 0, "CryptGenRandom failed"); } } random_provider; #else /// from gen_uuid.c static int get_random_fd(void) { struct timeval tv; static int fd = -2; int i; if (fd == -2) { gettimeofday(&tv, 0); fd = open("/dev/urandom", O_RDONLY); if (fd == -1) fd = open("/dev/random", O_RDONLY | O_NONBLOCK); srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); } /* Crank the random number generator a few times */ gettimeofday(&tv, 0); for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) rand(); return fd; } /* * Generate a series of random bytes. Use /dev/urandom if possible, * and if not, use srandom/random. */ static void get_random_bytes(void *buf, int nbytes) { int i, fd = get_random_fd(); int lose_counter = 0; char *cp = (char *) buf; if (fd >= 0) { while (nbytes > 0) { i = read(fd, cp, nbytes); if (i <= 0) { if (lose_counter++ > 16) break; continue; } nbytes -= i; cp += i; lose_counter = 0; } } /* XXX put something better here if no /dev/random! */ for (i = 0; i < nbytes; i++) *cp++ = rand() & 0xFF; return; } #endif void random(void *buffer, size_t size) { #ifdef _MSC_VER random_provider.generate(buffer, size); #else get_random_bytes(buffer, size); #endif } uuid get_uuid() { // random uuid uuid; random(&uuid, sizeof(uuid)); // http://www.opengroup.org/onlinepubs/9629399/apdxa.htm#tagtcjh_35 // ~ // version = DCE Security version, with embedded POSIX UIDs. // variant = DCE // // DCE=Distributed Computing Environment // http://www.opengroup.org/dce/ // // they say this influences comparison&such, // but could not figure out how, hence structure layout specified strictly // anyhow, uuidgen on Win32 yield those values // // xxxxxxxx-xxxx-4xxx-{8,9,A,B}xxx-xxxxxxxxxxxx uuid.clock_seq = (uuid.clock_seq & 0x3FFF) | 0x8000; uuid.time_hi_and_version = (uuid.time_hi_and_version & 0x0FFF) | 0x4000; return uuid; } parser-3.4.3/src/main/pa_globals.C000644 000000 000000 00000020634 12176037677 017063 0ustar00rootwheel000000 000000 /** @file Parser: globals. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "libxml/xmlversion.h" #include "libxslt/extensions.h" #include "libxslt/xsltutils.h" extern "C" { #include "libexslt/exslt.h" }; #endif #include "pa_globals.h" #include "pa_string.h" #include "pa_sapi.h" #include "pa_threads.h" #include "pa_xml_io.h" #include "pa_common.h" #include "pa_cache_managers.h" #include "ltdl.h" #include "pcre.h" volatile const char * IDENT_PA_GLOBALS_C="$Id: pa_globals.C,v 1.191 2013/07/30 22:35:43 moko Exp $" IDENT_PA_GLOBALS_H IDENT_PA_SAPI_H; // defines //#define PA_DEBUG_XML_GC_MEMORY //20051130 trying to remove this, author claims that fixed a lot there // 20040920 for now both workarounds needed. wait for new libxml/xsl versions // // there is a problem with testcase, it's unstable. // // see paf@six/bug20040920/cgi-bin/t for it-showed-bug-on-20040920-day // #define PA_WORKAROUND_BUGGY_FREE_IN_LIBXML_GC_MEMORY // #define PA_WORKAROUND_BUGGY_MALLOCATOMIC_IN_LIBXML_GC_MEMORY // globals short hex_value[0x100]; static void setup_hex_value() { memset(hex_value, 0, sizeof(hex_value)); hex_value['0'] = 0; hex_value['1'] = 1; hex_value['2'] = 2; hex_value['3'] = 3; hex_value['4'] = 4; hex_value['5'] = 5; hex_value['6'] = 6; hex_value['7'] = 7; hex_value['8'] = 8; hex_value['9'] = 9; hex_value['A'] = 10; hex_value['B'] = 11; hex_value['C'] = 12; hex_value['D'] = 13; hex_value['E'] = 14; hex_value['F'] = 15; hex_value['a'] = 10; hex_value['b'] = 11; hex_value['c'] = 12; hex_value['d'] = 13; hex_value['e'] = 14; hex_value['f'] = 15; } THREAD_LOCAL Request* thread_request=NULL; void pa_register_thread_request(Request& r) { thread_request=&r; } /// retrives request set by pa_set_request function, useful in contextless places [slow] Request& pa_thread_request() { return *thread_request; } #ifdef XML class XML_Generic_error_info { public:/*internal, actually*/ char buf[MAX_STRING*5]; size_t used; public: XML_Generic_error_info() { buf[used=0]=0; } const char* get() { return used? buf: 0; } }; THREAD_LOCAL XML_Generic_error_info* xml_generic_error_info = NULL; static void xmlParserGenericErrorFunc(void * /*ctx*/, const char* msg, ...) { XML_Generic_error_info* p; if(!(p=xml_generic_error_info)) // occupy empty one p=xml_generic_error_info=new(PointerFreeGC) XML_Generic_error_info; va_list args; va_start(args, msg); p->used+=vsnprintf(p->buf+p->used, sizeof(p->buf)-p->used, msg, args); va_end(args); } bool xmlHaveGenericErrors() { return xml_generic_error_info!=0; } const char* xmlGenericErrors() { if(XML_Generic_error_info *p=xml_generic_error_info) { xml_generic_error_info=0; return p->get(); } return 0; // no errors for our thread_id registered } #endif #ifdef XML static char *pa_GC_strdup(const char *s) { if(!s) return 0; size_t size=strlen(s)+1; char *result=(char *)pa_gc_malloc_atomic(size); if(!result) pa_fail_alloc("duplicate XML string",size); memcpy(result, s, size); #ifdef PA_DEBUG_XML_GC_MEMORY fprintf(stderr, "pa_GC_strdup(%p=%s, length=%d)=0x%p\n", s, s, size, result); #endif return result; } #ifdef PA_DEBUG_XML_GC_MEMORY static void* pa_gc_malloc_log(size_t size){ void *p=pa_gc_malloc(size); fprintf(stderr, "pa_gc_malloc_log(%d)=0x%p\n", size, p); return p; } static void* pa_gc_malloc_atomic_log(size_t size){ void *p=pa_gc_malloc_atomic(size); fprintf(stderr, "pa_gc_malloc_atomic_log(%d)=0x%p\n", size, p); return p; } static void* pa_gc_realloc_log(void *ptr, size_t size){ void *p=pa_gc_realloc(ptr, size); fprintf(stderr, "pa_gc_realloc_log(0x%p, %d)=0x%p\n", ptr, size, p); return p; } static void pa_gc_free_log(void *p){ fprintf(stderr, "pa_gc_free_log(0x%p)\n", p); pa_gc_free(p); } #else inline void *check(void *result, const char *where, size_t size) { if(!result) pa_fail_alloc(where, size); return result; } static void* pa_gc_malloc_nonull(size_t size) { return check(pa_gc_malloc(size), "allocate XML compsite memory", size); } static void* pa_gc_malloc_atomic_nonull(size_t size) { return check(pa_gc_malloc_atomic(size), "allocate XML atomic memory", size); } static void* pa_gc_realloc_nonull(void* ptr, size_t size) { return check(pa_gc_realloc(ptr, size), "reallocate XML memory", size); } static void pa_gc_free_maybeignore(void* ptr) { pa_gc_free(ptr); } #endif #endif void pa_CORD_oom_fn(void) { pa_fail_alloc("expand string", 0); } /** @todo gc: libltdl: substitute lt_dlmalloc & co */ static void gc_substitute_memory_management_functions() { // in libxml & libxslt #ifdef XML // asking to use GC memory #ifdef PA_DEBUG_XML_GC_MEMORY xmlGcMemSetup( /*xmlFreeFunc */pa_gc_free_log, /*xmlMallocFunc */pa_gc_malloc_log, /*xmlMallocFunc */pa_gc_malloc_atomic_log, /*xmlReallocFunc */pa_gc_realloc_log, /*xmlStrdupFunc */pa_GC_strdup); #else xmlGcMemSetup( /*xmlFreeFunc */pa_gc_free_maybeignore, /*xmlMallocFunc */pa_gc_malloc_nonull, /*xmlMallocFunc */pa_gc_malloc_atomic_nonull, /*xmlReallocFunc */pa_gc_realloc_nonull, /*xmlStrdupFunc */pa_GC_strdup); #endif #endif // pcre pcre_malloc=pa_gc_malloc; pcre_free=pa_gc_free; // cord CORD_oom_fn=pa_CORD_oom_fn; } /** @test hint on one should call this for each thread xmlSubstituteEntitiesDefault(1); */ void pa_globals_init() { // global variables cache_managers=new Cache_managers; // in various libraries gc_substitute_memory_management_functions(); // hex value setup_hex_value(); #ifdef XML // initializing xml libs // Register the EXSLT extensions and the test module exsltRegisterAll(); xsltRegisterTestModule(); xmlDefaultSAXHandlerInit(); // disable CDATA from being built in the document tree // never added yet xmlDefaultSAXHandler.cdataBlock = NULL; // Initialization function for the XML parser. This is not reentrant. // Call once before processing in case of use in multithreaded programs. xmlInitParser(); // 1. this is needed for proper parsing of stylesheets // there were a situation where honest entity ruined innocent xpath compilation // doc says "you sould turn it on on stylesheet load" without deepening into details // 2. when dom tree with entites goes under transform text nodes // got [erroreosly] cut on first entity occurance // -- // that is why this is: xmlSubstituteEntitiesDefault(1); // Bit in the loadsubset context field to tell to do ID/REFs lookups xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; // Bit in the loadsubset context field to tell to do complete the elements attributes lists // with the ones defaulted from the DTDs xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; // validate each document after load/create (?) // xmlDoValidityCheckingDefaultValue = 1; // regretfully this not only replaces entities on parse, but also on generate xmlSubstituteEntitiesDefault(1); // never switched this on xmlIndentTreeOutput=1; xmlSetGenericErrorFunc(0, xmlParserGenericErrorFunc); xsltSetGenericErrorFunc(0, xmlParserGenericErrorFunc); // FILE *f=fopen("y:\\xslt.log", "wt"); // xsltSetGenericDebugFunc(f/*stderr*/, 0); pa_xml_io_init(); #endif } static bool is_dlinited=false; void pa_globals_done() { delete cache_managers; cache_managers=0; if(is_dlinited) lt_dlexit(); } void pa_dlinit() { if(!is_dlinited){ if(lt_dlinit()) throw Exception(0,0,"prepare to dynamic libary loading failed, %s", lt_dlerror()); is_dlinited=true; } } #ifdef _MSC_VER #ifndef PA_DEBUG_DISABLE_GC #define GC_LIB "../../../../win32/gc" #ifdef _DEBUG #pragma comment(lib, GC_LIB "/Debug/gc.lib") #else #pragma comment(lib, GC_LIB "/Release/gc.lib") #endif #endif #ifdef XML #define GNOME_LIBS "../../../../win32/gnome" #ifdef _DEBUG #define LIB_XML GNOME_LIBS "/libxml2-x.x.x/win32/debug/lib/" #define LIB_XSLT GNOME_LIBS "/libxslt-x.x.x/win32/debug/lib/" #else #define LIB_XML GNOME_LIBS "/libxml2-x.x.x/win32/release/lib/" #define LIB_XSLT GNOME_LIBS "/libxslt-x.x.x/win32/release/lib/" #endif #ifdef LIBXML_STATIC #pragma comment(lib, LIB_XML "libxml2_a.lib") #else #pragma comment(lib, LIB_XML "libxml2.lib") #endif #ifdef LIBXSLT_STATIC #pragma comment(lib, LIB_XSLT "libxslt_a.lib") #else #pragma comment(lib, LIB_XSLT "libxslt.lib") #endif #ifdef LIBEXSLT_STATIC #pragma comment(lib, LIB_XSLT "libexslt_a.lib") #else #pragma comment(lib, LIB_XSLT "libexslt.lib") #endif #endif #endif parser-3.4.3/src/main/pa_table.C000644 000000 000000 00000004504 12145041506 016503 0ustar00rootwheel000000 000000 /** @file Parser: table class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_table.h" volatile const char * IDENT_PA_TABLE_C="$Id: pa_table.C,v 1.64 2013/05/16 02:24:06 misha Exp $" IDENT_PA_TABLE_H; #include "pa_exception.h" Table::Table(columns_type acolumns, size_t initial_rows): Array(initial_rows), fcurrent(0), fcolumns(acolumns), name2number(new name2number_hash_class) { if(fcolumns) { size_t number=1; for(Array_iterator i(*fcolumns); i.has_next(); ) { const String& name=*i.next(); name2number->put(name, number++); } } } Table::Table(const Table& src, Action_options& options) : Array(options.limit==ARRAY_OPTION_LIMIT_ALL?0:(options.limit < src.count())?options.limit:src.count()), fcurrent(0), fcolumns(src.fcolumns), name2number(src.name2number) { append(src, options.offset, options.limit, options.reverse); } int Table::column_name2index(const String& column_name, bool bark) const { if(fcolumns) {// named int result=name2number->get(column_name)-1; // -1 = column not found if(bark && result<0) throw Exception(PARSER_RUNTIME, &column_name, "column not found"); return result; } else // nameless return column_name.as_int(); } const String* Table::item(size_t column) { if(valid(fcurrent)) { element_type row=get(fcurrent); if(columncount()) // proper index? return row->get(column); } return 0; // it's OK we don't have row|column, just return nothing } #ifndef DOXYGEN struct Locate_int_string_info { int column; const String* value; }; #endif bool locate_int_string(Table& self, Locate_int_string_info* info) { const String *item_value=self.item(info->column); return item_value && *item_value==*info->value; } bool Table::locate(int column, const String& value, Table::Action_options& options) { Locate_int_string_info info={column, &value}; return table_first_that(locate_int_string, &info, options); } bool Table::locate(const String& column, const String& value, Table::Action_options& options) { return locate(column_name2index(column, true), value, options); } void Table::offset(bool absolute, int offset) { if(size_t lcount=count()) fcurrent=((absolute?0:fcurrent)+offset+lcount)%lcount; } parser-3.4.3/src/main/pa_exception.C000644 000000 000000 00000002372 12171260600 017410 0ustar00rootwheel000000 000000 /** @file Parser: exception class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_common.h" #include "pa_exception.h" #include "pa_sapi.h" #include "pa_globals.h" volatile const char * IDENT_PA_EXCEPTION_C="$Id: pa_exception.C,v 1.51 2013/07/16 15:06:40 moko Exp $" IDENT_PA_EXCEPTION_H; // methods Exception::Exception(): ftype(0), fproblem_source(0), fcomment(0) {} Exception::Exception(const Exception& src): ftype(src.ftype), fproblem_source(src.fproblem_source), fcomment(src.fcomment) { } Exception& Exception::operator =(const Exception& src) { ftype=src.ftype; fproblem_source=src.fproblem_source; fcomment=src.fcomment; return *this; } Exception::Exception(const char* atype, const String* aproblem_source, const char* comment_fmt, ...) { ftype=atype; fproblem_source=aproblem_source; if(comment_fmt) { fcomment=new(PointerFreeGC) char[MAX_STRING]; va_list args; va_start(args, comment_fmt); vsnprintf((char *)fcomment, MAX_STRING, comment_fmt, args); va_end(args); } else fcomment=0; } const String* Exception::problem_source() const { return fproblem_source && !fproblem_source->is_empty()?fproblem_source:0; } parser-3.4.3/src/main/pa_xml_io.C000644 000000 000000 00000015205 11730603276 016712 0ustar00rootwheel000000 000000 /** @file Parser: plugins to xml library, controlling i/o; implementation Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_xml_io.h" #ifdef XML volatile const char * IDENT_PA_XML_IO_C="$Id: pa_xml_io.C,v 1.28 2012/03/16 09:24:14 moko Exp $" IDENT_PA_XML_IO_H; #include "libxslt/extensions.h" #include "pa_threads.h" #include "pa_globals.h" #include "pa_request.h" THREAD_LOCAL HashStringBool* xml_dependencies = NULL; static void add_dependency(const String::Body url) { if(xml_dependencies) // do we need to monitor now? xml_dependencies->put(url, true); } void pa_xmlStartMonitoringDependencies() { xml_dependencies=new HashStringBool; } void pa_xmlStopMonitoringDependencies() { xml_dependencies=NULL; } HashStringBool* pa_xmlGetDependencies() { HashStringBool* result=xml_dependencies; xml_dependencies=NULL; return result; } #ifndef DOXYGEN struct MemoryStream { const char* m_buf; size_t m_size; size_t m_position; int read(char* a_buffer, size_t a_size) { size_t left=m_size-m_position; if(!left) return 0; size_t to_read=min(a_size, left); memcpy(a_buffer, m_buf+m_position, to_read); m_position+=to_read; return to_read; } }; #endif static void * xmlFileOpen_ReadIntoStream (const char* do_not_store_filename, bool adjust_path_to_root_from_document_root=false) { #ifdef PA_SAFE_MODE //copied from libxml/catalog.c # define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" // disable attempts to consult default catalog [usually, that file belongs to other user/group] if(strcmp(do_not_store_filename, XML_XML_DEFAULT_CATALOG)==0) return 0; #endif Request& r=pa_thread_request(); char adjust_buf[MAX_STRING]; if(adjust_path_to_root_from_document_root) { const char* document_root=r.request_info.document_root; if(!document_root) document_root="."; adjust_buf[0]=0; strcat(adjust_buf, document_root); strcat(adjust_buf, &do_not_store_filename[16]); do_not_store_filename=adjust_buf; } else if(!strstr(do_not_store_filename, "http://")) if(strstr(do_not_store_filename, "file://")){ do_not_store_filename+=7/*strlen("file://")*/; #ifdef WIN32 if( do_not_store_filename[0]=='/' && do_not_store_filename[1] && do_not_store_filename[2]==':' && do_not_store_filename[3]=='/' ){ // skip leading slash for absolute path file:///C:/path/to/file do_not_store_filename++; } #endif } else if(*do_not_store_filename && do_not_store_filename[1]!=':' && strstr(do_not_store_filename, "://")) { pa_xmlStopMonitoringDependencies(); return 0; // plug out [do not handle other prefixes] } const char* can_store_filename=pa_strdup(do_not_store_filename); add_dependency(can_store_filename); const char *buf; try { buf=file_load_text(r, *new String(can_store_filename), true/*fail_on_read_problem*/, 0/*params*/, false/*don't transcode result because it must be fit with @encoding value!*/); } catch(const Exception& e) { if(strcmp(e.type(), "file.missing")==0) return 0; // let the library try that and report an error properly buf=e.comment(); } catch(...) { buf="xmlFileOpen_ReadIntoStream: unknown error"; } MemoryStream* stream=new(UseGC) MemoryStream; stream->m_buf=buf; stream->m_size=strlen(buf); return (void *)stream; } static int xmlFileMatchMonitor(const char* /*file_spec_cstr*/) { return 1; // always intercept, causing xmlFileOpenMonitor to be called } static void * xmlFileOpenMonitor(const char* filename) { return xmlFileOpen_ReadIntoStream(filename); // handles localfile case, else returns 0 } /** * xmlFileMatchWithLocalhostEqDocumentRoot: * filename: the URI for matching * * check if the URI matches an HTTP one * * Returns 1 if matches, 0 otherwise */ static int xmlFileMatchLocalhost(const char* filename) { if (!strncmp(filename, "http://localhost", 16)) return(1); return(0); } /** * xmlFileOpenLocalhost: * filename: the URI for matching * * http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc * * Returns an I/O context or NULL in case of error */ static void * xmlFileOpenLocalhost (const char* filename) { return xmlFileOpen_ReadIntoStream(filename, true/*adjust path to root from document_root*/); } static int xmlFileMatchMethod(const char* filename) { if (!strncmp(filename, "parser://", 9 /*strlen("parser://"), and check xmlFileOpenMethod*/)) return(1); return(0); } /// parser://method/param/here -> ^MAIN:method[/params/here] static void * xmlFileOpenMethod (const char* afilename) { const char* buf; try { Request& r=pa_thread_request(); char* s=pa_strdup(afilename+9 /*strlen("parser://")*/); const char* method_cstr=lsplit(&s, '/'); const String* method=new String(method_cstr); String::Body param_body("/"); if(s) param_body.append_know_length(s, strlen(s)); VString* vparam=new VString(*new String(param_body, String::L_TAINTED)); { Temp_lang temp_lang(r, String::L_XML); // default language: XML Request::Execute_nonvirtual_method_result body= r.execute_nonvirtual_method(r.main_class, *method, vparam, true); if(body.string) { buf=body.string->untaint_cstr(r.flang); } else throw Exception(0, new String(afilename), "'%s' method not found in %s class", method_cstr, MAIN_CLASS_NAME); } } catch(const Exception& e) { buf=e.comment(); } catch(...) { buf="xmlFileOpenLocalhost: unknown error"; } MemoryStream* stream=new(UseGC) MemoryStream; stream->m_buf=buf; stream->m_size=strlen(buf); return (void *)stream; } /** * pa_xmlFileReadMethod: * @context: the I/O context * @buffer: where to drop data * @len: number of bytes to write * * Read @len bytes to @buffer from the I/O channel. * * Returns the number of bytes written */ static int pa_xmlFileReadMethod (void * context, //< MemoryStream actually char * buffer, int len) { MemoryStream& stream=*static_cast(context); return stream.read(buffer, len); } static int pa_xmlFileCloseMethod (void * /*context*/) { return 0; } void pa_xml_io_init() { // file open monitorer [for xslt cacher] // safe mode checker, always fail match, but checks non-"://" there xmlRegisterInputCallbacks( xmlFileMatchMonitor, xmlFileOpenMonitor, pa_xmlFileReadMethod, pa_xmlFileCloseMethod); // http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc xmlRegisterInputCallbacks( xmlFileMatchLocalhost, xmlFileOpenLocalhost, pa_xmlFileReadMethod, pa_xmlFileCloseMethod); // parser://method/param/here -> ^MAIN:method[/params/here] xmlRegisterInputCallbacks( xmlFileMatchMethod, xmlFileOpenMethod, pa_xmlFileReadMethod, pa_xmlFileCloseMethod); } #endif parser-3.4.3/src/main/pa_exec.C000644 000000 000000 00000026270 12173314667 016360 0ustar00rootwheel000000 000000 /** @file Parser: program executing for different OS-es. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) @todo setrlimit */ #include "pa_config_includes.h" #include "pa_exec.h" #include "pa_exception.h" #include "pa_common.h" volatile const char * IDENT_PA_EXEC_C="$Id: pa_exec.C,v 1.84 2013/07/22 20:44:39 moko Exp $" IDENT_PA_EXEC_H; #ifdef _MSC_VER #include /// this func from http://www.ccas.ru/~posp/popov/spawn.htm static DWORD CreateHiddenConsoleProcess(LPCTSTR szCmdLine, LPCTSTR szScriptFileSpec, char *szEnv, PROCESS_INFORMATION* ppi, LPHANDLE phInWrite, LPHANDLE phOutRead, LPHANDLE phErrRead) { DWORD result=0; BOOL fCreated; STARTUPINFO si; SECURITY_ATTRIBUTES sa={0}; HANDLE hInRead; HANDLE hOutWrite; HANDLE hErrWrite; // Create pipes // initialize security attributes for handle inheritance (for WinNT) sa.nLength=sizeof(sa); sa.bInheritHandle=TRUE; sa.lpSecurityDescriptor=NULL; // create STDIN pipe if(!CreatePipe(&hInRead, phInWrite, &sa, 0)) goto error; // create STDOUT pipe if(!CreatePipe(phOutRead, &hOutWrite, &sa, 0)) goto error; // create STDERR pipe if(!CreatePipe(phErrRead, &hErrWrite, &sa, 0)) goto error; // process startup information memset(&si, 0, sizeof(si)); si.cb=sizeof(si); si.dwFlags=STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; // child process' console must be hidden for Win95 compatibility si.wShowWindow=SW_HIDE; // assign "other" sides of pipes si.hStdInput=hInRead; si.hStdOutput=hOutWrite; si.hStdError=hErrWrite; // calculating script's directory char dir[MAX_STRING]; strncpy(dir, szScriptFileSpec, MAX_STRING-1); dir[MAX_STRING-1]=0; lsplit(dir,' '); // trim arguments rsplit(dir,'/'); rsplit(dir,'\\'); // trim filename // Create a child process (suspended) fCreated=CreateProcess(NULL, (LPTSTR)szCmdLine, NULL, NULL, TRUE, CREATE_NO_WINDOW, szEnv, dir, &si, ppi); if(!fCreated) result=GetLastError(); CloseHandle(hInRead); CloseHandle(hOutWrite); CloseHandle(hErrWrite); if(!fCreated) goto error; return result; error: if(!result/*yet*/) result=GetLastError(); // get it CloseHandle(*phInWrite); CloseHandle(*phOutRead); CloseHandle(*phErrRead); return result; } static void read_pipe(String& result, HANDLE hOutRead, String::Language lang){ while(true) { char *buf=new(PointerFreeGC) char[MAX_STRING+1]; DWORD size=0; if(!ReadFile(hOutRead, buf, MAX_STRING, &size, NULL) || !size) break; buf[size]=0; result.append_know_length(buf, size, lang); } } static void read_pipe(File_read_result& result, HANDLE hOutRead){ char *buf=(char*)pa_malloc(MAX_STRING+1); DWORD bufsize = MAX_STRING; result.headers = 0; result.length = 0; result.str = 0; result.success = false; while(true) { DWORD size=0; if(!ReadFile(hOutRead, buf + result.length, bufsize - result.length, &size, NULL) || !size) break; result.length += size; if(result.length >= bufsize){ bufsize *= 2; buf=(char*)pa_realloc(buf, bufsize+1); } result.str=buf; } } static const char* buildCommand(const char* file_spec_cstr, const ArrayString& argv) { const char* result=file_spec_cstr; if(FILE *f=fopen(file_spec_cstr, "r")) { try { char buf[MAX_STRING]; size_t size=fread(buf, 1, MAX_STRING-1, f); if(size>2) { buf[size]=0; if(strncmp(buf, "#!", 2)==0) { const char* begin=buf+2; while(*begin==' ') // alx: were an old magic for some linux-es begin++; if(const char *end=strchr(begin, '\n')) { String string(pa_strdup(begin, end-begin)); string << " " << file_spec_cstr; result=string.cstr(); } } } } catch(...) { fclose(f); rethrow; } fclose(f); } { // appending argv String string(result); for(size_t i=0; i= bufsize){ bufsize *= 2; buf=(char*)pa_realloc(buf, bufsize+1); } result.str=buf; } } #endif #ifndef DOXYGEN struct Append_env_pair_info { #ifdef _MSC_VER String::Body& body; Append_env_pair_info(String::Body& abody): body(abody) {} #else char **env_ref; #endif }; #endif ///@test maybe here and at argv construction --- untaint_cstr(String::L_AS_IS static void append_env_pair(HashStringString::key_type key, HashStringString::value_type value, Append_env_pair_info *info) { #ifdef _MSC_VER info->body << key << "=" << value; info->body.append_know_length("\1", 1); // placeholder for of zero byte #else String::Body body; body << key << "=" << value.cstr(); *(info->env_ref++)=body.cstrm(); #endif } PA_exec_result pa_exec( bool forced_allow, const String& file_spec, const HashStringString* env, const ArrayString& argv, String& in) { PA_exec_result result; #ifdef NO_PA_EXECS if(!forced_allow) throw Exception(PARSER_RUNTIME, &file_spec, "parser execs are disabled [recompile parser without --disable-execs configure option]"); #endif #ifdef _MSC_VER PROCESS_INFORMATION pi; HANDLE hInWrite, hOutRead, hErrRead; const char* script_spec_cstr=file_spec.taint_cstr(String::L_FILE_SPEC); const char* cmd=buildCommand(script_spec_cstr, argv); char* env_cstr=0; if(env) { String::Body body; Append_env_pair_info info(body); env->for_each(append_env_pair, &info); env_cstr=info.body.cstrm(); for(char* replacer=env_cstr; *replacer; replacer++) if(*replacer=='\1') *replacer=0; } if(DWORD error=CreateHiddenConsoleProcess(cmd, script_spec_cstr, env_cstr, &pi, &hInWrite, &hOutRead, &hErrRead)) { char szErrorDesc[MAX_STRING]; const char* param="the file you tried to run"; size_t error_size=FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ARGUMENT_ARRAY , NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), szErrorDesc, sizeof(szErrorDesc), (va_list *)¶m); if(error_size>3) // ".\r\n" szErrorDesc[error_size-3]=0; throw Exception("file.execute", &file_spec, "exec failed - %s (%u). Consider adding shbang line (#!x:\\interpreter\\command line)", error_size?szErrorDesc:"", error); } else { const char* in_cstr=in.cstr(); DWORD written_size; WriteFile(hInWrite, in_cstr, in.length(), &written_size, NULL); // EOF for stupid text reads // normally they should read CONTENT_LENGTH bytes, // without this char WriteFile(hInWrite, "\x1A", 1, &written_size, NULL); CloseHandle(hInWrite); read_pipe(result.out, hOutRead); CloseHandle(hOutRead); read_pipe(result.err, hErrRead, String::L_TAINTED); CloseHandle(hErrRead); // We must close the handles to the new process and its main thread // to prevent handle and memory leaks. CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } #else // execve needs non const char* file_spec_cstr=file_spec.taint_cstrm(String::L_FILE_SPEC); int pipe_write, pipe_read, pipe_err; if(!forced_allow) { struct stat finfo; if(stat(file_spec_cstr, &finfo)!=0) throw Exception("file.missing", &file_spec, "stat failed: %s (%d), actual filename '%s'", strerror(errno), errno, file_spec_cstr); check_safe_mode(finfo, file_spec, file_spec_cstr); } char* argv_cstrs[1+100+1]={file_spec_cstr, 0}; const int argv_size=argv.count(); const int argv_max=sizeof(argv_cstrs)/sizeof(argv_cstrs[0])-1-1; if(argv_size>argv_max) throw Exception(PARSER_RUNTIME, &file_spec, "too many arguments (%d > max %d)", argv_size, argv_max); for(int i=0; icstrm(); argv_cstrs[1+argv_size]=0; char **env_cstrs; if(env) { env_cstrs=new(PointerFreeGC) char *[env->count()+1/*0*/]; Append_env_pair_info info={env_cstrs}; env->for_each(append_env_pair, &info); *info.env_ref=0; } else env_cstrs=0; pid_t pid=execve_piped( file_spec_cstr, argv_cstrs, env_cstrs, &pipe_write, &pipe_read, &pipe_err); if(pid>0) { // in child if(!in.is_empty()) {// there is some in data const char* in_cstr=in.cstr(); write(pipe_write, in_cstr, in.length()); } close(pipe_write); read_pipe(result.out, pipe_read); close(pipe_read); read_pipe(result.err, pipe_err, String::L_TAINTED); close(pipe_err); result.status=get_exit_status(pid); // negative may mean "-errno[execl()]" } else { const char* str=strerror(errno); throw Exception("file.execute", &file_spec, "%s error: %s (%d)", pid<0?"fork":"pipe", str?str:"", errno); } #endif return result; } parser-3.4.3/src/main/pa_string.C000644 000000 000000 00000062667 12171262342 016742 0ustar00rootwheel000000 000000 /** @file Parser: string class. @see untalength_t.C. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_string.h" #include "pa_exception.h" #include "pa_table.h" #include "pa_dictionary.h" #include "pa_charset.h" #include "pa_vregex.h" volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.244 2013/07/16 15:21:06 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; // pa_atoui is based on Manuel Novoa III _strto_l for uClibc unsigned int pa_atoui(const char *str, int base, const String* problem_source){ unsigned int result = 0; const char *pos = str; while (isspace(*pos)) /* skip leading whitespace */ ++pos; if (base == 16 && *pos == '0') { /* handle option prefix */ ++pos; if (*pos == 'x' || *pos == 'X') { ++pos; } } if (base == 0) { /* dynamic base */ base = 10; /* default is 10 */ if (*pos == '0') { ++pos; if (*pos == 'x' || *pos == 'X') ++pos; base=16; } } if (base < 2 || base > 16) { /* illegal base */ throw Exception(PARSER_RUNTIME, 0, "base to must be an integer from 2 to 16"); } unsigned int cutoff = UINT_MAX / base; int cutoff_digit = UINT_MAX - cutoff * base; while(true) { int digit; if ((*pos >= '0') && (*pos <= '9')) { digit = (*pos - '0'); } else if (*pos >= 'a') { digit = (*pos - 'a' + 10); } else if (*pos >= 'A') { digit = (*pos - 'A' + 10); } else break; if (digit >= base) { break; } ++pos; /* adjust number, with overflow check */ if ((result > cutoff) || ((result == cutoff) && (digit > cutoff_digit))) { throw Exception("number.format", problem_source, problem_source ? "out of range (int)" : "'%s' is out of range (int)", str); } else { result = result * base + digit; } } while(char c=*pos++) if(!isspace(c)) throw Exception("number.format", problem_source, problem_source ? "invalid number (int)" : "'%s' is invalid number (int)", str); return result; } int pa_atoi(const char* str, const String* problem_source) { if(!str) return 0; while(isspace(*str)) str++; if(!*str) return 0; bool negative=false; if(str[0]=='-') { negative=true; str++; } else if(str[0]=='+') { str++; } unsigned int result=pa_atoui(str, 0, problem_source); if(negative && result <= ((unsigned int)(-(1+INT_MIN)))+1) return -(int)result; if(result<=INT_MAX) return (int)result; throw Exception("number.format", problem_source, problem_source ? "out of range (int)" : "'%s' is out of range (int)", str); } double pa_atod(const char* str, const String* problem_source) { if(!str) return 0; while(isspace(*str)) str++; if(!*str) return 0; bool negative=false; if(str[0]=='-') { negative=true; str++; } else if(str[0]=='+') { str++; } double result; if(str[0]=='0') if(str[1]=='x' || str[1]=='X'){ // 0xABC result=(double)pa_atoui(str, 0, problem_source); return negative ? -result : result; } else { // skip leading 0000, to disable octal interpretation do str++; while(*str=='0'); } char *error_pos; result=strtod(str, &error_pos); while(char c=*error_pos++) if(!isspace((unsigned char)c)) throw Exception("number.format", problem_source, problem_source ? "invalid number (double)" : "'%s' is invalid number (double)", str); return negative ? -result : result; } // cord lib extension #ifndef DOXYGEN typedef struct { ssize_t countdown; int target; /* Character we're looking for */ } chr_data; #endif static int CORD_range_contains_chr_greater_then_proc(char c, size_t size, void* client_data) { register chr_data * d = (chr_data *)client_data; if (d -> countdown<=0) return(2); d -> countdown -= size; if (c > d -> target) return(1); return(0); } int CORD_range_contains_chr_greater_then(CORD x, size_t i, size_t n, int c) { chr_data d; d.countdown = n; d.target = c; return(CORD_block_iter(x, i, CORD_range_contains_chr_greater_then_proc, &d) == 1/*alternatives: 0 normally ended, 2=struck 'n'*/); } static int CORD_block_count_proc(char /*c*/, size_t /*size*/, void* client_data) { int* result=(int*)client_data; (*result)++; return(0); // 0=continue } size_t CORD_block_count(CORD x) { size_t result=0; CORD_block_iter(x, 0, CORD_block_count_proc, &result); return result; } // helpers /// String::match uses this as replace & global search table columns const int MAX_MATCH_GROUPS=100; class String_match_table_template_columns: public ArrayString { public: String_match_table_template_columns() { *this+=new String("prematch"); *this+=new String("match"); *this+=new String("postmatch"); for(int i=0; iisUTF8()){ const char* pos=chars; while(unsigned char c=*pos++) if(c>127){ fast=false; break; } } size_t start=0; size_t end=our_length; if(!chars) chars=" \t\n"; // white space if(fast){ // from left... if(kind!=TRIM_END) { CORD_pos pos; set_pos(pos, 0); while(true) { char c=CORD_pos_fetch(pos); if(strchr(chars, c)) { if(++start==our_length) return 0; // all chars are empty, just return empty string } else break; CORD_next(pos); } } // from right.. if(kind!=TRIM_START) { CORD_pos pos; set_pos(pos, end-1); while(true) { char c=CORD_pos_fetch(pos); if(strchr(chars, c)) { if(--end==0) // optimization: NO need to check for 'end>=start', that's(<) impossible return 0; // all chars are empty, just return empty string } else break; CORD_prev(pos); } } } else { const XMLByte* src_begin=(const XMLByte*)cstr(); const XMLByte* src_end=src_begin+our_length; // from left... if(kind!=TRIM_END) { while(src_begin127 && *src_begin<0xC0)) char_length++; bool found=false; for(const char* chars_byte=chars; chars_byte=strchr(chars_byte, *ptr); chars_byte++) if(strncmp(chars_byte, (const char*)ptr, char_length)==0){ found=true; break; } if(found){ start+=char_length; if(start==our_length) return 0; // all chars are empty, just return empty string } else break; } } // from right.. if(kind!=TRIM_START) { while(src_begin127 && *src_end<0xC0)) char_length++; bool found=false; for(const char* chars_byte=chars; chars_byte=strchr(chars_byte, *src_end); chars_byte++) if(strncmp(chars_byte, (const char*)src_end, char_length)==0){ found=true; break; } if(found){ end-=char_length; if(end==0) return 0; // all chars are empty, just return empty string } else break; } } } if(start==0 && end==our_length) // nobody moved a thing return *this; if(out_start) *out_start=start; size_t new_length=end-start; if(out_length) *out_length=new_length; return mid(start, new_length); } static int CORD_batched_iter_fn_generic_hash_code(char c, void * client_data) { uint& result=*static_cast(client_data); generic_hash_code(result, c); return 0; } static int CORD_batched_iter_fn_generic_hash_code(const char* s, void * client_data) { uint& result=*static_cast(client_data); generic_hash_code(result, s); return 0; }; uint String::Body::get_hash_code() const { #ifdef HASH_CODE_CACHING if(hash_code) return hash_code; #else uint hash_code=0; #endif if (body && CORD_IS_STRING(body)){ generic_hash_code(hash_code, body); } else { CORD_iter5(body, 0, CORD_batched_iter_fn_generic_hash_code, CORD_batched_iter_fn_generic_hash_code, &hash_code); } return hash_code; } struct CORD_pos_info { const char* chars; size_t left; size_t pos; }; // can be called only for IS_FUNCTION(CORD) which is used in String::Body::strrpbrk static int CORD_iter_fn_rpos(char c, CORD_pos_info* info) { if(info->pos < info->left){ info->pos=STRING_NOT_FOUND; return 1; } if(strchr(info->chars, c)) return 1; --(info->pos); return 0; } size_t String::Body::strrpbrk(const char* chars, size_t left, size_t right) const { if(is_empty() || !chars || !strlen(chars)) return STRING_NOT_FOUND; CORD_pos_info info={chars, left, right}; if(CORD_riter4(body, right, (CORD_iter_fn)CORD_iter_fn_rpos, &info)) return info.pos; else return STRING_NOT_FOUND; } // can be called only for IS_FUNCTION(CORD) which is used in String::Body::rskipchars static int CORD_iter_fn_rskip(char c, CORD_pos_info* info) { if(info->pos < info->left) { info->pos=STRING_NOT_FOUND; return 1; } if(!strchr(info->chars, c)) return 1; --(info->pos); return 0; } size_t String::Body::rskipchars(const char* chars, size_t left, size_t right) const { if(is_empty() || !chars || !strlen(chars)) return STRING_NOT_FOUND; CORD_pos_info info={chars, left, right}; if(CORD_riter4(body, right, (CORD_iter_fn)CORD_iter_fn_rskip, &info)) return info.pos; else return STRING_NOT_FOUND; } // String methods String& String::append_know_length(const char* str, size_t known_length, Language lang) { if(!known_length) return *this; // first: langs langs.append(body, lang, known_length); // next: letters themselves body.append_know_length(str, known_length); ASSERT_STRING_INVARIANT(*this); return *this; } String& String::append_help_length(const char* str, size_t helper_length, Language lang) { if(!str) return *this; size_t known_length=helper_length?helper_length:strlen(str); if(!known_length) return *this; return append_know_length(str, known_length, lang); } String::String(int value, const char *format) : langs(L_CLEAN){ char buf[MAX_NUMBER]; body.append_strdup_know_length(buf, snprintf(buf, MAX_NUMBER, format, value)); } String& String::append_strdup(const char* str, size_t helper_length, Language lang) { size_t known_length=helper_length?helper_length:strlen(str); if(!known_length) return *this; // first: langs langs.append(body, lang, known_length); // next: letters themselves body.append_strdup_know_length(str, known_length); ASSERT_STRING_INVARIANT(*this); return *this; } struct CORD_length_info { size_t len; size_t skip; }; int CORD_batched_len(const char* s, CORD_length_info* info){ info->len += lengthUTF8( (const XMLByte *)s, (const XMLByte *)s+strlen(s)); return 0; } // can be called only for IS_FUNCTION(CORD) which are used in large String::Body::mid int CORD_batched_len(const char c, CORD_length_info* info){ if (info->skip==0){ info->len++; info->skip = lengthUTF8Char(c)-1; } else { info->skip--; } return 0; } size_t String::length(Charset& charset) const { if(charset.isUTF8()){ CORD_length_info info = {0, 0}; body.for_each(CORD_batched_len, CORD_batched_len, &info); return info.len; } else return body.length(); } /// @todo check in doc: whether it documents NOW bad situation "abc".mid(-1, 3) =were?="ab" String& String::mid(size_t substr_begin, size_t substr_end) const { String& result=*new String; size_t self_length=length(); substr_begin=min(substr_begin, self_length); substr_end=min(max(substr_end, substr_begin), self_length); size_t substr_length=substr_end-substr_begin; if(!substr_length) return result; // first: their langs result.langs.append(result.body, langs, substr_begin, substr_length); // next: letters themselves result.body=body.mid(substr_begin, substr_length); ASSERT_STRING_INVARIANT(result); return result; } // from, to and helper_length in characters, not in bytes (it's important for utf-8) String& String::mid(Charset& charset, size_t from, size_t to, size_t helper_length) const { String& result=*new String; size_t self_length=(helper_length)?helper_length:length(charset); if(!self_length) return result; from=min(min(to, from), self_length); to=min(max(to, from), self_length); size_t substr_length=to-from; if(!substr_length) return result; if(charset.isUTF8()){ const XMLByte* src_begin=(const XMLByte*)cstr(); const XMLByte* src_end=src_begin+body.length(); // convert 'from' and 'substr_length' from 'characters' to 'bytes' from=getUTF8BytePos(src_begin, src_end, from); substr_length=getUTF8BytePos(src_begin+from, src_end, substr_length); if(!substr_length) return result; } // first: their langs result.langs.append(result.body, langs, from, substr_length); // next: letters themselves result.body=body.mid(from, substr_length); ASSERT_STRING_INVARIANT(result); return result; } size_t String::pos(const String::Body substr, size_t this_offset, Language lang) const { size_t substr_length=substr.length(); while(true) { size_t substr_begin=body.pos(substr, this_offset); if(substr_begin==CORD_NOT_FOUND) return STRING_NOT_FOUND; if(langs.check_lang(lang, substr_begin, substr_length)) return substr_begin; this_offset=substr_begin+substr_length; } } size_t String::pos(const String& substr, size_t this_offset, Language lang) const { return pos(substr.body, this_offset, lang); } size_t String::pos(Charset& charset, const String& substr, size_t this_offset, Language lang) const { if(charset.isUTF8()){ const XMLByte* srcPtr=(const XMLByte*)cstr(); const XMLByte* srcEnd=srcPtr+body.length(); // convert 'this_offset' from 'characters' to 'bytes' this_offset=getUTF8BytePos(srcPtr, srcEnd, this_offset); size_t result=pos(substr.body, this_offset, lang); return (result==CORD_NOT_FOUND) ? STRING_NOT_FOUND : getUTF8CharPos(srcPtr, srcEnd, result); // convert 'result' from 'bytes' to 'characters' } else { size_t result=pos(substr.body, this_offset, lang); return (result==CORD_NOT_FOUND) ? STRING_NOT_FOUND : result; } } void String::split(ArrayString& result, size_t& pos_after, const char* delim, Language lang, int limit) const { if(is_empty()) return; size_t self_length=length(); if(size_t delim_length=strlen(delim)) { size_t pos_before; // while we have 'delim'... for(; (pos_before=pos(delim, pos_after, lang))!=STRING_NOT_FOUND && limit; limit--) { result+=&mid(pos_after, pos_before); pos_after=pos_before+delim_length; } // last piece if(pos_afterinfo(); // I have no idea what does it for? bool need_pre_post_match=vregex->is_pre_post_match_needed(); bool global=vregex->is_global_search(); const char* subject=cstr(); size_t subject_length=length(); const int ovector_size=(1/*match*/+MAX_MATCH_GROUPS)*3; int ovector[ovector_size]; Table::Action_options table_options; Table& table=*new Table(string_match_table_template, table_options); int prestart=0; int poststart=0; int postfinish=length(); while(true) { int exec_result=vregex->exec(subject, subject_length, ovector, ovector_size, prestart); if(exec_result<0) // only PCRE_ERROR_NOMATCH might be here, other negative results cause an exception break; int prefinish=ovector[0]; poststart=ovector[1]; if (prestart==poststart && subject[poststart]=='\n'){ prestart++; continue; } ArrayString* row=new ArrayString(3); if(need_pre_post_match) { *row+=&mid(0, prefinish); // .prematch column value *row+=&mid(prefinish, poststart); // .match *row+=&mid(poststart, postfinish); // .postmatch } else { *row+=&Empty; // .prematch column value *row+=&Empty; // .match *row+=&Empty; // .postmatch } for(int i=1; i=0 && ovector[i*2+1]>0)?&mid(ovector[i*2+0], ovector[i*2+1]):new String; // .i column value } matches_count++; row_action(table, row, prestart, prefinish, poststart, postfinish, info); if(!global || prestart==poststart) // last step break; prestart=poststart; } row_action(table, 0/*last time, no raw*/, 0, 0, poststart, postfinish, info); return vregex->is_just_count() ? 0 : &table; } String& String::change_case(Charset& source_charset, Change_case_kind kind) const { String& result=*new String(); if(is_empty()) return result; char* new_cstr=cstrm(); if(source_charset.isUTF8()) { size_t new_cstr_len=length(); switch(kind) { case CC_UPPER: change_case_UTF8((const XMLByte*)new_cstr, new_cstr_len, (XMLByte*)new_cstr, new_cstr_len, UTF8CaseToUpper); break; case CC_LOWER: change_case_UTF8((const XMLByte*)new_cstr, new_cstr_len, (XMLByte*)new_cstr, new_cstr_len, UTF8CaseToLower); break; default: assert(!"unknown change case kind"); break; // never } } else { const unsigned char *tables=source_charset.pcre_tables; const unsigned char *a; const unsigned char *b; switch(kind) { case CC_UPPER: a=tables+lcc_offset; b=tables+fcc_offset; break; case CC_LOWER: a=tables+lcc_offset; b=0; break; default: assert(!"unknown change case kind"); a=b=0; // calm, compiler break; // never } char *dest=new_cstr; unsigned char index; for(const char* current=new_cstr; (index=(unsigned char)*current); current++) { unsigned char c=a[index]; if(b) c=b[c]; *dest++=(char)c; } } result.langs=langs; result.body=new_cstr; return result; } const String& String::escape(Charset& source_charset) const { if(is_empty()) return *this; return Charset::escape(*this, source_charset); } #define STRING_APPEND(result, from_cstr, langs, langs_offset, length) \ result.langs.append(result.body, langs, langs_offset, length); \ result.body.append_strdup_know_length(from_cstr, length); const String& String::replace(const Dictionary& dict) const { if(!dict.count() || is_empty()) return *this; String& result=*new String(); const char* old_cstr=cstr(); const char* prematch_begin=old_cstr; if(dict.count()==1) { // optimized simple case Dictionary::Subst subst=dict.get(0); while(const char* p=strstr(prematch_begin, subst.from)) { // prematch if(size_t prematch_length=p-prematch_begin) { STRING_APPEND(result, prematch_begin, langs, prematch_begin-old_cstr, prematch_length) } // match prematch_begin=p+subst.from_length; if(const String* b=subst.to) // are there any b? result<<*b; } } else { const char* current=old_cstr; while(*current) { if(Dictionary::Subst subst=dict.first_that_begins(current)) { // prematch if(size_t prematch_length=current-prematch_begin) { STRING_APPEND(result, prematch_begin, langs, prematch_begin-old_cstr, prematch_length) } // match // skip 'a' in 'current'; move prematch_begin current+=subst.from_length; prematch_begin=current; if(const String* b=subst.to) // are there any b? result<<*b; } else // simply advance current++; } } if(prematch_begin==old_cstr) // not modified return *this; // postmatch if(size_t postmatch_length=old_cstr+length()-prematch_begin) { STRING_APPEND(result, prematch_begin, langs, prematch_begin-old_cstr, postmatch_length) } ASSERT_STRING_INVARIANT(result); return result; } static int serialize_body_char(char c, char** cur) { *((*cur)++)=c; return 0; // 0=continue }; static int serialize_body_piece(const char* s, char** cur) { size_t length=strlen(s); memcpy(*cur, s, length); *cur+=length; return 0; // 0=continue }; static int serialize_lang_piece(char alang, size_t asize, char** cur) { // lang **cur=alang; (*cur)++; // length [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(*cur, &asize, sizeof(asize)); *cur+=sizeof(asize); return 0; // 0=continue } String::Cm String::serialize(size_t prolog_length) const { size_t fragments_count=langs.count(); size_t body_length=body.length(); size_t buf_length= prolog_length //1 +sizeof(size_t) //2 +body_length //3 +1 // 4 for zero terminator used in deserialize +sizeof(size_t) //5 +fragments_count*(sizeof(char)+sizeof(size_t)); //6 String::Cm result(new(PointerFreeGC) char[buf_length], buf_length); // 1: prolog char *cur=result.str+prolog_length; // 2: chars.count [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(cur, &body_length, sizeof(body_length)); cur+=sizeof(body_length); // 3: letters body.for_each(serialize_body_char, serialize_body_piece, &cur); // 4: zero terminator *cur++=0; // 5: langs.count [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(cur, &fragments_count, sizeof(fragments_count)); cur+=sizeof(fragments_count); // 6: lang info langs.for_each(body, serialize_lang_piece, &cur); return result; } bool String::deserialize(size_t prolog_size, void *buf, size_t buf_size) { size_t in_buf=buf_size; if(in_buf<=prolog_size) return false; in_buf-=prolog_size; // 1: prolog const char* cur=(const char* )buf+prolog_size; // 2: chars.count size_t body_length; if(in_bufbody_length) return false; // file curruption // uchar needed to prevent propagating 0x80 bit to upper bytes langs.append(total_length, (String::Language)(uchar)lang, fragment_length); total_length=combined_length; in_buf-=piece_length; } if(total_length!=body_length) // length(all language fragments) vs length(letters) return false; } if(in_buf!=0) // some strange extra bytes return false; ASSERT_STRING_INVARIANT(*this); return true; } const char* String::Body::v() const { return CORD_to_const_char_star(body, length()); } void String::Body::dump() const { CORD_dump(body); } const char* String::Languages::v() const { if(opt.is_not_just_lang) return CORD_to_const_char_star(langs, 0); else return (const char*)&langs; } void String::Languages::dump() const { if(opt.is_not_just_lang) CORD_dump(langs); else puts((const char*)&langs); } const char* String::v() const { const uint LIMIT_VIEW=20; char* buf=(char*)malloc(MAX_STRING); const char*body_view=body.v(); const char*langs_view=langs.v(); snprintf(buf, MAX_STRING, "%d:%.*s%s} " "{%d:%s", langs.count(), LIMIT_VIEW, langs_view, strlen(langs_view)>LIMIT_VIEW?"...":"", strlen(body_view), body_view ); return buf; } void String::dump() const { body.dump(); langs.dump(); } const String& String::trim(String::Trim_kind kind, const char* chars, Charset* source_charset) const { if(is_empty()) return *this; size_t substr_begin, substr_length; Body new_body=body.trim(kind, chars, &substr_begin, &substr_length, source_charset); if(new_body==body) // we received unchanged pointer, do likewise return *this; // new_body differs from body, adjust langs along String& result=*new String; if(!new_body) // body.trim produced empty result return result; // body.trim produced nonempty result // first: their langs result.langs.append(result.body, langs, substr_begin, substr_length); // next: letters themselves result.body=new_body; ASSERT_STRING_INVARIANT(result); return result; } parser-3.4.3/src/main/pa_cache_managers.C000644 000000 000000 00000002144 11730603275 020340 0ustar00rootwheel000000 000000 /** @file Parser: status press center implementation. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_cache_managers.h" volatile const char * IDENT_PA_CACHE_MANAGERS_C="$Id: pa_cache_managers.C,v 1.18 2012/03/16 09:24:13 moko Exp $" IDENT_PA_CACHE_MANAGERS_H; #include "pa_sql_driver_manager.h" #ifdef XML #include "pa_stylesheet_manager.h" #endif // globals Cache_managers* cache_managers=0; Cache_managers::Cache_managers() { put("sql", (SQL_driver_manager=new SQL_Driver_manager)); #ifdef XML put("stylesheet", (stylesheet_manager=new Stylesheet_manager)); #endif } static void delete_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, int) { delete avalue; } Cache_managers::~Cache_managers() { for_each(delete_one, 0); } // methods static void maybe_expire_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, int) { avalue->maybe_expire_cache(); } void Cache_managers::maybe_expire() { for_each(maybe_expire_one, 0); } parser-3.4.3/src/main/pa_socks.C000644 000000 000000 00000003307 12173056751 016547 0ustar00rootwheel000000 000000 /** @file Parser: socks initialization/finalization. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ volatile const char * IDENT_PA_SOCKS_C="$Id: pa_socks.C,v 1.28 2013/07/21 22:17:13 moko Exp $"; #include "pa_config_includes.h" #ifdef _MSC_VER #include "pa_exception.h" #include "pa_socks.h" #include "pa_string.h" #include WSADATA wsaData; void pa_socks_init() { WORD wVersionRequested; int err; wVersionRequested = MAKEWORD( 1, 1 ); err = WSAStartup( wVersionRequested, &wsaData ); if ( err != 0 ) { /* Tell the user that we could not find a usable */ throw Exception(0, 0, "can not WSAStartup, err=%d", err); } } void pa_socks_done() { /* Confirm that the WinSock DLL supports 2.2.*/ /* Note that if the DLL supports versions greater */ /* than 2.2 in addition to 2.2, it will still return */ /* 2.2 in wVersion since that is the version we */ /* requested. */ if ( LOBYTE( wsaData.wVersion ) == 2 || HIBYTE( wsaData.wVersion ) == 2 ) { WSACleanup(); return; } } const char* pa_socks_strerr(int no) { char buf[MAX_STRING]; buf[0]=0; size_t error_size=FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, no, 0, // Default language (LPTSTR) &buf, sizeof(buf), NULL ); if(error_size>3) // ".\r\n" buf[error_size-3]=0; return buf[0]? pa_strdup(buf): "unknown error"; } int pa_socks_errno() { return WSAGetLastError(); } #else void pa_socks_init() {} void pa_socks_done() {} const char* pa_socks_strerr(int no) { return strerror(no); } int pa_socks_errno() { return errno; } #endif parser-3.4.3/src/main/pa_uue.C000644 000000 000000 00000005022 11730603276 016215 0ustar00rootwheel000000 000000 /** @file Parser: uuencoding impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) @todo setrlimit */ #include "pa_config_includes.h" #include "pa_uue.h" #include "pa_memory.h" volatile const char * IDENT_PA_UUE_C="$Id: pa_uue.C,v 1.16 2012/03/16 09:24:14 moko Exp $" IDENT_PA_UUE_H; static unsigned char uue_table[64] = { '`', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\',']', '^', '_' }; const char* pa_uuencode(const unsigned char* in, size_t in_size, const char* file_name) { int count=45; size_t new_size = ((in_size / 3 + 1) * 4); new_size += 2 * new_size / (count / 3 * 4) /*chars in line + new lines*/ + 2; new_size += strlen(file_name) + 11/*header*/ + 6/*footer*/ + 1/*zero terminator*/; const char* result=new(PointerFreeGC) char[new_size]; char* optr=(char*)result; //header optr += sprintf(optr, "begin 644 %s\n", file_name); //body for(const unsigned char *itemp=in; itemp<(in+in_size); itemp+=count) { int index; if((itemp+count)>(in+in_size)) count=in_size-(itemp-in); /* * for UU and XX, encode the number of bytes as first character */ *optr++ = uue_table[count]; for (index=0; index<=count-3; index+=3) { *optr++ = uue_table[itemp[index] >> 2]; *optr++ = uue_table[((itemp[index ] & 0x03) << 4) | (itemp[index+1] >> 4)]; *optr++ = uue_table[((itemp[index+1] & 0x0f) << 2) | (itemp[index+2] >> 6)]; *optr++ = uue_table[ itemp[index+2] & 0x3f]; } /* * Special handlitempg for itempcomplete litempes */ if (index != count) { if (count - index == 2) { *optr++ = uue_table[itemp[index] >> 2]; *optr++ = uue_table[((itemp[index ] & 0x03) << 4) | ( itemp[index+1] >> 4)]; *optr++ = uue_table[((itemp[index+1] & 0x0f) << 2)]; *optr++ = uue_table[0]; } else if (count - index == 1) { *optr++ = uue_table[ itemp[index] >> 2]; *optr++ = uue_table[(itemp[index] & 0x03) << 4]; *optr++ = uue_table[0]; *optr++ = uue_table[0]; } } /* * end of line */ *optr++ = '\n'; } //footer optr += sprintf(optr, "`\nend\n"); //throw Exception(PARSER_RUNTIME, 0, "%d %d %d", in_size, new_size, (size_t)(optr-result)); assert((size_t)(optr-result) < new_size); return result; } parser-3.4.3/src/main/pa_http.C000644 000000 000000 00000072617 12173450422 016407 0ustar00rootwheel000000 000000 /** @file Parser: http support functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_http.h" #include "pa_common.h" #include "pa_charsets.h" #include "pa_request_charsets.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_random.h" volatile const char * IDENT_PA_HTTP_C="$Id: pa_http.C,v 1.59 2013/07/23 09:46:58 moko Exp $" IDENT_PA_HTTP_H; #ifdef _MSC_VER #include #else #define closesocket close #endif // defines #define HTTP_METHOD_NAME "method" #define HTTP_FORM_NAME "form" #define HTTP_BODY_NAME "body" #define HTTP_TIMEOUT_NAME "timeout" #define HTTP_HEADERS_NAME "headers" #define HTTP_FORM_ENCTYPE_NAME "enctype" #define HTTP_ANY_STATUS_NAME "any-status" #define HTTP_OMIT_POST_CHARSET_NAME "omit-post-charset" // ^file::load[...;http://...;$.method[post]] by default adds charset to content-type #define HTTP_TABLES_NAME "tables" #define HTTP_USER "user" #define HTTP_PASSWORD "password" #define DEFAULT_USER_AGENT "parser3" #ifndef INADDR_NONE #define INADDR_NONE ((ulong) -1) #endif #undef CRLF #define CRLF "\r\n" // helpers class Cookies_table_template_columns: public ArrayString { public: Cookies_table_template_columns() { *this+=new String("name"); *this+=new String("value"); *this+=new String("expires"); *this+=new String("max-age"); *this+=new String("domain"); *this+=new String("path"); *this+=new String("httponly"); *this+=new String("secure"); } }; static bool set_addr(struct sockaddr_in *addr, const char* host, const short port){ memset(addr, 0, sizeof(*addr)); addr->sin_family=AF_INET; addr->sin_port=htons(port); if(host) { ulong packed_ip=inet_addr(host); if(packed_ip!=INADDR_NONE) memcpy(&addr->sin_addr, &packed_ip, sizeof(packed_ip)); else { struct hostent *hostIP=gethostbyname(host); if(hostIP) memcpy(&addr->sin_addr, hostIP->h_addr, hostIP->h_length); else return false; } } else addr->sin_addr.s_addr=INADDR_ANY; return true; } size_t guess_content_length(char* buf) { char* ptr; if((ptr=strstr(buf, "Content-Length:"))) // Apache goto found; if((ptr=strstr(buf, "content-length:"))) // Parser 3 before 3.4.0 goto found; if((ptr=strstr(buf, "Content-length:"))) // maybe 1 goto found; if((ptr=strstr(buf, "CONTENT-LENGTH:"))) // maybe 2 goto found; return 0; found: char *error_pos; size_t result=(size_t)strtol(ptr+15/*strlen("Content-Length:")*/, &error_pos, 0); const size_t reasonable_initial_max=0x400*0x400*10 /*10M*/; if(result>reasonable_initial_max) // sanity check return reasonable_initial_max; return 0;//result; } static int http_read_response(char*& response, size_t& response_size, int sock, bool fail_on_status_ne_200) { int result=0; // fetching some to local buffer, guessing on possible Content-Length response_size=0x400*20; // initial size if Content-Length could not be determined const size_t preview_size=0x400*20; char preview_buf[preview_size+1/*terminator*/]; // 20K buffer to preview headers ssize_t received_size=recv(sock, preview_buf, preview_size, 0); if(received_size==0) goto done; if(received_size<0) { if(int no=pa_socks_errno()) throw Exception("http.timeout", 0, "error receiving response header: %s (%d)", pa_socks_strerr(no), no); goto done; } // terminator [helps futher string searches] preview_buf[received_size]=0; // checking status if(char* EOLat=strstr(preview_buf, "\n")) { const String status_line(pa_strdup(preview_buf, EOLat-preview_buf)); ArrayString astatus; size_t pos_after=0; status_line.split(astatus, pos_after, " "); const String& status_code=*astatus.get(astatus.count()>1?1:0); result=status_code.as_int(); if(fail_on_status_ne_200 && result!=200) throw Exception("http.status", &status_code, "invalid HTTP response status"); } // detecting response_size { if(size_t content_length=guess_content_length(preview_buf)) response_size=preview_size+content_length; // a little more than needed, will adjust response_size by actual received size later } // [gcc is happier this way, see goto above] { // allocating initial buf response=(char*)pa_malloc_atomic(response_size+1/*terminator*/); // just setting memory block type char* ptr=response; size_t todo_size=response_size; // coping part of already received body memcpy(ptr, preview_buf, received_size); ptr+=received_size; todo_size-=received_size; // we use terminator byte for two purposes here: // 1. we return there zero always, not knowing: maybe they would want to create String form $file.body? // invariant: all Strings should have zero-terminated buffers // 2. we use that out-of-size byte to detect if our Content-Length guess was wrong // when recv gets more than we expected // a) we know that the Content-Length guess was wrong // b) we have space to put the first byte of extra data // c) we use less code to detect normal situation: on last while-cycle recv expected to just return 0 while(true) { received_size=recv(sock, ptr, todo_size+1/*there is always a place for terminator*/, 0); if(received_size==0) { response_size-=todo_size; // in case we received less than expected, cut down the reported size break; } if(received_size<0) { if(int no=pa_socks_errno()) throw Exception("http.timeout", 0, "error receiving response body: %s (%d)", pa_socks_strerr(no), no); break; } // they've touched the terminator? if((size_t)received_size>todo_size) { // that means that our guessed response_size was not big enough const size_t grow_chunk_size=0x400*0x400; // 1M response_size+=grow_chunk_size; size_t ptr_offset=ptr-response; response=(char*)pa_realloc(response, response_size+1/*terminator*/); ptr=response+ptr_offset; todo_size+=grow_chunk_size; } // can't do this before realloc: we need =0) closesocket(sock); throw Exception("http.timeout", 0, "timeout occured while retrieving document"); return 0; // never } else { alarm(timeout_secs); #endif try { int result; struct sockaddr_in dest; if(!set_addr(&dest, host, port)) throw Exception("http.host", 0, "can not resolve hostname \"%s\"", host); if((sock=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP/*0*/))<0) { int no=pa_socks_errno(); throw Exception("http.connect", 0, "can not make socket: %s (%d)", pa_socks_strerr(no), no); } // To enable SO_DONTLINGER (that is, disable SO_LINGER) // l_onoff should be set to zero and setsockopt should be called linger dont_linger={0,0}; setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char *)&dont_linger, sizeof(dont_linger)); #ifdef WIN32 // SO_*TIMEO can be defined in .h but not implemlemented in protocol, // failing subsequently with Option not supported by protocol (99) message // could not suppress that, so leaving this only for win32 int timeout_ms=timeout_secs*1000; setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char*)&timeout_ms, sizeof(timeout_ms)); setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timeout_ms, sizeof(timeout_ms)); #endif if(connect(sock, (struct sockaddr *)&dest, sizeof(dest))) { int no=pa_socks_errno(); throw Exception("http.connect", 0, "can not connect to host \"%s\": %s (%d)", host, pa_socks_strerr(no), no); } if(send(sock, request, request_size, 0)!=(ssize_t)request_size) { int no=pa_socks_errno(); throw Exception("http.timeout", 0, "error sending request: %s (%d)", pa_socks_strerr(no), no); } result=http_read_response(response, response_size, sock, fail_on_status_ne_200); closesocket(sock); #ifdef PA_USE_ALARM alarm(0); #endif return result; } catch(...) { #ifdef PA_USE_ALARM alarm(0); #endif if(sock>=0) closesocket(sock); rethrow; } #ifdef PA_USE_ALARM } #endif } #ifndef DOXYGEN struct Http_pass_header_info { Request_charsets* charsets; String* request; bool* user_agent_specified; bool* content_type_specified; bool* content_type_url_encoded; }; #endif char *pa_http_safe_header_name(const char *name) { char *result=pa_strdup(name); char *n=result; if(!pa_isalpha((unsigned char)*n)) *n++ = '_'; for(; *n; ++n) { if (!pa_isalnum((unsigned char)*n) && *n != '-' && *n != '_') *n = '_'; } return result; } static void http_pass_header(HashStringValue::key_type aname, HashStringValue::value_type avalue, Http_pass_header_info *info) { const char* name_cstr=aname.cstr(); if(strcasecmp(name_cstr, HTTP_CONTENT_LENGTH)==0) return; String name=String(pa_http_safe_header_name(capitalize(name_cstr)), String::L_AS_IS); String value=attributed_meaning_to_string(*avalue, String::L_HTTP_HEADER, true); *info->request << name << ": " << value << CRLF; if(strcasecmp(name_cstr, HTTP_USER_AGENT)==0) *info->user_agent_specified=true; if(strcasecmp(name_cstr, HTTP_CONTENT_TYPE)==0){ *info->content_type_specified=true; *info->content_type_url_encoded=StrStartFromNC(value.cstr(), HTTP_CONTENT_TYPE_FORM_URLENCODED); } } static void http_pass_cookie(HashStringValue::key_type name, HashStringValue::value_type value, Http_pass_header_info *info) { *info->request << String(name, String::L_HTTP_COOKIE) << "=" << attributed_meaning_to_string(*value, String::L_HTTP_COOKIE, true) << "; "; } static const String* basic_authorization_field(const char* user, const char* pass) { if(!user&& !pass) return 0; String combined; if(user) combined<key, *row->get(0), info->result); } static void form_value2string( HashStringValue::key_type key, HashStringValue::value_type value, String* result) { if(const String* svalue=value->get_string()) form_string_value2string(key, *svalue, *result); else if(Table* tvalue=value->get_table()) { Form_table_value2string_info info(key, *result); tvalue->for_each(form_table_value2string, &info); } else throw Exception(PARSER_RUNTIME, new String(key, String::L_TAINTED), "is %s, "HTTP_FORM_NAME" option value can be string or table only (file is allowed for $."HTTP_METHOD_NAME"[POST] + $."HTTP_FORM_ENCTYPE_NAME"["HTTP_CONTENT_TYPE_MULTIPART_FORMDATA"])", value->type()); } const char* pa_form2string(HashStringValue& form, Request_charsets& charsets) { String string; form.for_each(form_value2string, &string); return string.untaint_and_transcode_cstr(String::L_URI, &charsets); } struct FormPart { Request* r; const char* boundary; String* string; Form_table_value2string_info* info; struct BinaryBlock{ const char* ptr; size_t length; BinaryBlock(String* astring, Request* r): ptr(astring->untaint_and_transcode_cstr(String::L_AS_IS, &r->charsets)), length(strlen(ptr)){} BinaryBlock(const char* aptr, size_t alength): ptr(aptr), length(alength){} }; Array blocks; FormPart(Request* ar, const char* aboundary): r(ar), boundary(aboundary), string(new String()){} const char *post(size_t &length){ if(blocks.count()){ blocks+=BinaryBlock(string, r); length=0; for(size_t i=0; imime_type_of(file_name); } *part.string << CRLF CRLF; } static void form_string_value2part( HashStringValue::key_type key, const String& value, FormPart& part) { form_part_boundary_header(part, key); *part.string << value << CRLF; } static void form_file_value2part( HashStringValue::key_type key, VFile& vfile, FormPart& part) { form_part_boundary_header(part, key, vfile.fields().get(name_name)->as_string().cstr()); part.blocks+=FormPart::BinaryBlock(part.string, part.r); part.blocks+=FormPart::BinaryBlock(vfile.value_ptr(), vfile.value_size()); part.string=new String(); *part.string << CRLF; } static void form_table_value2part(Table::element_type row, FormPart* part) { form_string_value2part(part->info->key, *row->get(0), *part); } static void form_value2part( HashStringValue::key_type key, HashStringValue::value_type value, FormPart& part) { if(const String* svalue=value->get_string()) form_string_value2part(key, *svalue, part); else if(Table* tvalue=value->get_table()) { Form_table_value2string_info info(key, *part.string); part.info = &info; tvalue->for_each(form_table_value2part, &part); } else if(VFile* vfile=static_cast(value->as("file"))){ form_file_value2part(key, *vfile, part); } else throw Exception(PARSER_RUNTIME, new String(key, String::L_TAINTED), "is %s, "HTTP_FORM_NAME" option value can be string, table or file only", value->type()); } const char* pa_form2string_multipart(HashStringValue& form, Request& r, const char* boundary, size_t& post_size){ FormPart formpart(&r, boundary); form.for_each(form_value2part, formpart); *formpart.string << "--" << boundary << "--"; // @todo: return binary blocks here to save memory in pa_internal_file_read_http return formpart.post(post_size); } static void find_headers_end(char* p, char*& headers_end_at, char*& raw_body) { raw_body=p; // \n\n // \r\n\r\n while((p=strchr(p, '\n'))) { headers_end_at=++p; // \n>.< if(*p=='\r') // \r\n>\r?<\n p++; if(*p=='\n') { // \r\n\r>\n?< raw_body=p+1; return; } } headers_end_at=0; } // Set-Cookie: name=value; Domain=docs.foo.com; Path=/accounts; Expires=Wed, 13-Jan-2021 22:23:01 GMT; Secure; HttpOnly static ArrayString* parse_cookie(Request& r, const String& cookie) { char *current=strdup(cookie.cstr()); const String* name=0; const String* value=&String::Empty; const String* expires=&String::Empty; const String* max_age=&String::Empty; const String* path=&String::Empty; const String* domain=&String::Empty; const String* httponly=&String::Empty; const String* secure=&String::Empty; bool first_pair=true; do { if(char *meaning=search_stop(current, ';')) if(char *attribute=search_stop(meaning, '=')) { const String* sname=new String(unescape_chars(attribute, strlen(attribute), &r.charsets.source(), true/*don't convert '"' to space*/), String::L_TAINTED); const String* smeaning=0; if(meaning) smeaning=new String(unescape_chars(meaning, strlen(meaning), &r.charsets.source(), true/*don't convert '"' to space*/), String::L_TAINTED); if(first_pair) { // name + value name=sname; value=smeaning; first_pair=false; } else { const String& slower=sname->change_case(r.charsets.source(), String::CC_LOWER); if(slower == "expires") expires=smeaning; else if(slower == "max-age") max_age=smeaning; else if(slower == "domain") domain=smeaning; else if(slower == "path") path=smeaning; else if(slower == "httponly") httponly=new String("1", String::L_CLEAN); else if(slower == "secure") secure=new String("1", String::L_CLEAN); else { // todo@ ? } } } } while(current); if(!name) return 0; ArrayString* result=new ArrayString(8); *result+=name; *result+=value; *result+=expires; *result+=max_age; *result+=domain; *result+=path; *result+=httponly; *result+=secure; return result; } Table* parse_cookies(Request& r, Table *cookies){ Table& result=*new Table(new Cookies_table_template_columns); for(Array_iterator i(*cookies); i.has_next(); ) if(ArrayString* row=parse_cookie(r, *i.next()->get(0))) result+=row; return &result; } /// @todo build .cookies field. use ^file.tables.SET-COOKIES.menu{ for now File_read_http_result pa_internal_file_read_http(Request& r, const String& file_spec, bool as_text, HashStringValue *options, bool transcode_text_result) { File_read_http_result result; char host[MAX_STRING]; const char* uri; short port=80; const char* method="GET"; bool method_is_get=true; HashStringValue* form=0; int timeout_secs=2; bool fail_on_status_ne_200=true; bool omit_post_charset=false; Value* vheaders=0; Value* vcookies=0; Value* vbody=0; Charset *asked_remote_charset=0; Charset* real_remote_charset=0; const char* user_cstr=0; const char* password_cstr=0; const char* encode=0; bool multipart=false; if(options) { int valid_options=pa_get_valid_file_options_count(*options); if(Value* vmethod=options->get(HTTP_METHOD_NAME)) { valid_options++; method=vmethod->as_string().change_case(r.charsets.source(), String::CC_UPPER).cstr(); method_is_get=strcmp(method, "GET")==0; } if(Value* vencode=options->get(HTTP_FORM_ENCTYPE_NAME)) { valid_options++; encode=vencode->as_string().cstr(); } if(Value* vform=options->get(HTTP_FORM_NAME)) { valid_options++; form=vform->get_hash(); } if(vbody=options->get(HTTP_BODY_NAME)) { valid_options++; } if(Value* vtimeout=options->get(HTTP_TIMEOUT_NAME)) { valid_options++; timeout_secs=vtimeout->as_int(); } if(vheaders=options->get(HTTP_HEADERS_NAME)) { valid_options++; } if(vcookies=options->get(HTTP_COOKIES_NAME)) { valid_options++; } if(Value* vany_status=options->get(HTTP_ANY_STATUS_NAME)) { valid_options++; fail_on_status_ne_200=!vany_status->as_bool(); } if(Value* vomit_post_charset=options->get(HTTP_OMIT_POST_CHARSET_NAME)){ valid_options++; omit_post_charset=vomit_post_charset->as_bool(); } if(Value* vcharset_name=options->get(PA_CHARSET_NAME)) { asked_remote_charset=&charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); } if(Value* vresponse_charset_name=options->get(PA_RESPONSE_CHARSET_NAME)) { real_remote_charset=&charsets.get(vresponse_charset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); } if(Value* vuser=options->get(HTTP_USER)) { valid_options++; user_cstr=vuser->as_string().cstr(); } if(Value* vpassword=options->get(HTTP_PASSWORD)) { valid_options++; password_cstr=vpassword->as_string().cstr(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(!asked_remote_charset) // defaulting to $request:charset asked_remote_charset=&(r.charsets).source(); if(encode){ if(method_is_get) throw Exception(PARSER_RUNTIME, 0, "you can not use $."HTTP_FORM_ENCTYPE_NAME" option with method GET"); multipart=strcasecmp(encode, HTTP_CONTENT_TYPE_MULTIPART_FORMDATA)==0; if(!multipart && strcasecmp(encode, HTTP_CONTENT_TYPE_FORM_URLENCODED)!=0) throw Exception(PARSER_RUNTIME, 0, "$."HTTP_FORM_ENCTYPE_NAME" option value can be "HTTP_CONTENT_TYPE_FORM_URLENCODED" or "HTTP_CONTENT_TYPE_MULTIPART_FORMDATA" only"); } if(vbody){ if(method_is_get) throw Exception(PARSER_RUNTIME, 0, "you can not use $."HTTP_BODY_NAME" option with method GET"); if(form) throw Exception(PARSER_RUNTIME, 0, "you can not use options $."HTTP_BODY_NAME" and $."HTTP_FORM_NAME" together"); } //preparing request String& connect_string=*new String(file_spec); const char* request; size_t request_size; { // influence URLencoding of tainted pieces to String::L_URI lang Temp_client_charset temp(r.charsets, *asked_remote_charset); const char* connect_string_cstr=connect_string.untaint_and_transcode_cstr(String::L_URI, &(r.charsets)); const char* current=connect_string_cstr; if(strncmp(current, "http://", 7)!=0) throw Exception(PARSER_RUNTIME, &connect_string, "does not start with http://"); //never current+=7; strncpy(host, current, sizeof(host)-1); host[sizeof(host)-1]=0; char* host_uri=lsplit(host, '/'); uri=host_uri?current+(host_uri-1-host):"/"; char* port_cstr=lsplit(host, ':'); if (port_cstr){ char* error_pos=0; port=(short)strtol(port_cstr, &error_pos, 10); if(port==0 || *error_pos) throw Exception(PARSER_RUNTIME, &connect_string, "invalid port number '%s'", port_cstr); } // making request head String head; head << method << " " << uri; if(method_is_get && form) head << (strchr(uri, '?')!=0?"&":"?") << pa_form2string(*form, r.charsets); head <<" HTTP/1.0" CRLF "Host: "<< host; if (port != 80) head << ":" << port_cstr; head << CRLF; char* boundary=0; if(multipart){ uuid uuid=get_uuid(); const int boundary_bufsize=10+32+1/*for zero-teminator*/+1/*for faulty snprintfs*/; boundary=new(PointerFreeGC) char[boundary_bufsize]; snprintf(boundary, boundary_bufsize, "----------%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X", uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, uuid.node[0], uuid.node[1], uuid.node[2], uuid.node[3], uuid.node[4], uuid.node[5]); } String user_headers; bool user_agent_specified=false; bool content_type_specified=false; bool content_type_url_encoded=false; if(vheaders && !vheaders->is_string()) { // allow empty if(HashStringValue *headers=vheaders->get_hash()) { Http_pass_header_info info={ &(r.charsets), &user_headers, &user_agent_specified, &content_type_specified, &content_type_url_encoded}; headers->for_each(http_pass_header, &info); } else throw Exception(PARSER_RUNTIME, 0, "headers param must be hash"); }; const char* request_body=0; size_t post_size=0; if(form && !method_is_get) { head << "Content-Type: " << (multipart ? HTTP_CONTENT_TYPE_MULTIPART_FORMDATA : HTTP_CONTENT_TYPE_FORM_URLENCODED); if(!omit_post_charset) head << "; charset=" << asked_remote_charset->NAME_CSTR(); if(multipart) { head << "; boundary=" << boundary; request_body=pa_form2string_multipart(*form, r/*charsets & mime_type needed*/, boundary, post_size/*correct post_size returned here*/); } else { request_body=pa_form2string(*form, r.charsets); post_size=strlen(request_body); } head << CRLF; } else if(vbody) { // $.body was specified if(content_type_url_encoded){ // transcode + url-encode request_body=vbody->as_string().untaint_and_transcode_cstr(String::L_URI, &(r.charsets)); } else { // content-type != application/x-www-form-urlencoded -> transcode only, don't url-encode! request_body=Charset::transcode( String::C(vbody->as_string().cstr(), vbody->as_string().length()), r.charsets.source(), *asked_remote_charset ); } post_size=strlen(request_body); } // http://www.ietf.org/rfc/rfc2617.txt if(const String* authorization_field_value=basic_authorization_field(user_cstr, password_cstr)) head << "Authorization: " << *authorization_field_value << CRLF; head << user_headers; if(!user_agent_specified) // defaulting head << "User-Agent: " DEFAULT_USER_AGENT CRLF; if(form && !method_is_get && content_type_specified) // POST + form + content-type was specified throw Exception(PARSER_RUNTIME, 0, "$.content-type can't be specified with method POST"); if(vcookies && !vcookies->is_string()){ // allow empty if(HashStringValue* cookies=vcookies->get_hash()) { head << "Cookie: "; Http_pass_header_info info={&(r.charsets), &head, 0, 0, 0}; cookies->for_each(http_pass_cookie, &info); head << CRLF; } else throw Exception(PARSER_RUNTIME, 0, "cookies param must be hash"); } if(request_body) head << "Content-Length: " << format(post_size, "%u") << CRLF; head << CRLF; const char *request_head=head.untaint_and_transcode_cstr(String::L_URI, &(r.charsets)); if(request_body){ size_t head_size = strlen(request_head); request_size=post_size + head_size; char *ptr=(char *)pa_malloc_atomic(request_size); memcpy(ptr, request_head, head_size); memcpy(ptr+head_size, request_body, post_size); request=ptr; } else { request_size=strlen(request_head); request=request_head; } } char* response; size_t response_size; // sending request int status_code=http_request(response, response_size, host, port, request, request_size, timeout_secs, fail_on_status_ne_200); // processing results char* raw_body; size_t raw_body_size; char* headers_end_at; find_headers_end(response, headers_end_at, raw_body); raw_body_size=response_size-(raw_body-response); result.headers=new HashStringValue; VHash* vtables=new VHash; result.headers->put(HTTP_TABLES_NAME, vtables); if(headers_end_at) { *headers_end_at=0; const String header_block(String::C(response, headers_end_at-response), String::L_TAINTED); ArrayString aheaders; HashStringValue& tables=vtables->hash(); size_t pos_after=0; header_block.split(aheaders, pos_after, "\n"); // processing headers size_t aheaders_count=aheaders.count(); for(size_t i=1; iget_table(); } else { // first appearence Table::columns_type columns=new ArrayString(1); *columns+=new String("value"); table=new Table(columns); } // this string becomes next row ArrayString& row=*new ArrayString(1); row+=&HEADER_VALUE; *table+=&row; // not existed before? add it if(!existed) tables.put(HEADER_NAME, new VTable(table)); } result.headers->put(HEADER_NAME, new VString(HEADER_VALUE)); } // filling $.cookies if(Value *vcookies=(Value *)tables.get("SET-COOKIE")) result.headers->put(HTTP_COOKIES_NAME, new VTable(parse_cookies(r, vcookies->get_table()))); } if(as_text && raw_body_size>=3 && strncmp(raw_body, "\xEF\xBB\xBF", 3)==0){ // skip UTF-8 signature (BOM code) raw_body+=3; raw_body_size-=3; if(!real_remote_charset) real_remote_charset=&UTF8_charset; } // output response String::C real_body=String::C(raw_body, raw_body_size); if(as_text && transcode_text_result && raw_body_size) { // raw_body_size must be checked because transcode returns CONST string in case length==0, which contradicts hacking few lines below // defaulting to used-asked charset [it's never empty!] if(!real_remote_charset) real_remote_charset=asked_remote_charset; real_body=Charset::transcode(real_body, *real_remote_charset, r.charsets.source()); } result.str=const_cast(real_body.str); // hacking a little result.length=real_body.length; if(as_text && result.length) fix_line_breaks(result.str, result.length); result.headers->put(file_status_name, new VInt(status_code)); return result; } parser-3.4.3/src/include/pa_dir.h000644 000000 000000 00000003671 12173316132 016743 0ustar00rootwheel000000 000000 /** @file Parser: directory scanning for different OS-es decls. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_DIR_H #define PA_DIR_H #define IDENT_PA_DIR_H "$Id: pa_dir.h,v 1.25 2013/07/22 20:55:54 moko Exp $" #include "pa_config_includes.h" /** @struct ffblk win32/unix unified directory entry structure name for findfirst/next/close interface */ #ifdef _MSC_VER #include #define MAXPATH MAX_PATH struct ffblk { DWORD ff_attrib;/*dwFileAttributes;*/ FILETIME ftCreationTime; FILETIME ftLastAccessTime; FILETIME ftLastWriteTime; DWORD nFileSizeHigh; DWORD nFileSizeLow; DWORD dwReserved0; DWORD dwReserved1; CHAR ff_name[ MAX_PATH ];/*cFileName[ MAX_PATH ];*/ CHAR cAlternateFileName[ 14 ]; /*helper*/ HANDLE handle; void stat_file(){} bool is_dir(); double size(); time_t c_timestamp(); time_t m_timestamp(); time_t a_timestamp(); }; #else #define MAXPATH 1000 /*NAME_MAX*/ struct ffblk { /*as if in windows :)*/ char ff_name[ MAXPATH ]; /*helpers*/ DIR *dir; const char *filePath; struct stat _st; #ifdef HAVE_STRUCT_DIRENT_D_TYPE unsigned char _d_type; void stat_file(); #else void stat_file(){} void real_stat_file(); #endif bool is_dir(); double size(); time_t c_timestamp(); time_t m_timestamp(); time_t a_timestamp(); }; #endif bool findfirst(const char* _pathname, struct ffblk *_ffblk, int _attrib); bool findnext(struct ffblk *_ffblk); void findclose(struct ffblk *_ffblk); /// main dir workhorse: calles win32/unix unified functions findfirst/next/close [skip . and ..] #define LOAD_DIR(dir,action) {\ ffblk ffblk; \ if(!findfirst(dir, &ffblk, 0)) { \ do \ if(*ffblk.ff_name && !(ffblk.ff_name[0]=='.' && (ffblk.ff_name[1]==0 || ffblk.ff_name[1]=='.' && ffblk.ff_name[2]==0) )) {\ action; \ } \ while(!findnext(&ffblk)); \ findclose(&ffblk); \ } \ } #endif parser-3.4.3/src/include/pa_sapi.h000644 000000 000000 00000002456 11730603272 017123 0ustar00rootwheel000000 000000 /** @file Parser: web server api interface object decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_SAPI_H #define PA_SAPI_H #define IDENT_PA_SAPI_H "$Id: pa_sapi.h,v 1.29 2012/03/16 09:24:10 moko Exp $" // includes #include "pa_types.h" #include "pa_array.h" // forwards class SAPI_Info; /// target web-Server API struct SAPI { /// log error message static void log(SAPI_Info& info, const char* fmt, ...); /// log error message & exit static void die(const char* fmt, ...); /// log error message & abort[write core] static void abort(const char* fmt, ...); /// environment strings static const char* const* environment(SAPI_Info& info); /// get environment string static char* get_env(SAPI_Info& info, const char* name); /// read POST request bytes static size_t read_post(SAPI_Info& info, char *buf, size_t max_bytes); /// add response header attribute [but do not send it to client] static void add_header_attribute(SAPI_Info& info, const char* dont_store_key, const char* dont_store_value); /// send collected header attributes to client static void send_header(SAPI_Info& info); /// output body bytes static size_t send_body(SAPI_Info& info, const void *buf, size_t size); }; #endif parser-3.4.3/src/include/pa_config_auto.h.in000644 000000 000000 00000027207 12234222475 021074 0ustar00rootwheel000000 000000 /* src/include/pa_config_auto.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* using cygwin building environment */ #undef CYGWIN /* FreeBSD4X target platform */ #undef FREEBSD4 /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the `crypt' function. */ #undef HAVE_CRYPT /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define if you have daylight external variable in */ #undef HAVE_DAYLIGHT /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the `fchmod' function. */ #undef HAVE_FCHMOD /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `flock' function. */ #undef HAVE_FLOCK /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IO_H /* Define to 1 if you have the `crypt' library (-lcrypt). */ #undef HAVE_LIBCRYPT /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `xnet' library (-lxnet). */ #undef HAVE_LIBXNET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `lockf' function. */ #undef HAVE_LOCKF /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the header file. */ #undef HAVE_PROCESS_H /* Define to 1 if you have the `qsort' function. */ #undef HAVE_QSORT /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define to 1 if you have the `round' (maybe built-in) math function function. */ #undef HAVE_ROUND /* Define to 1 if you have the header file. */ #undef HAVE_SETJMP_H /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the `siglongjmp' function. */ #undef HAVE_SIGLONGJMP /* Define to 1 if you have the `sign' (maybe built-in) math function function. */ #undef HAVE_SIGN /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `sigsetjmp' function. */ #undef HAVE_SIGSETJMP /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_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_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* 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 `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if `d_type' is a member of `struct dirent'. */ #undef HAVE_STRUCT_DIRENT_D_TYPE /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOCKING_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define if you have timezone external variable in */ #undef HAVE_TIMEZONE /* Define if you have tm_gmtoff member of tm structure in */ #undef HAVE_TM_GMTOFF /* Define if you have tm_tzadj member of tm structure in */ #undef HAVE_TM_TZADJ /* Define to 1 if you have the `trunc' (maybe built-in) math function function. */ #undef HAVE_TRUNC /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define to 1 if you have the `_locking' function. */ #undef HAVE__LOCKING /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* assertions disabled */ #undef NDEBUG /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* pa_exec disabled */ #undef NO_PA_EXECS /* stringstream disabled */ #undef NO_STRINGSTREAM /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* parser version */ #undef PARSER_VERSION /* compile for sparc processor */ #undef PA_BIG_ENDIAN /* parser uses this command instead of user-defined sendmail commands */ #undef PA_FORCED_SENDMAIL /* compile for intel processor or compatible */ #undef PA_LITTLE_ENDIAN /* disabled reading of files belonging to group+user other then effective */ #undef PA_SAFE_MODE /* one can throw from dynamic library */ #undef PA_WITH_SJLJ_EXCEPTIONS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Windows32 target platform */ #undef WIN32 /* has \$mail:received */ #undef WITH_MAILRECEIVE /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* xml-abled parser */ #undef XML /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t parser-3.4.3/src/include/Makefile.in000644 000000 000000 00000032466 11766635214 017421 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/pa_config_auto.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_version.h pa_pool.h pa_os.h pa_common.h pa_operation.h pa_request_charsets.h pa_request_info.h pa_array.h pa_cache_managers.h pa_charset.h pa_charsets.h pa_config_fixed.h pa_config_includes.h pa_dictionary.h pa_dir.h pa_exception.h pa_xml_exception.h pa_exec.h pa_globals.h pa_xml_io.h pa_hash.h pa_opcode.h pa_memory.h pa_request.h pa_sapi.h pa_socks.h pa_sql_connection.h pa_sql_driver_manager.h pa_stack.h pa_string.h pa_stylesheet_connection.h pa_stylesheet_manager.h pa_table.h pa_threads.h pa_types.h pa_uue.h pa_http.h pa_random.h all: pa_config_auto.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/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 $(am__aclocal_m4_deps): pa_config_auto.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/pa_config_auto.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/include/pa_config_auto.h $(srcdir)/pa_config_auto.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f pa_config_auto.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) pa_config_auto.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) pa_config_auto.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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) pa_config_auto.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) pa_config_auto.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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) pa_config_auto.h installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-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: parser-3.4.3/src/include/pa_request_charsets.h000644 000000 000000 00000002327 11730603272 021550 0ustar00rootwheel000000 000000 /** @file Parser: request charsets class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_REQUEST_CHARSETS_H #define PA_REQUEST_CHARSETS_H #define IDENT_PA_REQUEST_CHARSETS_H "$Id: pa_request_charsets.h,v 1.6 2012/03/16 09:24:10 moko Exp $" class Request_charsets { friend class Temp_client_charset; Charset *fsource; Charset *fclient; Charset *fmail; public: Request_charsets( Charset& asource, Charset& aclient, Charset& amail): fsource(&asource), fclient(&aclient), fmail(&amail) {} Charset& source() const { return *fsource; } void set_source(Charset& asource) { fsource=&asource; } Charset& client() const { return *fclient; } void set_client(Charset& aclient) { fclient=&aclient; } Charset& mail() const { return *fmail; } void set_mail(Charset& amail) { fmail=&amail; } }; class Temp_client_charset { Request_charsets& fcharsets; Charset &fclient; public: Temp_client_charset(Request_charsets& acharsets, Charset& aclient): fcharsets(acharsets), fclient(acharsets.client()) { fcharsets.set_client(aclient); } ~Temp_client_charset(){ fcharsets.set_client(fclient); } }; #endif parser-3.4.3/src/include/pa_operation.h000644 000000 000000 00000003612 11730603271 020161 0ustar00rootwheel000000 000000 /** @file Parser: compiled code related decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef OPERATION_H #define OPERATION_H #define IDENT_PA_OPERATION_H "$Id: pa_operation.h,v 1.8 2012/03/16 09:24:09 moko Exp $" #include "pa_array.h" #include "pa_opcode.h" #include "pa_value.h" // forwards union Operation; typedef Array ArrayOperation; /** Parser source code got compiled into intermediate form of Operation-s, which are executed afterwards. It is compiled into Array of Operation-s. Each Operation can be either OPCODE or data pointer, following the literal-instruction. - OP_VALUE followed by Origin, followed by Value* - OP_CURLY_CODE__STORE_PARAM followed by ArrayOperation* - OP_EXPR_CODE__STORE_PARAM followed by ArrayOperation* - OP_NESTED_CODE followed by ArrayOperation* */ union Operation { struct Origin { uint file_no:8; ///< file number (max: 255): index in Request::file_list uint line:8+8; ///< line number (max: 64535) uint col:8; ///< column number (max: 255) static Origin create(uint afile_no, uint aline, uint acol) { Origin result={afile_no, aline, acol}; return result; } }; OP::OPCODE code; ///< operation code Origin origin; ///< not an operation, but rather debug information: [OP_VALUE; debug_info; Value*] Value* value; ///< not an operation, but rather value stored after argumented op ArrayOperation* ops; ///< not an operation, but rather code array stored after argumented op /// needed to fill unused Array entries Operation() {} Operation(OP::OPCODE acode): code(acode) {} Operation(uint afile_no, uint aline, uint acol): origin(Origin::create(afile_no, aline, acol)) {} Operation(Value* avalue): value(avalue) {} Operation(ArrayOperation* aops): ops(aops) {} }; // defines #define OPERATIONS_PER_OPVALUE 3 #endif parser-3.4.3/src/include/pa_table.h000644 000000 000000 00000006234 11730603273 017255 0ustar00rootwheel000000 000000 /** @file Parser: table class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_TABLE_H #define PA_TABLE_H #define IDENT_PA_TABLE_H "$Id: pa_table.h,v 1.64 2012/03/16 09:24:11 moko Exp $" #include "pa_types.h" #include "pa_hash.h" #include "pa_string.h" /** VTable backend. holds: - column names[if any] - data rows - current row pointer uses String for column names and data items hence most of tables are "named", no need to uptimize nameless onces. rows and strings stored are read-only. once stored they can be removed, but not altered. that's handy for quick copying & co. see table:join */ class Table: public Array { public: typedef ArrayString* columns_type; Table( columns_type acolumns, size_t initial_rows=3); Table(const Table& src, Action_options& options); /// gets column names columns_type columns() { return fcolumns; } /// moves @a current pointer void set_current(size_t acurrent) { assert(acurrent==0 || acurrent=0?item(index):0; } /// saves to text file void save(bool nameless_save, const String& file_spec); template void table_for_each(void (*func)(Table& self, I* info), I* info, Action_options& o) { if(!o.adjust(count())) return; size_t saved_current=current(); size_t row=o.offset; if(o.reverse) { // reverse for(size_t i=0; i bool table_first_that(bool (*func)(Table& self, I info), I info, Action_options& o) { if(!o.adjust(count())) return false; size_t saved_current=current(); size_t row=o.offset; if(o.reverse) { // reverse for(size_t i=0; inumber lookup table typedef HashString name2number_hash_class; name2number_hash_class* name2number; /// is that @c index falid? bool valid(size_t index) const { return index (http://paf.design.ru) when used Configure [HAVE_CONFIG_H] it uses defines from Configure, fixed otherwise. */ #ifndef PA_CONFIG_INCLUDES_H #define PA_CONFIG_INCLUDES_H #if HAVE_CONFIG_H # include "pa_config_auto.h" #else # include "pa_config_fixed.h" #endif // AC_INCLUDES_DEFAULT #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STDDEF_H # include #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif // other includes #ifdef HAVE_ASSERT_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #ifdef HAVE_CTYPE_H # include #endif #ifdef HAVE_MATH_H # include #endif #ifdef HAVE_PROCESS_H # include #endif #ifdef HAVE_STDARG_H # include #endif #ifdef HAVE_SETJMP_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_DIRENT_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_IO_H # include #endif #ifdef HAVE_SYS_FILE_H # include #endif #ifdef HAVE_SYS_LOCKING_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_NETDB_H # include #endif #if TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif // math function replacements #ifdef __cplusplus #ifndef HAVE_TRUNC inline double trunc(double param) { return param > 0? floor(param) : ceil(param); } #endif #ifndef HAVE_ROUND inline double round(double param) { return floor(param+0.5); } #endif #ifndef HAVE_SIGN inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); } #endif #if !defined(max) inline int max(int a, int b) { return a>b?a:b; } inline int min(int a, int b){ return ab?a:b; } inline size_t min(size_t a, size_t b){ return a (http://paf.design.ru) */ #ifndef PA_REQUEST_INFO_H #define PA_REQUEST_INFO_H #define IDENT_PA_REQUEST_INFO_H "$Id: pa_request_info.h,v 1.7 2012/03/16 09:24:10 moko Exp $" /// some information from web server class Request_info { public: //@{ these filled by Request class user const char* document_root; const char* path_translated; const char* method; const char* query_string; const char* uri; const char* content_type; size_t content_length; const char* cookie; char** argv; int args_skip; bool mail_received; //@} //@{ these are filed by Request class itself: user's post data const char* post_data; size_t post_size; //@} }; #endif parser-3.4.3/src/include/pa_memory.h000644 000000 000000 00000010631 12173522573 017477 0ustar00rootwheel000000 000000 /** @file Parser: memory reference counting classes decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_MEMORY_H #define PA_MEMORY_H #define IDENT_PA_MEMORY_H "$Id: pa_memory.h,v 1.20 2013/07/23 15:47:07 moko Exp $" // include #include "pa_config_includes.h" #include "gc.h" // define destructors use for Array, Hash and VMethodFrame #define USE_DESTRUCTORS inline void* pa_gc_malloc(size_t size) { return GC_MALLOC(size); } inline void* pa_gc_malloc_atomic(size_t size) { return GC_MALLOC_ATOMIC(size); } inline void* pa_gc_realloc(void* ptr, size_t size) { return GC_REALLOC(ptr, size); } inline void pa_gc_free(void* ptr) { GC_FREE(ptr); } // forwards void *pa_fail_alloc(const char* what, size_t size); // inlines inline void *pa_malloc(size_t size) { if(void *result=pa_gc_malloc(size)) return result; return pa_fail_alloc("allocate", size); } inline void *pa_malloc_atomic(size_t size) { if(void *result=pa_gc_malloc_atomic(size)) return result; return pa_fail_alloc("allocate clean", size); } /// @a length may be null, which mean "autocalc it" inline char *pa_strdup(const char* auto_variable_never_null, size_t helper_length=0) { size_t known_length= helper_length ? helper_length : strlen(auto_variable_never_null); size_t size=known_length+1; if(char *result=static_cast(pa_gc_malloc_atomic(size))) { memcpy(result, auto_variable_never_null, known_length); result[known_length]=0; return result; } return static_cast(pa_fail_alloc("allocate clean", size)); } inline void pa_free(void *ptr) { pa_gc_free(ptr); } inline void *pa_realloc(void *ptr, size_t size) { if(void *result=pa_gc_realloc(ptr, size)) return result; return pa_fail_alloc("reallocate to", size); } //{@ these operators can be used from stl. to be on a safe side, assume that data may contain pointers inline void *operator new[] (size_t size) { return pa_malloc(size); } inline void *operator new(size_t size) { return pa_malloc(size); } //}@ #define UseGC ((int)1) #define PointerFreeGC (true) //{@ Array-oriented inline void *operator new[] (size_t size, int) { // UseGC return pa_malloc(size); } inline void *operator new[] (size_t size, bool) { // PointerFreeGC return pa_malloc_atomic(size); } inline void operator delete[] (void *ptr) { pa_free(ptr); } //}@ //{@ Structure-oriented inline void *operator new (size_t size, int) { // UseGC return pa_malloc(size); } inline void *operator new (size_t size, bool) { // PointerFreeGC return pa_malloc_atomic(size); } inline void operator delete(void *ptr) { pa_free(ptr); } //}@ /// memory allocation/dallocation goes via pa_malloc/pa_free. class PA_Allocated { public: /// the sole: instances allocated using our functions static void *operator new(size_t size) { return pa_malloc(size); } static void operator delete(void *ptr) { pa_free(ptr); } static void *malloc(size_t size) { return pa_malloc(size); } static void *malloc_atomic(size_t size) { return pa_malloc_atomic(size); } static char *strdup(const char* auto_variable_never_null, size_t helper_length=0) { return pa_strdup(auto_variable_never_null, helper_length); } static void free(void *ptr) { pa_free(ptr); } static void *realloc(void *ptr, size_t size) { return pa_realloc(ptr, size); } private: // disabled from accidental use /// use malloc/malloc_atomic instead [GC clears result of those] static void *calloc(size_t size); }; /// Those who want their destructor called during finalization, must derive from this class [also] class PA_Cleaned { #ifndef PA_DEBUG_DISABLE_GC static void cleanup( void* obj, void* displ ) { ((PA_Cleaned*) ((char*) obj + (ptrdiff_t) displ))->~PA_Cleaned(); } public: PA_Cleaned() { GC_finalization_proc oldProc; void* oldData; void* base = GC_base( (void *) this ); if (0 != base) { // Don't call the debug version, since this is a real base address. GC_register_finalizer_ignore_self( base, (GC_finalization_proc)cleanup, (void*) ((char*) this - (char*) base), &oldProc, &oldData ); if (0 != oldProc) { GC_register_finalizer_ignore_self( base, oldProc, oldData, 0, 0 ); } } } virtual ~PA_Cleaned() { GC_REGISTER_FINALIZER_IGNORE_SELF( GC_base(this), 0, 0, 0, 0 ); } #endif }; /// Base for all Parser classes typedef PA_Allocated PA_Object; // defines #define override #define rethrow throw #endif parser-3.4.3/src/include/Makefile.am000644 000000 000000 00000001056 11136743516 017373 0ustar00rootwheel000000 000000 noinst_HEADERS = pa_version.h pa_pool.h pa_os.h pa_common.h pa_operation.h pa_request_charsets.h pa_request_info.h pa_array.h pa_cache_managers.h pa_charset.h pa_charsets.h pa_config_fixed.h pa_config_includes.h pa_dictionary.h pa_dir.h pa_exception.h pa_xml_exception.h pa_exec.h pa_globals.h pa_xml_io.h pa_hash.h pa_opcode.h pa_memory.h pa_request.h pa_sapi.h pa_socks.h pa_sql_connection.h pa_sql_driver_manager.h pa_stack.h pa_string.h pa_stylesheet_connection.h pa_stylesheet_manager.h pa_table.h pa_threads.h pa_types.h pa_uue.h pa_http.h pa_random.h parser-3.4.3/src/include/pa_version.h000644 000000 000000 00000000230 12232036565 017643 0ustar00rootwheel000000 000000 /* specified manually on Windows [automaticaly set on Unix] */ #ifndef PARSER_VERSION #define PARSER_VERSION "3.4.3 (compiled on i386-pc-win32)" #endif parser-3.4.3/src/include/pa_charset.h000644 000000 000000 00000013563 12227331510 017614 0ustar00rootwheel000000 000000 /** @file Parser: Charset connection decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_CHARSET_H #define PA_CHARSET_H #define IDENT_PA_CHARSET_H "$Id: pa_charset.h,v 1.52 2013/10/15 21:27:36 moko Exp $" #include "pa_exception.h" #include "pa_common.h" #include "pa_hash.h" #include "pa_array.h" #include "pcre.h" // we are using some pcre_internal.h stuff as well #include "../lib/pcre/pa_pcre_internal.h" #ifdef XML #include "libxml/encoding.h" #endif // defines #define MAX_CHARSETS 10 #define MAX_CHARSET_UNI_CODES 500 #ifndef XMLCh typedef unsigned int XMLCh; #endif #ifndef XMLByte typedef unsigned char XMLByte; #endif // helpers typedef HashString HashStringString; /** charset holds name & transcode tables registers libxml transcoders */ class Charset: public PA_Object { public: Charset(Request_charsets* charsets, const String::Body ANAME, const String* afile_spec); const String::Body NAME() const { return FNAME; } const char* NAME_CSTR() const { return FNAME_CSTR; } bool isUTF8() const { return fisUTF8; } static String::C transcode(const String::C src, const Charset& source_charset, const Charset& dest_charset); static String& transcode(const String& src, const Charset& source_transcoder, const Charset& dest_transcoder); static String::Body transcode(const String::Body src, const Charset& source_transcoder, const Charset& dest_transcoder); static void transcode(ArrayString& src, const Charset& source_transcoder, const Charset& dest_transcoder); static void transcode(HashStringString& src, const Charset& source_transcoder, const Charset& dest_transcoder); static String::C escape(const String::C src, const Charset& source_charset); static String::Body escape(const String::Body src, const Charset& source_charset); static String& escape(const String& src, const Charset& source_charset); static String::C escape_JSON(const String::C src, const Charset& source_charset); static String::Body escape_JSON(const String::Body src, const Charset& source_charset); static String& escape_JSON(const String& src, const Charset& source_charset); void store_Char(XMLByte*& outPtr, XMLCh src, XMLByte not_found); #ifdef XML xmlCharEncodingHandler& transcoder(const String::Body NAME); #endif public: unsigned char pcre_tables[tables_length]; private: void load_definition(Request_charsets& charsets, const String& afile_spec); void sort_ToTable(); const String::C transcodeToUTF8(const String::C src) const; const String::C transcodeFromUTF8(const String::C src) const; const String::C transcodeToCharset(const String::C src, const Charset& dest_transcoder) const; public: struct Tables { struct Rec { XMLCh intCh; XMLByte extCh; }; XMLCh fromTable[0x100]; Rec toTable[MAX_CHARSET_UNI_CODES]; uint toTableSize; }; struct UTF8CaseTable { struct Rec { XMLCh from, to; }; uint size; Rec* records; }; private: const String::Body FNAME; char* FNAME_CSTR; bool fisUTF8; Tables tables; static size_t calc_escaped_length_UTF8(XMLByte* src, size_t src_length); static size_t calc_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables); static size_t calc_escaped_length(const String::C src, const Charset& source_charset); static size_t escape_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest); static size_t escape(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables); static size_t calc_JSON_escaped_length_UTF8(XMLByte* src, size_t src_length); static size_t calc_JSON_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables); static size_t calc_JSON_escaped_length(const String::C src, const Charset& source_charset); static size_t escape_JSON_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest); static size_t escape_JSON(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables); #ifdef XML private: void addEncoding(char* name_cstr); void initTranscoder(const String::Body name, const char* name_cstr); public: /// converts xmlChar* null-terminated string to char* String::C transcode_cstr(const xmlChar* s); /// converts xmlChar* null-terminated string to parser String const String& transcode(const xmlChar* s); /** converts sized char* to xmlChar* @returns xmlChar* WHICH CALLER SHOULD FREE */ xmlChar* transcode_buf2xchar(const char* buf, size_t buf_size); /// converts parser String to xmlChar* xmlChar* transcode(const String& s); /// converts parser String::Body to xmlChar* xmlChar* transcode(const String::Body s); private: xmlCharEncodingHandler* ftranscoder; #endif }; // externs extern Charset::UTF8CaseTable UTF8CaseToUpper; extern Charset::UTF8CaseTable UTF8CaseToLower; void change_case_UTF8(const XMLByte* srcData, size_t srcLen, XMLByte* toFill, size_t toFillLen, const Charset::UTF8CaseTable& table); size_t getUTF8BytePos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t charPos/*position in characters*/); size_t getUTF8CharPos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t bytePos/*position in bytes*/); size_t lengthUTF8(const XMLByte* srcBegin, const XMLByte* srcEnd); unsigned int lengthUTF8Char(const XMLByte c); const char *fixUTF8(const char *src); class UTF8_string_iterator { public: UTF8_string_iterator(const String& astring): fsrcPtr((XMLByte*)astring.cstr()), fsrcEnd(fsrcPtr + astring.length()) {} UTF8_string_iterator(XMLByte* asrcPtr, size_t length): fsrcPtr(asrcPtr), fsrcEnd(fsrcPtr + length) {} bool has_next(); XMLCh next() { return fUTF8Char; } XMLByte getFirstByte(){ return ffirstByte; } size_t getCharSize(){ return fcharSize; } private: const XMLByte* fsrcPtr; const XMLByte* fsrcEnd; size_t fcharSize; XMLByte ffirstByte; XMLCh fUTF8Char; }; #endif parser-3.4.3/src/include/pa_types.h000644 000000 000000 00000001532 11730603273 017326 0ustar00rootwheel000000 000000 /** @file Parser: generally used types & constants decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_TYPES_H #define PA_TYPES_H #define IDENT_PA_TYPES_H "$Id: pa_types.h,v 1.51 2012/03/16 09:24:11 moko Exp $" #include "pa_config_includes.h" /// for rare cases of undefined length using this-sized strings #define MAX_STRING 0x400 /// buffer size for parser.log #define MAX_LOG_STRING 0x400*4 /// for snprintf(buf, MAX_NUMBER, "%.2f") #define MAX_NUMBER 40 //{@ handy types #undef uchar typedef unsigned char uchar; #undef ushort typedef unsigned short ushort; #undef uint typedef unsigned int uint; #undef ulong typedef unsigned long ulong; //}@ /// max value of integral type #define max_integral(type) ((1< (http://paf.design.ru) */ #ifndef PA_ARRAY_H #define PA_ARRAY_H #define IDENT_PA_ARRAY_H "$Id: pa_array.h,v 1.81 2012/03/16 09:24:08 moko Exp $" // includes #include "pa_memory.h" #include "pa_exception.h" // forwards template class Array_iterator; // defines #define ARRAY_OPTION_LIMIT_ALL ((size_t)-1) /// Simple Array template class Array: public PA_Object { friend class Array_iterator; protected: /// elements[growing size] here T *felements; // allocated size size_t fallocated; // array size size_t fused; public: struct Action_options { size_t offset; size_t limit; //< ARRAY_OPTION_LIMIT_ALL means 'all'. zero limit means 'nothing' bool reverse; bool defined; Action_options( size_t aoffset=0, size_t alimit=ARRAY_OPTION_LIMIT_ALL, bool areverse=false): offset(aoffset), limit(alimit), reverse(areverse), defined(false) {} bool adjust(size_t count) { if(!count || !limit) return false; if(offset>=count) return false; // max(limit) size_t m=reverse? offset+1 :count-offset; if(!m) return false; // fix limit if(limit==ARRAY_OPTION_LIMIT_ALL || limit>m) limit=m; return true; } }; typedef T element_type; inline Array(size_t initial=0): fallocated(initial), fused(0) { felements=fallocated?(T *)pa_malloc(fallocated*sizeof(T)):0; } #ifdef USE_DESTRUCTORS inline ~Array(){ if(felements) pa_free(felements); } #endif /// how many items are in Array inline size_t count() const { return fused; } /// append to array inline Array& operator+=(T src) { if(is_full()) expand(fallocated>0? 2+fallocated/32 : 3); // 3 is PAF default, confirmed by tests felements[fused++]=src; return *this; } /// append other Array portion to this one. starting from offset Array& append(const Array& src, size_t offset=0, size_t limit=ARRAY_OPTION_LIMIT_ALL, //< negative limit means 'all'. zero limit means 'nothing' bool reverse=false) { size_t src_count=src.count(); // skip tivials if(!src_count || !limit || offset>=src_count) return *this; // max(limit) size_t m=reverse? 1+offset :src_count-offset; if(!m) return *this; // fix limit if(limit==ARRAY_OPTION_LIMIT_ALL || limit>m) limit=m; ssize_t delta=reverse? (ssize_t)limit :limit-(fallocated-fused); if(delta>0) expand(delta); T* from=&src.felements[offset]; T* to=&felements[fused]; if(reverse) { // reverse for(T* from_end=from-limit; from>from_end; --from) *to++=*from; } else { // forward for(T* from_end=from+limit; from void for_each(void (*callback)(T, I), I info) const { T *last=felements+fused; for(T *current=felements; current void for_each(bool (*callback)(T, I), I info) const { T *last=felements+fused; for(T *current=felements; current void for_each_ref(void (*callback)(T&, I), I info) { T *last=felements+fused; for(T *current=felements; current T first_that(bool (*callback)(T, I), I info) const { T *last=felements+fused; for(T *current=felements; current a; for(Array_iterator i(a); i.has_next(); ) { T& element=i.next(); ... } @endcode */ template class Array_iterator { const Array& farray; T *fcurrent; T *flast; public: Array_iterator(const Array& aarray): farray(aarray) { fcurrent=farray.felements; flast=farray.felements+farray.count(); } /// there are still elements bool has_next() { return fcurrent (http://paf.design.ru) */ #ifndef PA_CACHE_MANAGERS_H #define PA_CACHE_MANAGERS_H #define IDENT_PA_CACHE_MANAGERS_H "$Id: pa_cache_managers.h,v 1.20 2012/03/16 09:24:08 moko Exp $" #include "pa_hash.h" #include "pa_value.h" // defines /// can return status and can expire it contents class Cache_manager: public PA_Object { public: /// if filter_server_id not null, returns status only Cachable -s with matching cacheable_item_server_id() virtual Value* get_status() =0; virtual void maybe_expire_cache() {} virtual ~Cache_manager() {} }; /// maintains name=>Cache_manager association, can expire its contents class Cache_managers: public HashString { public: Cache_managers(); virtual ~Cache_managers(); /// maybe-expires all caches it contains, each cache manager desides it itself void maybe_expire(); }; /// global extern Cache_managers* cache_managers; #endif parser-3.4.3/src/include/pa_stylesheet_manager.h000644 000000 000000 00000003321 11730603273 022043 0ustar00rootwheel000000 000000 /** @file Parser: Stylesheet manager decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) global sql driver manager, must be thread-safe */ #ifndef PA_STYLESHEET_MANAGER_H #define PA_STYLESHEET_MANAGER_H #define IDENT_PA_STYLESHEET_MANAGER_H "$Id: pa_stylesheet_manager.h,v 1.24 2012/03/16 09:24:11 moko Exp $" #include "pa_hash.h" #include "pa_table.h" #include "pa_cache_managers.h" #include "pa_stack.h" #include "pa_stylesheet_connection.h" /** XSLT stylesheet driver manager maintains stylesheet cache expiring unused stylesheets */ class Stylesheet_manager: public Cache_manager { friend class Stylesheet_connection; public: Stylesheet_manager(); override ~Stylesheet_manager(); /** check for disk update of "{file_spec}" or "{file_spec}.stamp", if not updated return cached version[if any] otherwise load/compile/return */ Stylesheet_connection_ptr get_connection(String::Body file_spec); private: // cache Stylesheet_connection* get_connection_from_cache(String::Body file_spec); void put_connection_to_cache(String::Body file_spec, Stylesheet_connection& connection); private: time_t prev_expiration_pass_time; private: // for stylesheet /// caches connection void close_connection(String::Body file_spec, Stylesheet_connection& connection); public: typedef Stack connection_cache_value_type; typedef HashString connection_cache_type; private: connection_cache_type connection_cache; public: // Cache_manager override Value* get_status(); override void maybe_expire_cache(); }; /// global extern Stylesheet_manager* stylesheet_manager; #endif parser-3.4.3/src/include/pa_dictionary.h000644 000000 000000 00000002535 11730603271 020331 0ustar00rootwheel000000 000000 /** @file Parser: dictionary class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_DICTIONARY_H #define PA_DICTIONARY_H #define IDENT_PA_DICTIONARY_H "$Id: pa_dictionary.h,v 1.20 2012/03/16 09:24:09 moko Exp $" #include "pa_table.h" /// simple dictionary, speding up lookups on contained two columned table class Dictionary: public PA_Object { public: struct Subst { const char *from; size_t from_length; const String* to; Subst(int): from(0) {} Subst(const char* afrom, const String* ato): from(afrom), to(ato) { from_length=strlen(afrom); } operator bool() { return from!=0; } }; /// construct wrapper, grabbing first letters of first column into @b first Dictionary(Table& atable); /// construct simple dictionary within a single pair only Dictionary(const String& from, const String& to); /// find first row that contains string in first column which starts @b src Subst first_that_begins(const char* str) const; private: Array substs; private: void append_subst(const String* from, const String* to, const char* exception=0); int starting_line_of[0x100]; int constructor_line; public: size_t count() const { return substs.count(); } Subst get(size_t index) const { return substs.get(index); } }; #endif parser-3.4.3/src/include/pa_socks.h000644 000000 000000 00000000666 11730603272 017312 0ustar00rootwheel000000 000000 /** @file Parser: socks initialization/finalization decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_SOCKS_H #define PA_SOCKS_H #define IDENT_PA_SOCKS_H "$Id: pa_socks.h,v 1.18 2012/03/16 09:24:10 moko Exp $" void pa_socks_init(); void pa_socks_done(); int pa_socks_errno(); const char* pa_socks_strerr(int no); #endif parser-3.4.3/src/include/pa_charsets.h000644 000000 000000 00000001355 11730603271 017777 0ustar00rootwheel000000 000000 /** @file Parser: sql driver manager decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) global sql driver manager, must be thread-safe */ #ifndef PA_CHARSETS_H #define PA_CHARSETS_H #define IDENT_PA_CHARSETS_H "$Id: pa_charsets.h,v 1.15 2012/03/16 09:24:09 moko Exp $" #include "pa_hash.h" #include "pa_charset.h" /// convention: use UPPERCASE keys class Charsets: public HashString { public: Charsets(); Charset& get(const String::Body ANAME); void load_charset(Request_charsets& charsets, const String::Body ANAME, const String& afile_spec); }; //@{ globals extern Charset UTF8_charset; extern Charsets charsets; //@} #endif parser-3.4.3/src/include/pa_os.h000644 000000 000000 00000001610 11730603271 016576 0ustar00rootwheel000000 000000 /** @file Parser: commonly used functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_OS_H #define PA_OS_H #define IDENT_PA_OS_H "$Id: pa_os.h,v 1.8 2012/03/16 09:24:09 moko Exp $" #define PA_LOCK_ATTEMPTS 20 #define PA_LOCK_WAIT_TIMEOUT_SECS 0 #define PA_LOCK_WAIT_TIMEOUT_USECS 500000 // 'blocking' mean we will wait till other process release lock // but we'll make PA_LOCK_ATTEMPTS attempts with PA_LOCK_WAIT_TIMEOUT secs delaus between attempts // 'nonblocking' mean we will make only 1 attempt without waiting int pa_lock_shared_blocking(int fd); int pa_lock_exclusive_blocking(int fd); int pa_lock_exclusive_nonblocking(int fd); int pa_unlock(int fd); /// yields to OS for secs secs and usecs microseconds (1E-6) int pa_sleep(unsigned long secs, unsigned long usecs); #endif parser-3.4.3/src/include/pa_common.h000644 000000 000000 00000022011 12227057562 017453 0ustar00rootwheel000000 000000 /** @file Parser: commonly used functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_COMMON_H #define PA_COMMON_H #define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.155 2013/10/14 21:17:38 moko Exp $" #include "pa_string.h" #include "pa_hash.h" class Request; // defines #define HTTP_USER_AGENT "user-agent" #define HTTP_STATUS "status" #define HTTP_STATUS_CAPITALIZED "Status" #define HTTP_CONTENT_LENGTH "content-length" #define HTTP_CONTENT_LENGTH_CAPITALIZED "Content-Length" #define HTTP_CONTENT_TYPE "content-type" #define HTTP_CONTENT_TYPE_UPPER "CONTENT-TYPE" #define HTTP_CONTENT_TYPE_CAPITALIZED "Content-Type" #define HTTP_CONTENT_TYPE_FORM_URLENCODED "application/x-www-form-urlencoded" #define HTTP_CONTENT_TYPE_MULTIPART_FORMDATA "multipart/form-data" #define HTTP_CONTENT_TYPE_MULTIPART_RELATED "multipart/related" #define HTTP_CONTENT_TYPE_MULTIPART_MIXED "multipart/mixed" #define CONTENT_TRANSFER_ENCODING_NAME "content-transfer-encoding" #define CONTENT_TRANSFER_ENCODING_CAPITALIZED "Content-Transfer-Encoding" #define CONTENT_DISPOSITION "content-disposition" #define CONTENT_DISPOSITION_CAPITALIZED "Content-Disposition" #define CONTENT_DISPOSITION_ATTACHMENT "attachment" #define CONTENT_DISPOSITION_INLINE "inline" #define CONTENT_DISPOSITION_FILENAME_NAME "filename" #define BASE64_STRICT_OPTION_NAME "strict" const String http_content_type(HTTP_CONTENT_TYPE); const String content_transfer_encoding_name(CONTENT_TRANSFER_ENCODING_NAME); const String content_disposition(CONTENT_DISPOSITION); const String content_disposition_inline(CONTENT_DISPOSITION_INLINE); const String content_disposition_attachment(CONTENT_DISPOSITION_ATTACHMENT); const String content_disposition_filename_name(CONTENT_DISPOSITION_FILENAME_NAME); #define HASH_ORDER #ifdef HASH_ORDER #undef PA_HASH_CLASS #include "pa_hash.h" #endif class Value; typedef HASH_STRING HashStringValue; // replace system s*nprintf with our versions #undef vsnprintf int __vsnprintf(char *, size_t, const char* , va_list); #define vsnprintf __vsnprintf #undef snprintf int __snprintf(char *, size_t, const char* , ...); #define snprintf __snprintf #ifdef _MSC_VER //access #define F_OK 0 #define X_OK 1 #define W_OK 2 #define R_OK 4 #ifndef strcasecmp # define strcasecmp _stricmp #endif #endif /** file related functions */ #define FILE_BUFFER_SIZE 4096 int pa_lock_shared_blocking(int fd); int pa_lock_exclusive_blocking(int fd); int pa_lock_exclusive_nonblocking(int fd); int pa_unlock(int fd); void create_dir_for_file(const String& file_spec); int pa_get_valid_file_options_count(HashStringValue& options); typedef void (*File_read_action)( struct stat& finfo, int f, const String& file_spec, const char* fname, bool as_text, void *context); /** shared-lock specified file, do actions under lock. if fail_on_read_problem is true[default] throws an exception @returns true if read OK */ bool file_read_action_under_lock(const String& file_spec, const char* action_name, File_read_action action, void *context, bool as_text=false, bool fail_on_read_problem=true); /** read specified text file using if fail_on_read_problem is true[default] throws an exception WARNING: charset is used for http header case conversion, it's not a charset of input file! */ char *file_read_text(Request_charsets& charsets, const String& file_spec, bool fail_on_read_problem=true, HashStringValue* options=0, bool transcode_result=true); char *file_load_text(Request& r, const String& file_spec, bool fail_on_read_problem=true, HashStringValue* options=0, bool transcode_result=true); struct File_read_result { bool success; char* str; size_t length; HashStringValue* headers; }; /** read specified file using if fail_on_read_problem is true[default] throws an exception WARNING: charset is used for http header case conversion, it's not a charset of input file! */ File_read_result file_read(Request_charsets& charsets, const String& file_spec, bool as_text, HashStringValue* options=0, bool fail_on_read_problem=true, char* buf=0, size_t offset=0, size_t size=0, bool transcode_text_result=true); File_read_result file_load(Request& r, const String& file_spec, bool as_text, HashStringValue* options=0, bool fail_on_read_problem=true, char* buf=0, size_t offset=0, size_t size=0, bool transcode_text_result=true); typedef void (*File_write_action)(int f, void *context); /** lock specified file exclusively, do actions under lock. throws an exception in case of problems if block=false does non-blocking lock @returns true if locked OK, or false if non-blocking locking failed */ bool file_write_action_under_lock( const String& file_spec, const char* action_name, File_write_action action, void *context, bool as_text=false, bool do_append=false, bool do_block=true, bool fail_on_lock_problem=true); /** write data to specified file, throws an exception in case of problems */ void file_write( Request_charsets& charsets, const String& file_spec, const char* data, size_t size, bool as_text, bool do_append=false, Charset* asked_charset=0); /** delete specified file throws an exception in case of problems */ bool file_delete(const String& file_spec, bool fail_on_problem=true, bool keep_empty_dirs=false); /** move specified file throws an exception in case of problems */ void file_move(const String& old_spec, const String& new_spec, bool keep_empty_dirs=false); bool entry_exists(const char* fname, struct stat *afinfo=0); bool entry_exists(const String& file_spec); bool file_exist(const String& file_spec); bool dir_exists(const String& file_spec); const String* file_exist(const String& path, const String& name); bool file_executable(const String& file_spec); bool file_stat(const String& file_spec, size_t& rsize, time_t& ratime, time_t& rmtime, time_t& rctime, bool fail_on_read_problem=true); size_t stdout_write(const void *buf, size_t size); void check_safe_mode(struct stat finfo, const String& file_spec, const char* fname); int file_block_read(const int f, unsigned char* buffer, const size_t size); /** String related functions */ const char* capitalize(const char* s); /** under WIN32 "t" mode fixes DOS chars OK, can't say that about other systems/ line break styles */ void fix_line_breaks(char *str, size_t& length /* < may change! used to speedup next actions */); char *getrow(char **row_ref,char delim='\n'); char *lsplit(char *string, char delim); char *lsplit(char **string_ref,char delim); char *rsplit(char *string, char delim); const char* format(double value, const char *fmt); char* unescape_chars(const char* cp, int len, Charset* client_charset=0, bool js=false/*true==decode \uXXXX and don't convert '+' to space*/); char *search_stop(char*& current, char cstop_at); #ifdef WIN32 void back_slashes_to_slashes(char *s); #endif bool StrStartFromNC(const char* str, const char* substr, bool equal=false); size_t strpos(const char *str, const char *substr); int remove_crlf(char *start, char *end); inline bool pa_isalpha(unsigned char c) { return (((c>='A') && (c<='Z')) || ((c>='a') && (c<='z'))); } inline bool pa_isalnum(unsigned char c) { return (((c>='0') && (c<='9')) || pa_isalpha(c)); } const char* hex_string(unsigned char* bytes, size_t size, bool upcase); extern const char* hex_digits; void pa_base64_decode(const char *in, size_t in_size, char*& result, size_t& result_size, bool strict=false); char* pa_base64_encode(const char *in, size_t in_size); char* pa_base64_encode(const String& file_spec); const unsigned long pa_crc32(const char *in, size_t in_size); const unsigned long pa_crc32(const String& file_spec); /** Mix functions */ // some stuff for use with .for_each static void copy_all_overwrite_to( HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue* dest) { dest->put(key, value); } static void remove_key_from( HashStringValue::key_type key, HashStringValue::value_type /*value*/, HashStringValue* dest) { dest->remove(key); } Charset* detect_charset(const char* content_type); #define SECS_PER_DAY (60*60*24) int getMonthDays(int year, int month); String::C date_gmt_string(tm* tms); // globals extern const String file_status_name; // global defines for file options which are handled but not checked elsewhere, we check them #define PA_SQL_LIMIT_NAME "limit" #define PA_SQL_OFFSET_NAME "offset" #define PA_COLUMN_SEPARATOR_NAME "separator" #define PA_COLUMN_ENCLOSER_NAME "encloser" #define PA_CHARSET_NAME "charset" #define PA_RESPONSE_CHARSET_NAME "response-charset" // globals defines for sql options #define SQL_BIND_NAME "bind" #define SQL_DEFAULT_NAME "default" #define SQL_DISTINCT_NAME "distinct" #define SQL_VALUE_TYPE_NAME "type" #ifndef DOXYGEN enum Table2hash_distint { D_ILLEGAL, D_FIRST }; enum Table2hash_value_type { C_HASH, C_STRING, C_TABLE }; #endif #endif parser-3.4.3/src/include/pa_http.h000644 000000 000000 00000001573 12173450422 017144 0ustar00rootwheel000000 000000 /** @file Parser: commonly used functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_HTTP_H #define PA_HTTP_H #define IDENT_PA_HTTP_H "$Id: pa_http.h,v 1.13 2013/07/23 09:46:58 moko Exp $" #include "pa_vstring.h" #include "pa_vint.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_socks.h" #include "pa_request.h" #define HTTP_COOKIES_NAME "cookies" #ifndef DOXYGEN struct File_read_http_result { char *str; size_t length; HashStringValue* headers; }; #endif Table* parse_cookies(Request& r, Table *cookies); char *pa_http_safe_header_name(const char *name); File_read_http_result pa_internal_file_read_http(Request& r, const String& file_spec, bool as_text, HashStringValue *options=0, bool transcode_text_result=true); #endif parser-3.4.3/src/include/pa_exception.h000644 000000 000000 00000004637 12171260600 020162 0ustar00rootwheel000000 000000 /** @file Parser: exception decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_EXCEPTION_H #define PA_EXCEPTION_H #define IDENT_PA_EXCEPTION_H "$Id: pa_exception.h,v 1.64 2013/07/16 15:06:40 moko Exp $" const char* const PARSER_RUNTIME = "parser.runtime"; const char* const IMAGE_FORMAT = "image.format"; const char* const PCRE_EXCEPTION_TYPE = "pcre.execute"; const char* const DATE_RANGE_EXCEPTION_TYPE = "date.range"; const char* const BASE64_FORMAT = "base64.format"; const char* const NAME_MUST_BE_STRING = "name must be string"; const char* const FILE_NAME_MUST_BE_STRING = "file name must be string"; const char* const VALUE_MUST_BE_STRING = "value must be string"; const char* const PARAMETER_MUST_BE_STRING = "parameter must be string"; const char* const COLUMN_NAME_MUST_BE_STRING = "column name must be string"; const char* const FILE_NAME_MUST_BE_SPECIFIED = "file name must be specified"; const char* const FILE_NAME_MUST_NOT_BE_CODE = "file name must not be code"; const char* const FIRST_ARG_MUST_NOT_BE_CODE = "first argument must not be code"; const char* const PARAM_MUST_NOT_BE_CODE = "param must not be code"; const char* const PARAM_MUST_BE_HASH = "param must be hash"; const char* const MODE_MUST_NOT_BE_CODE = "mode must not be code"; const char* const OPTIONS_MUST_NOT_BE_CODE = "options must not be code"; const char* const CALLED_WITH_INVALID_OPTION = "called with invalid option"; // includes #include "pa_memory.h" // forwards class String; // defines class Exception { public: Exception(); Exception( const char* atype, const String* aproblem_source, const char* comment_fmt, ...); Exception(const Exception& src); operator bool() { return ftype || fproblem_source || fcomment; } Exception& operator =(const Exception& src); /// extracts exception type const char* type(bool can_be_empty=false) const { if(can_be_empty) return ftype; else return ftype?ftype:""; } /// extracts exception problem_source const String* problem_source() const; /// extracts exception comment const char* comment(bool can_be_empty=false) const { const char* result=fcomment && *fcomment?fcomment:0; if(can_be_empty) return result; else return result?result:""; } protected: const char* ftype; const String* fproblem_source; const char* fcomment; }; #endif parser-3.4.3/src/include/pa_globals.h000644 000000 000000 00000002110 12165633045 017601 0ustar00rootwheel000000 000000 /** @file Parser: global decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_GLOBALS_H #define PA_GLOBALS_H #define IDENT_PA_GLOBALS_H "$Id: pa_globals.h,v 1.115 2013/07/05 21:09:57 moko Exp $" #ifdef XML # include "libxml/tree.h" #endif class Request; /// initialize global variables void pa_globals_init(); /// finalize global variables void pa_globals_done(); /// for lt_dlinit to be called once void pa_dlinit(); /// hex_value[c] = hex value of c extern short hex_value[0x100]; #ifdef XML /// flag whether there were some xml generic errors on current thread bool xmlHaveGenericErrors(); /// get xml generic error accumulated for current thread. WARNING: it is up to caller to free up const char* xmlGenericErrors(); #endif /// register request for local thread to retrive later with pa_get_request() void pa_register_thread_request(Request&); /// retrives request set by pa_set_request function, useful in contextless places [slow] Request& pa_thread_request(); #endif parser-3.4.3/src/include/pa_exec.h000644 000000 000000 00000001540 11730603271 017103 0ustar00rootwheel000000 000000 /** @file Parser: program executing for different OS-es decls. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_EXEC_H #define PA_EXEC_H #define IDENT_PA_EXEC_H "$Id: pa_exec.h,v 1.20 2012/03/16 09:24:09 moko Exp $" #include "pa_string.h" #include "pa_hash.h" #include "pa_array.h" #include "pa_value.h" #include "pa_charset.h" struct PA_exec_result { int status; ///< exit code File_read_result out; String& err; PA_exec_result(): status(0), out(), err(*new String) {} }; PA_exec_result pa_exec( bool forced_allow, ///< allow execution regardles of --disable-execs const String& file_spec, const HashStringString* env, ///< 0 | Hash of String const ArrayString& argv, ///< 0 | Array of command line arguments String& in); #endif parser-3.4.3/src/include/pa_random.h000644 000000 000000 00000001371 11730603272 017442 0ustar00rootwheel000000 000000 /** @file Parser: random related functions. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_RANDOM_H #define PA_RANDOM_H #define IDENT_PA_RANDOM_H "$Id: pa_random.h,v 1.3 2012/03/16 09:24:10 moko Exp $" #include "pa_types.h" #define MAX_UINT 0xFFFFFFFFu void random(void *buffer, size_t size); static inline int _random(uint top) { uint raw; random(&raw, sizeof(raw)); return int(double(raw) / MAX_UINT * top ); } /// to hell with extra bytes on 64bit platforms struct uuid { unsigned int time_low; unsigned short time_mid; unsigned short time_hi_and_version; unsigned short clock_seq; unsigned char node[6]; }; uuid get_uuid(); #endif parser-3.4.3/src/include/pa_stylesheet_connection.h000644 000000 000000 00000005470 11730603272 022576 0ustar00rootwheel000000 000000 /** @file Parser: Stylesheet connection decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_STYLESHEET_CONNECTION_H #define PA_STYLESHEET_CONNECTION_H #define IDENT_PA_STYLESHEET_CONNECTION_H "$Id: pa_stylesheet_connection.h,v 1.41 2012/03/16 09:24:10 moko Exp $" #include "libxslt/xslt.h" #include "libxslt/xsltInternals.h" #include "pa_xml_exception.h" #include "pa_common.h" #include "pa_globals.h" #include "pa_xml_io.h" // defines /** Connection with stylesheet: remembers time and can figure out that it needs recompilation */ class Stylesheet_connection: public PA_Object { friend class Stylesheet_connection_ptr; private: String::Body ffile_spec; xsltStylesheet *fstylesheet; HashStringBool* dependencies; time_t time_used; time_t prev_disk_time; public: Stylesheet_connection(String::Body afile_spec): ffile_spec(afile_spec), fstylesheet(0), dependencies(0), time_used(0), prev_disk_time(0), used(0) {} String::Body file_spec() { return ffile_spec; } bool uncachable() { return !dependencies/*means they were external*/; } bool expired(time_t older_dies) { return uncachable() || !used && time_usedprev_disk_time?now_disk_time:0; } void load(time_t new_disk_time); time_t get_disk_time(); private: // connection usage methods int used; void use() { time_used=time(0); // they started to use at this time used++; } void unuse() { used--; if(!used) close(); } }; /// Auto-object used to track Stylesheet_connection usage class Stylesheet_connection_ptr { Stylesheet_connection *fconnection; public: explicit Stylesheet_connection_ptr(Stylesheet_connection *aconnection) : fconnection(aconnection) { fconnection->use(); } ~Stylesheet_connection_ptr() { fconnection->unuse(); } Stylesheet_connection* operator->() { return fconnection; } /* Stylesheet_connection& operator*() { return *fconnection; }*/ // copying Stylesheet_connection_ptr(const Stylesheet_connection_ptr& src) : fconnection(src.fconnection) { fconnection->use(); } Stylesheet_connection_ptr& operator =(const Stylesheet_connection_ptr& src) { // may do without this=src check fconnection->unuse(); fconnection=src.fconnection; fconnection->use(); return *this; } }; #endif parser-3.4.3/src/include/pa_config_fixed.h000644 000000 000000 00000003253 12205633071 020605 0ustar00rootwheel000000 000000 /** @file Parser: Configure file for autoconf-disabled platforms. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_CONFIG_FIXED_H #define PA_CONFIG_FIXED_H #define IDENT_PA_CONFIG_FIXED_H "$Id: pa_config_fixed.h,v 1.84 2013/08/23 10:15:21 moko Exp $" #define inline __inline #define HAVE_STDIO_H #define HAVE_SYS_TYPES_H #define HAVE_SYS_STAT_H #define HAVE_STDLIB_H #define HAVE_STDDEF_H #define HAVE_MEMORY_H #define HAVE_STRING_H #define HAVE_ASSERT_H #define HAVE_LIMITS_H #define HAVE_CTYPE_H #define HAVE_MATH_H #define HAVE_PROCESS_H #define HAVE_STDARG_H #define HAVE_SETJMP_H #define HAVE_ERRNO_H #define HAVE_FCNTL_H #define HAVE_IO_H #define HAVE_SYS_LOCKING_H #define HAVE__LOCKING #define HAVE_WINSOCK_H #define HAVE_TIME_H #define HAVE_TIMEZONE #define HAVE_DAYLIGHT #define USE_SMTP #define PA_LITTLE_ENDIAN #define PA_WITH_SJLJ_EXCEPTIONS //types #ifndef ssize_t typedef int ssize_t; #endif #ifndef uint8_t typedef unsigned __int8 uint8_t; #endif #ifndef uint16_t typedef unsigned __int16 uint16_t; #endif #ifndef uint32_t typedef unsigned __int32 uint32_t; #endif #ifndef uint64_t typedef unsigned __int64 uint64_t; #endif #define LT_MODULE_EXT ".dll" // disable any execs (file::exec, file::cgi, unix mail:send) //#define NO_PA_EXECS // disable stringstream usage //#define NO_STRINGSTREAM #define GC_NOT_DLL //xml-abled parser #define XML #define XML_STATIC #ifdef XML_STATIC # define LIBXML_STATIC # define LIBXSLT_STATIC # define LIBEXSLT_STATIC #endif // otherwise functions in pcre.h will be declared as __declspec(dllimport) #define PCRE_STATIC #endif parser-3.4.3/src/include/pa_uue.h000644 000000 000000 00000000613 11730603273 016757 0ustar00rootwheel000000 000000 /** @file Parser: uue encoding module. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_UUE_H #define PA_UUE_H #define IDENT_PA_UUE_H "$Id: pa_uue.h,v 1.11 2012/03/16 09:24:11 moko Exp $" const char* pa_uuencode(const unsigned char* in, size_t in_size, const char* file_name); #endif parser-3.4.3/src/include/pa_threads.h000644 000000 000000 00000002521 11730603273 017613 0ustar00rootwheel000000 000000 /** @file Parser: mutex & helpers decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_THREADS_H #define PA_THREADS_H #define IDENT_PA_THREADS_H "$Id: pa_threads.h,v 1.31 2012/03/16 09:24:11 moko Exp $" #include "pa_config_includes.h" #include "pa_types.h" /// thread ID type typedef unsigned int pa_thread_t; /// get caller thread ID pa_thread_t pa_get_thread_id(); class AutoSYNCHRONIZED; /// simple semaphore object class Mutex { friend class AutoSYNCHRONIZED; private: uint handle; public: Mutex(); ~Mutex(); private: // for AutoSYNCHRONIZED void acquire(); void release(); }; extern const bool parser_multithreaded; extern Mutex global_mutex; /** Helper to ensure paired Mutex::acquire() and Mutex::release(). Use it with SYNCHRONIZED macro */ class AutoSYNCHRONIZED { public: AutoSYNCHRONIZED() { global_mutex.acquire(); } ~AutoSYNCHRONIZED() { global_mutex.release(); } }; /** put it to first line of a function to ensure thread safety. @verbatim void someclass::somefunc(...) { SYNCHRONIZED; ... } @endverbatim WARNING: don't use THROW or PTHROW with such thread safety mechanizm - longjmp would leave global_mutex acquired, which is wrong! */ #define SYNCHRONIZED AutoSYNCHRONIZED autoSYNCHRONIZED #endif parser-3.4.3/src/include/pa_hash.h000644 000000 000000 00000036117 12205127142 017106 0ustar00rootwheel000000 000000 /** @file Parser: hash class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ /* The prime numbers used from zend_hash.c, the part of Zend scripting engine library, Copyrighted (C) 1999-2000 Zend Technologies Ltd. http://www.zend.com/license/0_92.txt For more information about Zend please visit http://www.zend.com/ */ #ifndef PA_HASH_H #define PA_HASH_H #define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.85 2013/08/21 12:11:14 moko Exp $" #include "pa_memory.h" #include "pa_types.h" #include "pa_string.h" const int HASH_ALLOCATES_COUNT=29; /** Zend comment: Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster paf: HPUX ld could not handle static member: unsatisfied symbols */ static uint Hash_allocates[HASH_ALLOCATES_COUNT]={ 5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399}; /// useful generic hash function inline void generic_hash_code(uint& result, char c) { result=(result<<4)+c; if(uint g=(result&0xF0000000)) { result=result^(g>>24); result=result^g; } } /// useful generic hash function inline void generic_hash_code(uint& result, const char* s) { while(char c=*s++) { result=(result<<4)+c; if(uint g=(result&0xF0000000)) { result=result^(g>>24); result=result^g; } } } /// useful generic hash function inline void generic_hash_code(uint& result, const char* buf, size_t size) { const char* end=buf+size; while(buf>24); result=result^g; } } } /// simple hash code of int. used by EXIF mapping inline uint hash_code(int self) { uint result=0; generic_hash_code(result, (const char*)&self, sizeof(self)); return result; } #endif // PA_HASH_H #ifndef PA_HASH_CLASS #define PA_HASH_CLASS /** Simple hash. Automatically rehashed when almost is_full. Contains no 0 values. get returning 0 means there were no such. "put value 0" means "remove" */ #ifdef HASH_ORDER #undef HASH #undef HASH_STRING #undef HASH_NEW_PAIR #undef HASH_FOR_EACH #define HASH OrderedHash #define HASH_STRING OrderedHashString #define HASH_NEW_PAIR(code, key, value) *ref=new Pair(code, key, value, *ref, this->last); this->last=&((*ref)->next) #define HASH_FOR_EACH \ for(Pair *pair=this->first; pair; pair=pair->next) #else #define HASH Hash #define HASH_STRING HashString #define HASH_NEW_PAIR(code, key, value) *ref=new Pair(code, key, value, *ref) #define HASH_FOR_EACH \ Pair **ref=this->refs; \ for(int index=0; indexallocated; index++) \ for(Pair *pair=*ref++; pair; pair=pair->link) #endif template class HASH: public PA_Object { public: typedef K key_type; typedef V value_type; HASH() { allocated=Hash_allocates[allocates_index=0]; fpairs_count=fused_refs=0; refs=new(UseGC) Pair*[allocated]; #ifdef HASH_ORDER first=0; last=&first; #endif } HASH(const HASH& source) { allocates_index=source.allocates_index; allocated=source.allocated; fused_refs=source.fused_refs; fpairs_count=source.fpairs_count; refs=new(UseGC) Pair*[allocated]; // clone & rehash #ifdef HASH_ORDER first=0; last=&first; for(Pair *pair=source.first; pair; pair=pair->next) { uint index=pair->code%allocated; Pair **ref=&refs[index]; HASH_NEW_PAIR(pair->code, pair->key, pair->value); } #else for(int i=0; ilink) { Pair **ref=&refs[i]; HASH_NEW_PAIR(pair->code, pair->key, pair->value); } #endif } #ifdef USE_DESTRUCTORS ~HASH() { Pair **ref=refs; for(int index=0; indexlink; delete pair; pair=next; } delete[] refs; } #endif /// put a [value] under the [key] @returns existed or not bool put(K key, V value) { if(!value) { remove(key); return false; } if(is_full()) expand(); uint code=hash_code(key); uint index=code%allocated; Pair **ref=&refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && pair->key==key) { // found a pair with the same key pair->value=value; return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); fpairs_count++; return false; } /// remove the [key] @returns existed or not bool remove(K key) { uint code=hash_code(key); uint index=code%allocated; for(Pair **ref=&refs[index]; *ref; ref=&(*ref)->link){ Pair *pair=*ref; if(pair->code==code && pair->key==key) { // found a pair with the same key Pair *next=pair->link; #ifdef HASH_ORDER *(pair->prev)=pair->next; if(pair->next) pair->next->prev=pair->prev; else last=pair->prev; #endif delete pair; *ref=next; --fpairs_count; return true; } } return false; } /// return true if key exists bool contains(K key){ uint code=hash_code(key); uint index=code%allocated; for(Pair *pair=refs[index]; pair; pair=pair->link){ if(pair->code==code && pair->key==key) return true; } return false; } /// get associated [value] by the [key] V get(K key) const { uint code=hash_code(key); uint index=code%allocated; for(Pair *pair=refs[index]; pair; pair=pair->link) if(pair->code==code && pair->key==key) return pair->value; return V(0); } #ifdef HASH_ORDER V first_value() const { return (first) ? first->value : V(0); } V last_value() const { return (fpairs_count) ? ((Pair *)((char *)last - offsetof(Pair, next)))->value : V(0); } #endif /// put a [value] under the [key] if that [key] existed @returns existed or not bool put_replaced(K key, V value) { if(!value) { remove(key); return false; } uint code=hash_code(key); uint index=code%allocated; for(Pair *pair=refs[index]; pair; pair=pair->link) if(pair->code==code && pair->key==key) { // found a pair with the same key, replacing pair->value=value; return true; } // proper pair not found return false; } /// put a [value] under the [key] if that [key] NOT existed @returns existed or not bool put_dont_replace(K key, V value) { if(!value) { remove(key); return false; } if(is_full()) expand(); uint code=hash_code(key); uint index=code%allocated; Pair **ref=&refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && pair->key==key) { // found a pair with the same key, NOT replacing return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); fpairs_count++; return false; } /// put all 'src' values if NO with same key existed void merge_dont_replace(const HASH& src) { #ifdef HASH_ORDER for(Pair *pair=src.first; pair; pair=pair->next) #else for(int i=0; ilink) #endif put_dont_replace(pair->key, pair->value); } /// number of elements in hash int count() const { return fpairs_count; } /// iterate over all pairs template void for_each(void callback(K, V, I), I info) const { HASH_FOR_EACH callback(pair->key, pair->value, info); } /// iterate over all pairs template void for_each_ref(void callback(K, V&, I), I info) const { HASH_FOR_EACH callback(pair->key, pair->value, info); } /// iterate over all pairs until condition becomes true, return that element template V first_that(bool callback(K, V, I), I info) const { HASH_FOR_EACH if(callback(pair->key, pair->value, info)) return pair->value; return V(0); } /// remove all elements void clear() { memset(refs, 0, sizeof(*refs)*allocated); fpairs_count=fused_refs=0; #ifdef HASH_ORDER first=0; last=&first; #endif } protected: /// the index of [allocated] in [Hash_allocates] int allocates_index; /// number of allocated pairs int allocated; /// used pairs int fused_refs; /// stored pairs total (including those by links) int fpairs_count; /// pair storage class Pair: public PA_Allocated { public: uint code; K key; V value; Pair *link; #ifdef HASH_ORDER Pair **prev; Pair *next; Pair(uint acode, K akey, V avalue, Pair *alink, Pair **aprev) : code(acode), key(akey), value(avalue), link(alink), prev(aprev), next(0) { *aprev=this; } #else Pair(uint acode, K akey, V avalue, Pair *alink) : code(acode), key(akey), value(avalue), link(alink) {} #endif } **refs; #ifdef HASH_ORDER Pair *first; Pair **last; #endif /// filled to threshold (THRESHOLD_PERCENT=75), needs expanding bool is_full() { return fused_refs + allocated/4 >= allocated; } /// allocate larger buffer & rehash void expand() { int old_allocated=allocated; Pair **old_refs=refs; if (allocates_indexlink; uint new_index=pair->code%allocated; Pair **new_ref=&refs[new_index]; pair->link=*new_ref; *new_ref=pair; pair=next; } delete[] old_refs; } private: //disabled HASH& operator = (const HASH&) { return *this; } }; /** Simple String::body hash. Allows hash code caching */ #ifdef HASH_CODE_CACHING template class HASH_STRING: public HASH { public: typedef typename HASH::Pair Pair; typedef const String::Body &K; typedef K key_type; /// put a [value] under the [key] @returns existed or not bool put(K str, V value) { if(!value) { remove(str); return false; } if(this->is_full()) this->expand(); CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code%this->allocated; Pair **ref=&this->refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key pair->value=value; return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? this->fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); this->fpairs_count++; return false; } /// remove the [key] @returns existed or not bool remove(K str) { CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code%this->allocated; for(Pair **ref=&this->refs[index]; *ref; ref=&(*ref)->link){ Pair *pair=*ref; if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key Pair *next=pair->link; #ifdef HASH_ORDER *(pair->prev)=pair->next; if(pair->next) pair->next->prev=pair->prev; else this->last=pair->prev; #endif delete pair; *ref=next; --this->fpairs_count; return true; } } return false; } /// return true if key exists bool contains(K str){ CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code%this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link){ if(pair->code==code && CORD_cmp(pair->key,key)==0) return true; } return false; } /// get associated [value] by the [key] V get(K str) const { CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code%this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) return pair->value; return V(0); } /// put a [value] under the [key] if that [key] existed @returns existed or not bool put_replaced(K str, V value) { if(!value) { remove(str); return false; } CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code%this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key, replacing pair->value=value; return true; } // proper pair not found return false; } /// put a [value] under the [key] if that [key] NOT existed @returns existed or not bool put_dont_replace(K str, V value) { if(!value) { remove(str); return false; } if(this->is_full()) this->expand(); CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code%this->allocated; Pair **ref=&this->refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key, NOT replacing return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? this->fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); this->fpairs_count++; return false; } /// put all 'src' values if NO with same key existed void merge_dont_replace(const HASH_STRING& src) { #ifdef HASH_ORDER for(Pair *pair=src.first; pair; pair=pair->next) #else for(int i=0; ilink) #endif put_dont_replace(String::Body(pair->key, pair->code), pair->value); } /// iterate over all pairs template void for_each(void callback(K, V, I), I info) const { HASH_FOR_EACH callback(String::Body(pair->key, pair->code), pair->value, info); } /// iterate over all pairs template void for_each_ref(void callback(K, V&, I), I info) const { HASH_FOR_EACH callback(String::Body(pair->key, pair->code), pair->value, info); } /// iterate over all pairs until condition becomes true, return that element template V first_that(bool callback(K, V, I), I info) const { HASH_FOR_EACH if(callback(String::Body(pair->key, pair->code), pair->value, info)) return pair->value; return V(0); } /// simple hash iterator class Iterator { const HASH_STRING& fhash; Pair *fcurrent; public: Iterator(const HASH_STRING& ahash): fhash(ahash) { fcurrent=fhash.first; } operator bool () { return fcurrent != 0; } void next() { fcurrent=fcurrent->next; } String::Body key(){ return String::Body(fcurrent->key, fcurrent->code); } V value(){ return fcurrent->value; } }; }; #else //HASH_CODE_CACHING template class HASH_STRING: public HASH{}; #endif //HASH_CODE_CACHING #ifndef HASH_ORDER /// Auto-object used to temporarily substituting/removing string hash values template class Temp_hash_value { H *fhash; String::Body fname; V saved_value; public: Temp_hash_value(H *ahash, String::Body aname, V avalue) : fhash(ahash), fname(aname) { if(fhash){ saved_value=fhash->get(aname); fhash->put(aname, avalue); } } ~Temp_hash_value() { if(fhash) fhash->put(fname, saved_value); } }; #endif #endif //PA_HASH_CLASS parser-3.4.3/src/include/pa_opcode.h000644 000000 000000 00000006022 12145044656 017437 0ustar00rootwheel000000 000000 /** @file Parser: compiled code related decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef OPCODE_H #define OPCODE_H namespace OP { #define IDENT_PA_OPCODE_H "$Id: pa_opcode.h,v 1.47 2013/05/16 02:51:26 misha Exp $" #define OPTIMIZE_BYTECODE_GET_ELEMENT // $a ^a #define OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT // $a.b ^a.b #define OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT // $a.$b ^a.$b #define OPTIMIZE_BYTECODE_STRING_POOL #define OPTIMIZE_BYTECODE_OBJECT_POOL // $var[$a.b], $var[$a.$b] #define OPTIMIZE_BYTECODE_CUT_REM_OPERATOR // cut rem with all params #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT #define OPTIMIZE_BYTECODE_CONSTRUCT // $a(expr), $a[value] #endif // $.a(expr), $.a[value] // $self.a(expr), $self.a[value] #define OPTIMIZE_BYTECODE_GET_SELF_ELEMENT // $self.a ^self.a /// Compiled operation code enum OPCODE { //@{ /// @name literals OP_VALUE, OP_CURLY_CODE__STORE_PARAM, OP_EXPR_CODE__STORE_PARAM, OP_NESTED_CODE, //@} //@{ /// @name actions OP_WITH_ROOT, OP_WITH_SELF, OP_WITH_READ, OP_WITH_WRITE, OP_VALUE__GET_CLASS, OP_CONSTRUCT_VALUE, OP_CONSTRUCT_EXPR, OP_CURLY_CODE__CONSTRUCT, OP_WRITE_VALUE, OP_WRITE_EXPR_RESULT, OP_STRING__WRITE, #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT OP_VALUE__GET_ELEMENT_OR_OPERATOR, #else OP_GET_ELEMENT_OR_OPERATOR, #endif OP_GET_ELEMENT, OP_GET_ELEMENT__WRITE, #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT OP_VALUE__GET_ELEMENT, OP_VALUE__GET_ELEMENT__WRITE, OP_WITH_ROOT__VALUE__GET_ELEMENT, #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT OP_GET_OBJECT_ELEMENT, // $a.b & ^a.b OP_GET_OBJECT_ELEMENT__WRITE, // $a.b & ^a.b #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT OP_GET_OBJECT_VAR_ELEMENT, // $a.$b & ^a.$b OP_GET_OBJECT_VAR_ELEMENT__WRITE, // $a.$b & ^a.$b #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT OP_WITH_SELF__VALUE__GET_ELEMENT, OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE, #endif OP_OBJECT_POOL, OP_STRING_POOL, OP_PREPARE_TO_CONSTRUCT_OBJECT, OP_CONSTRUCT_OBJECT, OP_CONSTRUCT_OBJECT__WRITE, OP_PREPARE_TO_EXPRESSION, OP_CALL, OP_CALL__WRITE, #ifdef OPTIMIZE_BYTECODE_CONSTRUCT OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR, OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE, OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR, OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE, OP_WITH_SELF__VALUE__CONSTRUCT_EXPR, OP_WITH_SELF__VALUE__CONSTRUCT_VALUE, #endif //@} //@{ /// @name expression ops: unary OP_NEG, OP_INV, OP_NOT, OP_DEF, OP_IN, OP_FEXISTS, OP_DEXISTS, //@} //@{ /// @name expression ops: binary OP_SUB, OP_ADD, OP_MUL, OP_DIV, OP_MOD, OP_INTDIV, OP_BIN_SL, OP_BIN_SR, OP_BIN_AND, OP_BIN_OR, OP_BIN_XOR, OP_LOG_AND, OP_LOG_OR, OP_LOG_XOR, OP_NUM_LT, OP_NUM_GT, OP_NUM_LE, OP_NUM_GE, OP_NUM_EQ, OP_NUM_NE, OP_STR_LT, OP_STR_GT, OP_STR_LE, OP_STR_GE, OP_STR_EQ, OP_STR_NE, OP_IS //@} }; }; #endif parser-3.4.3/src/include/pa_xml_io.h000644 000000 000000 00000001106 11730603273 017446 0ustar00rootwheel000000 000000 /** @file Parser: plugins to xml library, controlling i/o. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #ifndef PA_XML_IO_H #define PA_XML_IO_H #define IDENT_PA_XML_IO_H "$Id: pa_xml_io.h,v 1.6 2012/03/16 09:24:11 moko Exp $" #include "pa_string.h" #include "pa_hash.h" void pa_xml_io_init(); typedef HashString HashStringBool; void pa_xmlStartMonitoringDependencies(); HashStringBool* pa_xmlGetDependencies(); #endif #endif parser-3.4.3/src/include/pa_xml_exception.h000644 000000 000000 00000002444 12231021005 021023 0ustar00rootwheel000000 000000 /** @file Parser: xml exception decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_XML_EXCEPTION_H #define PA_XML_EXCEPTION_H #ifdef XML #define IDENT_PA_XML_EXCEPTION_H "$Id: pa_xml_exception.h,v 1.10 2013/10/20 18:33:41 moko Exp $" const char* const XML_VALUE_MUST_BE_STRING = "value must be string"; const char* const XML_DATA_MUST_BE_STRING = "data must be string"; const char* const XML_NAMESPACEURI_MUST_BE_STRING = "namespaceURI must be string"; const char* const XML_QUALIFIED_NAME_MUST_BE_STRING = "qualifiedName must be string"; const char* const XML_NC_NAME_MUST_BE_STRING = "NCName must be string"; const char* const XML_LOCAL_NAME_MUST_BE_STRING = "localName must be string"; const char* const XML_INVALID_QUALIFIED_NAME = "invalid qualifiedName '%s'"; const char* const XML_INVALID_NC_NAME = "invalid NCName '%s'"; const char* const XML_INVALID_LOCAL_NAME = "invalid localName '%s'"; // includes #include "pa_exception.h" #include "pa_request.h" // defines class XmlException: public Exception { public: XmlException(const String* aproblem_source, const char* aproblem_comment, ...); XmlException(const String* aproblem_source, Request& r); XmlException(); }; #endif #endif parser-3.4.3/src/include/pa_string.h000644 000000 000000 00000053151 12171262342 017472 0ustar00rootwheel000000 000000 /** @file Parser: string class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_STRING_H #define PA_STRING_H #define IDENT_PA_STRING_H "$Id: pa_string.h,v 1.206 2013/07/16 15:21:06 moko Exp $" // includes #include "pa_types.h" #include "pa_array.h" extern "C" { // cord's author forgot to do that #define CORD_NO_IO #include "cord.h" #ifdef CORD_CAT_OPTIMIZATION #define CORD_cat(x, y) CORD_cat_optimized(x, y) #define CORD_cat_char_star(x, y, leny) CORD_cat_char_star_optimized(x, y, leny) #endif }; // defines // cache hash code in String::Body for faster hash access #define HASH_CODE_CACHING // cache String::Body.length() for char* strings only, CORDs have own length #define STRING_LENGTH_CACHING // cord extension /* Returns true if x does contain */ /* char not_c at positions i..i+n. Value i,i+n must be < CORD_len(x). */ int CORD_range_contains_chr_greater_then(CORD x, size_t i, size_t n, int c); size_t CORD_block_count(CORD x); // forwards class Charset; class Table; class SQL_Connection; class Dictionary; class Request_charsets; class String; typedef Array ArrayString; class VRegex; // generally useful int pa_atoi(const char* str, const String* problem_source=0); double pa_atod(const char* str, const String* problem_source=0); unsigned int pa_atoui(const char *str, int base, const String* problem_source=0); /// this is result of pos functions which mean that substr were not found #define STRING_NOT_FOUND ((size_t)-1) /** String which knows the lang of all it's langs. All pieces remember - whether they are tainted or not, and the lang which should be used to detaint them */ class String: public PA_Object { public: /** piece is tainted or not. the lang to use when detaint remember to change String_Untaint_lang_name @ untaint.C along WARNING WARNING WARNING WARNING WARNING WARNING pos function compares(<=) languages, that is used in searching for table column separator being L_CLEAN or L_AS_IS. they search for AS_IS, meaning AS_IS|CLEAN [doing <=L_AS_IS check]. letters assigned for debugging, but it's important for no language-letter come before L_AS_IS other then L_CLEAN WARNING WARNING WARNING WARNING WARNING WARNING */ enum Language { L_UNSPECIFIED=0, ///< no real string has parts of this lange: it's just convinient to check when string's empty // these two must go before others, there are checks for >L_AS_IS L_CLEAN='0', ///< clean WARNING: read above warning before changing L_AS_IS='A', ///< leave all characters intact WARNING: read above warning before changing L_PASS_APPENDED='P', /**< leave lang built into string being appended. just a flag, that value not stored */ L_TAINTED='T', ///< tainted, untaint lang as assigned later // untaint langs. assigned by ^untaint[lang]{...} L_FILE_SPEC='F', ///< file specification L_HTTP_HEADER='h', ///< text in HTTP response header L_MAIL_HEADER='m', ///< text in mail header L_URI='U', ///< text in uri L_SQL='Q', ///< ^table:sql body L_JS='J', ///< JavaScript code L_XML='X', ///< ^xdoc:create xml L_HTML='H', ///< HTML code L_REGEX='R', ///< RegExp L_JSON='S', ///< JSON code L_HTTP_COOKIE='C', ///< cookies encoded as %uXXXX for compartibility with js functions encode/decode L_PARSER_CODE='p', ///< ^process body // READ WARNING ABOVE BEFORE ADDING ANYTHING L_OPTIMIZE_BIT = 0x80 ///< flag, requiring cstr whitespace optimization }; enum Trim_kind { TRIM_BOTH, TRIM_START, TRIM_END }; class Body; union Languages { struct { #ifdef PA_LITTLE_ENDIAN Language lang:8; size_t is_not_just_lang:sizeof(CORD)*8-8; #elif defined(PA_BIG_ENDIAN) size_t is_not_just_lang:sizeof(CORD)*8-8; Language lang:8; #else # error word endianness not determined for some obscure reason #endif } opt; CORD langs; CORD make_langs(const Body& current) const { return opt.is_not_just_lang?langs:CORD_chars((char)opt.lang, current.length()); } CORD make_langs(size_t aoffset, size_t alength) const { return opt.is_not_just_lang? CORD_substr(langs, aoffset, alength, 0) :CORD_chars((char)opt.lang, alength); } /// appending when 'langs' already contain something [simple cases handled elsewhere] void append(size_t current, const CORD to_nonempty_target_langs) { assert(langs); if(opt.is_not_just_lang) langs=CORD_cat(langs, to_nonempty_target_langs); else { assert(current); langs=CORD_cat(CORD_chars((char)opt.lang, current), to_nonempty_target_langs); } } void append(const Body& current, const CORD to_nonempty_target_langs) { assert(langs); if(opt.is_not_just_lang) langs=CORD_cat(langs, to_nonempty_target_langs); else { size_t current_size=current.length(); assert(current_size); langs=CORD_cat(CORD_chars((char)opt.lang, current_size), to_nonempty_target_langs); } } public: const char* v() const; void dump() const; Languages(): langs(0) {} Languages(Language alang) { opt.lang=alang; opt.is_not_just_lang=0; } /// MUST be called exactly prior to modification of current [uses it's length] void append(size_t current, Language alang, size_t length) { assert(alang); assert(length); if(!opt.is_not_just_lang) if(opt.lang) { if(opt.lang==alang) // same language? ignoring return; } else { opt.lang=alang; // to uninitialized return; } append(current, CORD_chars((char)alang, length)); } void append(const Body ¤t, Language alang, size_t length) { assert(alang); assert(length); if(!opt.is_not_just_lang) if(opt.lang) { if(opt.lang==alang) // same language? ignoring return; } else { opt.lang=alang; // to uninitialized return; } append(current, CORD_chars((char)alang, length)); } void appendHelper(const Body& current, Language alang, const Body &length_helper) { assert(alang); if(!opt.is_not_just_lang) if(opt.lang) { if(opt.lang==alang) // same language? ignoring return; } else { opt.lang=alang; // to uninitialized return; } append(current, CORD_chars((char)alang, length_helper.length())); } void appendHelper(const Body& current, const Languages &src, const Body& length_helper) { if(!langs){ langs=src.langs; // to uninitialized #ifdef CORD_CAT_OPTIMIZATION if(opt.is_not_just_lang && !CORD_IS_STRING(langs)) CORD_concatenation_protect(langs); #endif } else if(!src.opt.is_not_just_lang) appendHelper(current, src.opt.lang, length_helper); // simplifying when simple source else append(current, src.make_langs(length_helper)); } /// MUST be called exactly prior to modification of current [uses it's length] void append(const Body& current, const Languages src, size_t aoffset, size_t alength) { assert(alength); if(!langs) // to uninitialized? if(src.opt.is_not_just_lang) langs=CORD_substr(src.langs, aoffset, alength, 0); // to uninitialized complex else opt.lang=src.opt.lang; // to uninitialized simple else if(!opt.is_not_just_lang && !src.opt.is_not_just_lang && opt.lang==src.opt.lang) // both simple & of same language? return; // ignoring else append(current, src.make_langs(aoffset, alength)); } /// checks if we have lang<=alang all from aoffset to aoffset+alength bool check_lang(Language alang, size_t aoffset, size_t alength) const { if(alang==L_UNSPECIFIED) // ignore lang? return true; if(opt.is_not_just_lang) return CORD_range_contains_chr_greater_then(langs, aoffset, alength, (unsigned)alang)==0; else return (unsigned)opt.lang<=(unsigned)alang; } /// @returns count of blocks /// @todo currently there can be adjucent blocks of same language. someday merge them size_t count() const { return opt.is_not_just_lang? CORD_block_count(langs) : opt.lang? 1 : 0; }; template void for_each(size_t current, int callback(char, size_t, I), I info) const { if(opt.is_not_just_lang) CORD_block_iter(langs, 0, (CORD_block_iter_fn)callback, info); else callback(opt.lang, current, info); } template void for_each(const Body& current, int callback(char, size_t, I), I info) const { if(opt.is_not_just_lang) CORD_block_iter(langs, 0, (CORD_block_iter_fn)callback, info); else callback(opt.lang, current.length(), info); } bool invariant(size_t current_length) const { if(!langs) return current_length==0; if(opt.is_not_just_lang) return CORD_len(langs)==current_length; return true; // uncheckable, actually } }; class Body { CORD body; #ifdef HASH_CODE_CACHING // cached hash code is not reseted on write operations as test shows // that string body does not change after it is stored as a hash key mutable uint hash_code; #endif #ifdef STRING_LENGTH_CACHING // cached length is reseted on modification, used only for char*, not CORD mutable size_t string_length; #define INIT_LENGTH ,string_length(0) #define ZERO_LENGTH string_length=0; #else #define INIT_LENGTH #define ZERO_LENGTH #endif public: const char* v() const; void dump() const; #ifdef HASH_CODE_CACHING Body(): body(CORD_EMPTY), hash_code(0) INIT_LENGTH {} Body(CORD abody, uint ahash_code): body(abody), hash_code(ahash_code) INIT_LENGTH {} Body(CORD abody): body(abody), hash_code(0) INIT_LENGTH { #else Body(): body(CORD_EMPTY) INIT_LENGTH {} Body(CORD abody): body(abody) INIT_LENGTH { #endif #ifdef CORD_CAT_OPTIMIZATION assert(!body // no body || *body // ordinary string || body[1]==1 // CONCAT_HDR || body[1]==3 // CONCAT_HDR_READ_ONLY || body[1]==4 // FN_HDR || body[1]==6 // SUBSTR_HDR ); #else assert(!body // no body || *body // ordinary string || body[1]==1 // CONCAT_HDR || body[1]==4 // FN_HDR || body[1]==6 // SUBSTR_HDR ); #endif } static Body Format(int value); void clear() { ZERO_LENGTH body=CORD_EMPTY; } bool operator! () const { return is_empty(); } CORD get_cord() const { return body; } uint get_hash_code() const; const char* cstr() const { #ifdef STRING_LENGTH_CACHING string_length = length(); if(string_length) return const_cast(this)->body=CORD_to_const_char_star(body, string_length); #endif return CORD_to_const_char_star(body, length()); } char* cstrm() const { return CORD_to_char_star(body, length()); } #ifdef STRING_LENGTH_CACHING void set_length(size_t alength){ string_length = alength; } size_t length() const { return body ? CORD_IS_STRING(body) ? string_length ? string_length : (string_length=strlen(body)) : CORD_len(body) : 0; } #else size_t length() const { return CORD_len(body); } #endif bool is_empty() const { return body==CORD_EMPTY; } void append_know_length(const char *str, size_t known_length) { if(known_length){ if(body){ body = CORD_cat_char_star(body, str, known_length); ZERO_LENGTH } else { body=str; #ifdef STRING_LENGTH_CACHING string_length=known_length; #endif } } } void append_strdup_know_length(const char* str, size_t known_length) { if(known_length) append_know_length(pa_strdup(str, known_length), known_length); } void append(char c) { ZERO_LENGTH body=CORD_cat_char(body, c); } Body& operator << (const Body src) { ZERO_LENGTH body=CORD_cat(body, src.body); return *this; } Body& operator << (const char* str) { append_know_length(str, strlen(str)); return *this; } // could not figure out why this operator is needed [should do this chain: string->simple->==] bool operator < (const Body src) const { return CORD_cmp(body, src.body)<0; } bool operator > (const Body src) const { return CORD_cmp(body, src.body)>0; } bool operator <= (const Body src) const { return CORD_cmp(body, src.body)<=0; } bool operator >= (const Body src) const { return CORD_cmp(body, src.body)>=0; } bool operator != (const Body src) const { return CORD_cmp(body, src.body)!=0; } bool operator == (const Body src) const { return CORD_cmp(body, src.body)==0; } int ncmp(size_t x_begin, const Body y, size_t y_begin, size_t size) const { return CORD_ncmp(body, x_begin, y.body, y_begin, size); } char fetch(size_t index) const { return CORD_fetch(body, index); } Body mid(size_t aindex, size_t alength) const { return CORD_substr(body, aindex, alength, length()); } size_t pos(const char* substr, size_t offset=0) const { return CORD_str(body, offset, substr, length()); } size_t pos(const Body substr, size_t offset=0) const { if(substr.is_empty()) return STRING_NOT_FOUND; // in this case CORD_str returns 0 [parser users got used to -1] // CORD_str checks for bad offset [CORD_chr does not] return CORD_str(body, offset, substr.body, length()); } size_t pos(char c, size_t offset=0) const { if(offset>=length()) // CORD_chr does not check that [and ABORT's in that case] return STRING_NOT_FOUND; return CORD_chr(body, offset, c); } size_t strrpbrk(const char* chars, size_t left, size_t right) const; size_t rskipchars(const char* chars, size_t left, size_t right) const; template int for_each(int (*f)(char c, I), I info) const { return CORD_iter(body, (CORD_iter_fn)f, (void*)info); } template int for_each(int (*f1)(char c, I), int (*f2)(const char* s, I), I info) const { return CORD_iter5(body, 0, (CORD_iter_fn)f1, (CORD_batched_iter_fn)f2, info); } void set_pos(CORD_pos& pos, size_t index) const { CORD_set_pos(pos, body, index); } /*Body normalize() const { return Body(CORD_balance(body)); }*/ /// @returns this or 0 or mid. if returns this or 0 out_* are not filled Body trim(Trim_kind kind=TRIM_BOTH, const char* chars=0, size_t* out_start=0, size_t* out_length=0, Charset* source_charset=0) const; }; struct C { const char *str; size_t length; operator const char *() { return str; } C(): str(0), length(0) {} C(const char *astr, size_t asize): str(astr), length(asize) {} }; struct Cm { char *str; size_t length; //operator char *() { return str; } Cm(): str(0), length(0) {} Cm(char *astr, size_t asize): str(astr), length(asize) {} }; private: Body body; ///< all characters of string Languages langs; ///< string characters lang const char* v() const; void dump() const; #define ASSERT_STRING_INVARIANT(string) \ assert((string).langs.invariant((string).body.length())) public: static const String Empty; explicit String(){}; explicit String(const char* cstr, Language alang=L_CLEAN){ if(cstr && *cstr){ body=cstr; langs=alang; } } explicit String(const char* cstr, Language alang, size_t alength){ if(cstr && *cstr){ body=cstr; #ifdef STRING_LENGTH_CACHING body.set_length(alength); #endif langs=alang; } } String(int value, const char *format); String(Body abody, Language alang): body(abody), langs(alang) { ASSERT_STRING_INVARIANT(*this); } String(const String& src): body(src.body), langs(src.langs) { ASSERT_STRING_INVARIANT(*this); } /// for convinient hash lookup #ifdef HASH_CODE_CACHING operator const Body&() const { return body; } #else operator const Body() const { return body; } #endif bool is_empty() const { return body.is_empty(); } size_t length() const { return body.length(); } size_t length(Charset& charset) const; /// convert to CORD forcing lang tainting Body cstr_to_string_body_taint(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const; /// convert to CORD with tainting dirty to lang Body cstr_to_string_body_untaint(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const; /// const char* cstr() const { return body.cstr(); } /// char* cstrm() const { return body.cstrm(); } /// convert to constant C string forcing lang tainting const char* taint_cstr(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_taint(lang, connection, charsets).cstr(); } char *taint_cstrm(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_taint(lang, connection, charsets).cstrm(); } /// convert to constant C string with tainting dirty to lang const char* untaint_cstr(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_untaint(lang, connection, charsets).cstr(); } char *untaint_cstrm(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_untaint(lang, connection, charsets).cstrm(); } const char* untaint_and_transcode_cstr(Language lang, const Request_charsets *charsets) const; bool is_not_just_lang() const { return langs.opt.is_not_just_lang !=0; } Language just_lang() const { return langs.opt.lang; } /// puts pieces to buf Cm serialize(size_t prolog_size) const; /// appends pieces from buf to self bool deserialize(size_t prolog_size, void *buf, size_t buf_size); /// @see Body::append_know_length String& append_know_length(const char* str, size_t known_length, Language lang); /// @see Body::append_help_length String& append_help_length(const char* str, size_t helper_length, Language lang); String& append_strdup(const char* str, size_t helper_length, Language lang); bool operator == (const char* y) const { return body==Body(y); } bool operator != (const char* y) const { return body!=Body(y); } /// this starts with y bool starts_with(const char* y) const { return body.ncmp(0/*x_begin*/, Body(y), 0/*y_begin*/, strlen(y))==0; } /// x starts with this bool this_starts(const char* x) const { return Body(x).ncmp(0/*x_begin*/, body, 0/*y_begin*/, length())==0; } String& append_to(String& dest, Language lang, bool forced=false) const; String& append(const String& src, Language lang, bool forced=false) { return src.append_to(*this, lang, forced); } String& append_quoted(const String* src, Language lang=L_JSON){ *this << "\""; if(src) this->append(*src, lang, true/*forced lang*/); *this << "\""; return *this; } String& operator << (const String& src) { return append(src, L_PASS_APPENDED); } String& operator << (const char* src) { return append_help_length(src, 0, L_AS_IS); } String& operator << (const Body& src){ langs.appendHelper(body, L_AS_IS, src); body< (const String& src) const { return body>src.body; } bool operator <= (const String& src) const { return body<=src.body; } bool operator >= (const String& src) const { return body>=src.body; } bool operator != (const String& src) const { return body!=src.body; } bool operator == (const String& src) const { return body==src.body; } /// extracts [start, finish) piece of string String& mid(size_t substr_begin, size_t substr_end) const; String& mid(Charset& charset, size_t from, size_t to, size_t helper_length=0) const; /** ignore lang if it's L_UNSPECIFIED but when specified: look for substring that lies in ONE fragment in THAT lang @return position of substr in string, -1 means "not found" [const char* version] */ size_t pos(const Body substr, size_t this_offset=0, Language lang=L_UNSPECIFIED) const; /// String version of @see pos(const char*, int, Language) size_t pos(const String& substr, size_t this_offset=0, Language lang=L_UNSPECIFIED) const; size_t pos(char c, size_t this_offset=0) const { return body.pos(c, this_offset); } size_t pos(Charset& charset, const String& substr, size_t this_offset=0, Language lang=L_UNSPECIFIED) const; size_t strrpbrk(const char* chars, size_t left=0) const { return (length()) ? body.strrpbrk(chars, left, length()-1) : STRING_NOT_FOUND; } size_t strrpbrk(const char* chars, size_t left, size_t right) const { return body.strrpbrk(chars, left, right); } size_t rskipchars(const char* chars, size_t left=0) const { return (length()) ? body.rskipchars(chars, left, length()-1) : STRING_NOT_FOUND; } size_t rskipchars(const char* chars, size_t left, size_t right) const { return body.rskipchars(chars, left, right); } void split(ArrayString& result, size_t& pos_after, const char* delim, Language lang=L_UNSPECIFIED, int limit=-1) const; void split(ArrayString& result, size_t& pos_after, const String& delim, Language lang=L_UNSPECIFIED, int limit=-1) const; typedef void (*Row_action)(Table& table, ArrayString* row, int prestart, int prefinish, int poststart, int postfinish, void *info); /** @return table of found items, if any. table format is defined and fixed[can be used by others]: @verbatim prematch/match/postmatch/1/2/3/... @endverbatim */ Table* match(VRegex* vregex, Row_action row_action, void *info, int& matches_count) const; enum Change_case_kind { CC_UPPER, CC_LOWER }; String& change_case(Charset& source_charset, Change_case_kind kind) const; const String& replace(const Dictionary& dict) const; const String& trim(Trim_kind kind=TRIM_BOTH, const char* chars=0, Charset* source_charset=0) const; double as_double() const { return pa_atod(cstr(), this); } int as_int() const { return pa_atoi(cstr(), this); } bool as_bool() const { return as_int()!=0; } const String& escape(Charset& source_charset) const; private: //disabled String& operator = (const String&) { return *this; } }; #ifndef HASH_CODE_CACHING /// simple hash code of string. used by Hash inline uint hash_code(const String::Body self) { return self.get_hash_code(); } #endif #endif parser-3.4.3/src/include/pa_stack.h000644 000000 000000 00000003073 11730603272 017270 0ustar00rootwheel000000 000000 /** @file Parser: stack class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_STACK_H #define PA_STACK_H #define IDENT_PA_STACK_H "$Id: pa_stack.h,v 1.27 2012/03/16 09:24:10 moko Exp $" #include "pa_array.h" /// simple stack based on Array template class Stack: public Array { public: Stack(size_t initial=4) : Array(initial){} inline void push(T item) { if(this->is_full()) expand(this->fallocated); // free is not called, so expanding a lot to decrease memory waste this->felements[this->fused++]=item; } inline T pop() { return this->felements[--this->fused]; } inline bool is_empty() { return this->fused==0; } inline size_t top_index() { return this->fused; } inline void set_top_index(size_t atop) { this->fused=atop; } inline T top_value() { assert(!is_empty()); return this->felements[this->fused-1]; } /// call this prior to collecting garbage [in unused part of stack there may be pointers(unused)] void wipe_unused() { if(size_t above_top_size=this->fallocated-this->fused) memset(&this->felements[this->fused], 0, above_top_size*sizeof(T)); } protected: void expand(size_t delta) { size_t new_allocated=this->fallocated+delta; // we can't use realloc as MethodParams references allocated stack T* new_elements = (T *)pa_malloc(new_allocated*sizeof(T)); memcpy(new_elements, this->felements, this->fallocated*sizeof(T)); this->felements=new_elements; this->fallocated=new_allocated; } }; #endif parser-3.4.3/src/include/pa_sql_connection.h000644 000000 000000 00000011672 11730603272 021205 0ustar00rootwheel000000 000000 /** @file Parser: sql fconnection decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_SQL_CONNECTION_H #define PA_SQL_CONNECTION_H #define IDENT_PA_SQL_CONNECTION_H "$Id: pa_sql_connection.h,v 1.42 2012/03/16 09:24:10 moko Exp $" #include "pa_sql_driver.h" #include "pa_sql_driver_manager.h" // defines /// @see SQL_Driver_services_impl::_throw #ifdef PA_WITH_SJLJ_EXCEPTIONS #define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) \ use(); \ actions #else #define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) \ use(); \ if(!setjmp(fservices.mark)) { \ actions; \ } else \ fservices.propagate_exception(); #endif /// SQL_Driver_services Pooled implementation class SQL_Driver_services_impl: public SQL_Driver_services { const String* furl; Exception fexception; const char* frequest_charset; const char* fdocument_root; public: SQL_Driver_services_impl(const char* arequest_charset, const char* adocument_root): furl(0), frequest_charset(arequest_charset), fdocument_root(adocument_root) {} void set_url(const String& aurl) { furl=&aurl;} const String& url_without_login() const; override void* malloc(size_t size) { return pa_malloc(size); } override void* malloc_atomic(size_t size) { return pa_malloc_atomic(size); } override void* realloc(void *ptr, size_t size) { return pa_realloc(ptr, size); } override const char* request_charset() { return frequest_charset; } override const char* request_document_root() { return fdocument_root; } override void transcode(const char* src, size_t src_length, const char*& dst, size_t& dst_length, const char* charset_from_name, const char* charset_to_name ); /** normally we can't 'throw' from dynamic library, so the idea is to #1 jump to C++ some function to main body, where every function stack frame has exception unwind information and from there... #2 propagate_exception() but when parser configured --with-sjlj-exceptions one can simply 'throw' from dynamic library. [sad story: one can not longjump/throw due to some bug in gcc as of 3.2.1 version] */ override void _throw(const SQL_Error& aexception) { // converting SQL_exception to parser Exception // hiding passwords and addresses from accidental show [imagine user forgot @exception] #ifdef PA_WITH_SJLJ_EXCEPTIONS throw #else fexception= #endif Exception(aexception.type(), &url_without_login(), aexception.comment()); #ifndef PA_WITH_SJLJ_EXCEPTIONS longjmp(mark, 1); #endif } virtual void propagate_exception() { #ifndef PA_WITH_SJLJ_EXCEPTIONS throw fexception; #endif } }; /// SQL connection. handy wrapper around low level SQL_Driver class SQL_Connection: public PA_Object { const String& furl; SQL_Driver& fdriver; SQL_Driver_services_impl fservices; void *fconnection; time_t time_used; public: SQL_Connection(const String& aurl, SQL_Driver& adriver, const char* arequest_charset, const char* adocument_root): furl(aurl), fdriver(adriver), fservices(arequest_charset, adocument_root), fconnection(0), time_used(0) { } SQL_Driver_services_impl& services() { return fservices; } const String& get_url() { return furl; } void set_url() { fservices.set_url(furl); } void use() { time_used=time(0); // they started to use at this time } bool expired(time_t older_dies) { return time_usedclose_connection(furl, this); } }; #endif parser-3.4.3/src/include/pa_sql_driver_manager.h000644 000000 000000 00000004223 12165633045 022031 0ustar00rootwheel000000 000000 /** @file Parser: sql driver manager decl. global sql driver manager, must be thread-safe Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_SQL_DRIVER_MANAGER_H #define PA_SQL_DRIVER_MANAGER_H #define IDENT_PA_SQL_DRIVER_MANAGER_H "$Id: pa_sql_driver_manager.h,v 1.37 2013/07/05 21:09:57 moko Exp $" #include "pa_sql_driver.h" #include "pa_hash.h" #include "pa_table.h" #include "pa_string.h" #include "pa_cache_managers.h" #include "pa_stack.h" // defines #define MAIN_SQL_NAME "SQL" #define MAIN_SQL_DRIVERS_NAME "drivers" // forwards class SQL_Connection; /// sql driver manager class SQL_Driver_manager: public Cache_manager { public: typedef HashString driver_cache_type; typedef Stack connection_cache_element_base_type; typedef HashString connection_cache_type; private: friend class SQL_Connection; driver_cache_type driver_cache; connection_cache_type connection_cache; public: SQL_Driver_manager(); override ~SQL_Driver_manager(); /** connect to specified url, using driver dynamic library found in table, if not loaded yet checks driver version */ SQL_Connection* get_connection(const String& aurl, Table *protocol2driver_and_client, const char* arequest_charset, const char* adocument_root); private: // driver cache SQL_Driver *get_driver_from_cache(driver_cache_type::key_type protocol); void put_driver_to_cache(driver_cache_type::key_type protocol, driver_cache_type::value_type driver); private: // connection cache SQL_Connection* get_connection_from_cache(connection_cache_type::key_type url); void put_connection_to_cache(connection_cache_type::key_type url, SQL_Connection* connection); private: time_t prev_expiration_pass_time; private: // for SQL_Connection /// caches connection void close_connection(connection_cache_type::key_type url, SQL_Connection* connection); public: // Cache_manager override Value* get_status(); override void maybe_expire_cache(); }; /// global extern SQL_Driver_manager* SQL_driver_manager; #endif parser-3.4.3/src/include/pa_request.h000644 000000 000000 00000035564 12231311521 017653 0ustar00rootwheel000000 000000 /** @file Parser: request class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_REQUEST_H #define PA_REQUEST_H #define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.216 2013/10/21 20:49:21 moko Exp $" #include "pa_pool.h" #include "pa_hash.h" #include "pa_wcontext.h" #include "pa_value.h" #include "pa_stack.h" #include "pa_request_info.h" #include "pa_request_charsets.h" #include "pa_sapi.h" // consts const uint ANTI_ENDLESS_EXECUTE_RECOURSION=1000; const size_t pseudo_file_no__process=1; // forwards class Temp_lang; class Methoded; class VMethodFrame; class VMail; class VForm; class VResponse; class VCookie; class VStateless_class; class VConsole; /// Main workhorse. class Request: public PA_Object { friend class Temp_lang; friend class Temp_connection; friend class Temp_request_self; friend class Temp_value_element; friend class Request_context_saver; friend class Exception_trace; public: class Trace { const String* fname; Operation::Origin forigin; public: Trace(): fname(0) {} void clear() { fname=0; } operator bool() const { return fname!=0; } Trace(const String* aname, const Operation::Origin aorigin): fname(aname), forigin(aorigin) {} const String* name() const { return fname; } const Operation::Origin origin() const { return forigin; } }; enum Skip { SKIP_NOTHING, SKIP_BREAK, SKIP_CONTINUE }; private: Pool fpool; public: Pool& pool() { return fpool; } private: union StackItem { Value* fvalue; ArrayOperation* fops; VMethodFrame* fmethod_frame; public: Value& value() const { return *fvalue; } const String& string() const { return fvalue->as_string(); } ArrayOperation& ops() const { return *fops; } VMethodFrame& method_frame() const { return *fmethod_frame; } /// needed to fill unused Array entries StackItem() {} StackItem(Value& avalue): fvalue(&avalue) {} StackItem(ArrayOperation& aops): fops(&aops) {} StackItem(VMethodFrame& amethod_frame): fmethod_frame(&amethod_frame) {} }; class Exception_trace: public Stack { size_t fbottom; public: Exception_trace(): fbottom(0) {} size_t bottom_index() { return fbottom; } void set_bottom_index(size_t abottom) { fbottom=abottom; } element_type bottom_value() { return get(bottom_index()); } void clear() { fused=fbottom=0; } bool is_empty() { return fused==fbottom; } const element_type extract_origin(const String*& problem_source); }; ///@{ core data /// classes HashString fclasses; /// already used files to avoid cyclic uses HashString used_files; HashString searched_along_class_path; /// list of all used files, Operation::file_no = index to it Array file_list; /** endless execute(execute(... preventing counter @see ANTI_ENDLESS_EXECUTE_RECOURSION */ uint anti_endless_execute_recoursion; ///@} /// execution stack Stack stack; /// exception stack trace Exception_trace exception_trace; public: bool allow_class_replace; //@{ request processing status /// contexts VMethodFrame* method_frame; Value* rcontext; WContext* wcontext; /// current language String::Language flang; /// current connection SQL_Connection* fconnection; //@} /// interrupted flag, raised on signals [SIGPIPE] bool finterrupted; Skip fskip; int fin_cycle; public: uint register_file(String::Body file_spec); struct Exception_details { const Trace trace; const String* problem_source; VHash& vhash; Exception_details( const Trace atrace, const String* aproblem_source, VHash& avhash): trace(atrace), problem_source(aproblem_source), vhash(avhash) {} }; Exception_details get_details(const Exception& e); const char* get_exception_cstr(const Exception& e, Exception_details& details); /// @see Stack::wipe_unused void wipe_unused_execution_stack() { stack.wipe_unused(); } #ifdef RESOURCES_DEBUG /// measures double sql_connect_time; double sql_request_time; #endif Request(SAPI_Info& asapi_info, Request_info& arequest_info, String::Language adefault_lang ///< all tainted data default untainting lang ); ~Request(); /// global classes HashString& classes() { return fclasses; } Value* get_class(const String& name); /** core request processing BEWARE: may throw exception to you: catch it! */ void core( const char* config_filespec, ///< system config filespec bool config_fail_on_read_problem, ///< fail if system config file not found bool header_only); /// executes ops void execute(ArrayOperation& ops); // execute.C void op_call(VMethodFrame &frame); void op_call_write(VMethodFrame &frame); Value& construct(Value &class_value, const Method &method); /// execute ops with anti-recoursion check void recoursion_checked_execute(/*const String& name, */ArrayOperation& ops) { // anti_endless_execute_recoursion if(++anti_endless_execute_recoursion==ANTI_ENDLESS_EXECUTE_RECOURSION) { anti_endless_execute_recoursion=0; // give @exception a chance throw Exception(PARSER_RUNTIME, 0, //&name, "call canceled - endless recursion detected"); } execute(ops); // execute it anti_endless_execute_recoursion--; } /// void use_file_directly(VStateless_class& aclass, const String& file_spec, bool fail_on_read_problem=true, bool fail_on_file_absence=true); /// compiles the file, maybe forcing it's class @a name and @a base_class. void use_file(VStateless_class& aclass, const String& file_name, const String* use_filespec); /// compiles a @a source buffer void use_buf(VStateless_class& aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset=0); /// processes any code-junction there may be inside of @a value StringOrValue process_getter(Junction& junction); // execute.C StringOrValue process(Value& input_value, bool intercept_string=true); // execute.C void process_write(Value& input_value); // execute.C //@{ convinient helpers const String& process_to_string(Value& input_value) { return process(input_value, true/*intercept_string*/).as_string(); } Value& process_to_value(Value& input_value, bool intercept_string=true) { return process(input_value, intercept_string).as_value(); } //@} const String* get_method_filename(const Method* method); // execute.C const String* get_used_filename(uint file_no); #define DEFINE_DUAL(modification) \ void write_##modification##_lang(StringOrValue dual) { \ if(const String* string=dual.get_string()) \ write_##modification##_lang(*string); \ else \ write_##modification##_lang(*dual.get_value()); \ } /// appending, sure of clean string inside void write_no_lang(const String& astring) { wcontext->write(astring, (String::Language)(String::L_CLEAN | flang&String::L_OPTIMIZE_BIT)); } /// appending sure value, that would be converted to clean string void write_no_lang(Value& avalue) { if(wcontext->get_in_expression()) wcontext->write(avalue); else wcontext->write(avalue, (String::Language)(String::L_CLEAN | flang&String::L_OPTIMIZE_BIT)); } /// appending string, passing language built into string being written void write_pass_lang(const String& astring) { wcontext->write(astring, String::L_PASS_APPENDED); } /// appending possible string, passing language built into string being written void write_pass_lang(Value& avalue) { wcontext->write(avalue, String::L_PASS_APPENDED); } DEFINE_DUAL(pass) /// appending possible string, assigning untaint language void write_assign_lang(Value& avalue) { wcontext->write(avalue, flang); } /// appending string, assigning untaint language void write_assign_lang(const String& astring) { wcontext->write(astring, flang); } DEFINE_DUAL(assign) /// returns relative to @a path path to @a file const String& relative(const char* apath, const String& relative_name); /// returns an absolute @a path to relative @a name const String& absolute(const String& relative_name); /// returns the mime type of 'user_file_name' const String& mime_type_of(const String* file_name); /// returns the mime type of 'user_file_name_cstr' const String& mime_type_of(const char* user_file_name_cstr); /// returns current SQL connection if any SQL_Connection* connection(bool fail_on_error=true) { if(fail_on_error && !fconnection) throw Exception(PARSER_RUNTIME, 0, "outside of 'connect' operator"); return fconnection; } void set_interrupted(bool ainterrupted) { finterrupted=ainterrupted; } bool get_interrupted() { return finterrupted; } void set_skip(Skip askip) { fskip=askip; } Skip get_skip() { return fskip; } void set_in_cycle(int adelta) { fin_cycle+=adelta; } bool get_in_cycle() { return fin_cycle>0; } public: /// info from web server Request_info& request_info; /// info about ServerAPI SAPI_Info& sapi_info; /// source, client, mail charsets Request_charsets charsets; /// 'MAIN' class conglomerat & operators are methods of this class VStateless_class& main_class; /// $form:elements VForm& form; /// $mail VMail& mail; /// $response:elements VResponse& response; /// $cookie:elements VCookie& cookie; /// $console VConsole& console; /// classes configured data HashString classes_conf; public: // status read methods VMethodFrame *get_method_frame() { return method_frame; } Value& get_self(); #define GET_SELF(request, type) (static_cast(request.get_self())) /* for strange reason call to this: r.get_self() refuses to compile template T& get_self() { return *static_cast(get_self().get()); } */ /// public for ^reflection:copy[] void put_element(Value& ncontext, const String& name, Value* value); /// for @main[] const String* execute_virtual_method(Value& aself, const String& method_name); /// executes parser method, use op_call(frame) to execute native method void execute_method(VMethodFrame& aframe); //{ for @conf[filespec] and @auto[filespec] and parser://method/call const String* execute_method(Value& aself, const Method& method, Value* optional_param, bool do_return_string); struct Execute_nonvirtual_method_result { const String* string; Method* method; Execute_nonvirtual_method_result(): string(0), method(0) {} }; Execute_nonvirtual_method_result execute_nonvirtual_method(VStateless_class& aclass, const String& method_name, VString* optional_param, bool do_return_string); //} #ifdef XML public: // charset helpers /// @see Charset::transcode xmlChar* transcode(const String& s); /// @see Charset::transcode xmlChar* transcode(const String::Body s); /// @see Charset::transcode const String& transcode(const xmlChar* s); #endif private: /// already executed some @conf method bool configure_admin_done; void configure_admin(VStateless_class& conf_class); void configure(); private: // compile.C ArrayClass& compile(VStateless_class* aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset); private: // execute.C Value& get_element(Value& ncontext, const String& name); private: // defaults const String::Language fdefault_lang; private: // mime types /// $MAIN:MIME-TYPES Table *mime_types; private: // lang manipulation String::Language set_lang(String::Language alang) { String::Language result=flang; flang=alang; return result; } void restore_lang(String::Language alang) { flang=alang; } private: // connection manipulation SQL_Connection* set_connection(SQL_Connection* aconnection) { SQL_Connection* result=fconnection; fconnection=aconnection; return result; } void restore_connection(SQL_Connection* aconnection) { fconnection=aconnection; } private: void output_result(VFile* body_file, bool header_only, bool as_attachment); }; /// Auto-object used to save request context across ^try body class Request_context_saver { Request& fr; /// exception stack trace size_t exception_trace_top; size_t exception_trace_bottom; /// execution stack size_t stack; uint anti_endless_execute_recoursion; /// contexts VMethodFrame* method_frame; Value* rcontext; WContext* wcontext; /// current language String::Language flang; /// current connection SQL_Connection* fconnection; public: Request_context_saver(Request& ar) : fr(ar), exception_trace_top(ar.exception_trace.top_index()), exception_trace_bottom(ar.exception_trace.bottom_index()), stack(ar.stack.top_index()), anti_endless_execute_recoursion(ar.anti_endless_execute_recoursion), method_frame(ar.method_frame), rcontext(ar.rcontext), wcontext(ar.wcontext), flang(ar.flang), fconnection(ar.fconnection) {} void restore() { fr.exception_trace.set_top_index(exception_trace_top); fr.exception_trace.set_bottom_index(exception_trace_bottom); fr.stack.set_top_index(stack); fr.anti_endless_execute_recoursion=anti_endless_execute_recoursion; fr.method_frame=method_frame, fr.rcontext=rcontext; fr.wcontext=wcontext; fr.flang=flang; fr.fconnection=fconnection; } }; /// Auto-object used for temporary changing Request::flang. class Temp_lang { Request& frequest; String::Language saved_lang; public: Temp_lang(Request& arequest, String::Language alang) : frequest(arequest), saved_lang(arequest.set_lang(alang)) { } ~Temp_lang() { frequest.restore_lang(saved_lang); } }; /// Auto-object used for temporary changing Request::fconnection. class Temp_connection { Request& frequest; SQL_Connection* saved_connection; public: Temp_connection(Request& arequest, SQL_Connection* aconnection) : frequest(arequest), saved_connection(arequest.set_connection(aconnection)) { } ~Temp_connection() { frequest.restore_connection(saved_connection); } }; /// Auto-object used for break out of cycle check class InCycle { Request& frequest; public: InCycle(Request& arequest) : frequest(arequest) { frequest.set_in_cycle(1); } ~InCycle() { frequest.set_in_cycle(-1); } }; /// Auto-object used for temporary changing Request::allow_class_replace. class Temp_class_replace { Request& frequest; public: Temp_class_replace(Request& arequest, bool avalue) : frequest(arequest){ frequest.allow_class_replace=avalue; } ~Temp_class_replace() { frequest.allow_class_replace=false; } }; /// Auto-object used for temporarily substituting/removing elements class Temp_value_element { Request& frequest; Value& fwhere; const String& fname; Value* saved; public: Temp_value_element(Request& arequest, Value& awhere, const String& aname, Value* awhat); ~Temp_value_element(); }; // defines for externs #define EXCEPTION_HANDLED_PART_NAME "handled" // externs extern const String main_method_name; extern const String auto_method_name; extern const String body_name; extern const String exception_type_part_name; extern const String exception_source_part_name; extern const String exception_comment_part_name; extern const String exception_handled_part_name; // defines for statics #define MAIN_CLASS_NAME "MAIN" #define AUTO_FILE_NAME "auto.p" #endif parser-3.4.3/src/include/pa_pool.h000644 000000 000000 00000002770 11730603271 017136 0ustar00rootwheel000000 000000 /** @file Parser: pool class decl. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_POOL_H #define PA_POOL_H #define IDENT_PA_POOL_H "$Id: pa_pool.h,v 1.90 2012/03/16 09:24:09 moko Exp $" #include "pa_config_includes.h" #include "pa_array.h" /** Pool mechanizm allows users not to free up allocated objects, leaving that problem to 'pools'. @see Pooled */ class Pool { public: struct Cleanup { void (*cleanup) (void *); void *data; Cleanup(void (*acleanup) (void *), void *adata): cleanup(acleanup), data(adata) {} }; Pool(); ~Pool(); /// registers a routine to clean up non-pooled allocations void register_cleanup(void (*cleanup) (void *), void *data); /// unregister it, looking it up by it's data void unregister_cleanup(void *cleanup_data); private: Array cleanups; private: //{ /// @name implementation defined bool real_register_cleanup(void (*cleanup) (void *), void *data); //} private: /// throws register cleanup exception void fail_register_cleanup() const; private: //disabled Pool(const Pool&); Pool& operator= (const Pool&); }; /** Base for all classes that are allocated in 'pools'. Holds Pool object. */ class Pooled { // the pool i'm allocated on Pool& fpool; public: Pooled(Pool& apool); /// my pool //Pool& pool() const { return *fpool; } /// Sole: this got called automatically from Pool::~Pool() virtual ~Pooled(); }; #endif parser-3.4.3/src/types/pa_vregex.C000644 000000 000000 00000010701 11757207701 017141 0ustar00rootwheel000000 000000 /** @file Parser: @b regex class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vregex.h" #include "pa_vint.h" #include "pa_vstring.h" volatile const char * IDENT_PA_VREGEX_C="$Id: pa_vregex.C,v 1.15 2012/05/23 16:26:41 moko Exp $" IDENT_PA_VREGEX_H; // defines #define REGEX_PATTERN_NAME "pattern" #define REGEX_OPTIONS_NAME "options" const char* get_pcre_exec_error_text(int exec_result){ switch(exec_result){ case PCRE_ERROR_BADUTF8: case PCRE_ERROR_BADUTF8_OFFSET: return "UTF-8 validation failed during pcre_exec (%d)."; break; default: return "execution error (%d)"; } } Value& VRegex::as_expr_result() { return *new VInt(as_int()); } void VRegex::regex_options(const String* options, int* result){ struct Regex_option { const char* key; const char* keyAlt; int clear; int set; int *result; } regex_option[]={ {"i", "I", 0, PCRE_CASELESS, result}, // a=A {"s", "S", 0, PCRE_DOTALL, result}, // ^\n\n$ [default] {"m", "M", PCRE_DOTALL, PCRE_MULTILINE, result}, // ^aaa\n$^bbb\n$ {"x", 0, 0, PCRE_EXTENDED, result}, // whitespace in regex ignored {"U", 0, 0, PCRE_UNGREEDY, result}, // ungreedy patterns (greedy by default) {"g", "G", 0, MF_GLOBAL_SEARCH, result+1}, // many rows {"'", 0, 0, MF_NEED_PRE_POST_MATCH, result+1}, {"n", 0, 0, MF_JUST_COUNT_MATCHES, result+1}, {0, 0, 0, 0, 0} }; result[0]=PCRE_EXTRA /* backslash+non-special char causes error */ | PCRE_DOTALL /* dot matches all chars including newline char */ | PCRE_DOLLAR_ENDONLY /* dollar matches only end of string, but not newline chars */; result[1]=0; if(options && !options->is_empty()){ size_t valid_options=0; for(Regex_option *o=regex_option; o->key; o++) if( options->pos(o->key)!=STRING_NOT_FOUND || (o->keyAlt && options->pos(o->keyAlt)!=STRING_NOT_FOUND) ){ *o->result &= ~o->clear; *o->result |= o->set; valid_options++; } if(options->length()!=valid_options) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } } void VRegex::set(Charset& acharset, const String* aregex, const String* aoptions){ if(aregex->is_empty()) throw Exception(PARSER_RUNTIME, 0, "regexp is empty"); fcharset=&acharset; fpattern=aregex->untaint_cstr(String::L_REGEX); foptions_cstr=aoptions?aoptions->cstr():0; regex_options(aoptions, foptions); } void VRegex::compile(){ const char* err_ptr; int err_offset; int options=foptions[0]; // @todo (for UTF-8): check string & pattern and use PCRE_NO_UTF8_CHECK option if(fcharset->isUTF8()) options |= (PCRE_UTF8 | PCRE_UCP); fcode=pcre_compile(fpattern, options, &err_ptr, &err_offset, fcharset->pcre_tables); if(!fcode){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern+err_offset, String::L_TAINTED), "regular expression syntax error - %s", err_ptr); } } size_t VRegex::full_info(int type){ size_t result; int fullinfo_result=pcre_fullinfo(fcode, fextra, type, &result); if(fullinfo_result<0){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern, String::L_TAINTED), "pcre_full_info error (%d)", fullinfo_result); } return result; }; size_t VRegex::get_info_size(){ return full_info(PCRE_INFO_SIZE); } size_t VRegex::get_study_size(){ return full_info(PCRE_INFO_STUDYSIZE); } void VRegex::study(){ if(fstudied) return; const char* err_ptr; fextra=pcre_study(fcode, 0/*options*/, &err_ptr); if(err_ptr){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern, String::L_TAINTED), "pcre_study error: %s", err_ptr); } fstudied=true; } int VRegex::exec(const char* string, size_t string_len, int* ovector, int ovector_size, int prestart){ int result=pcre_exec(fcode, fextra, string, string_len, prestart, prestart>0 ? PCRE_NO_UTF8_CHECK : 0, ovector, ovector_size); if(result<0 && result!=PCRE_ERROR_NOMATCH){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern, String::L_TAINTED), get_pcre_exec_error_text(result), result); } return result; } Value* VRegex::get_element(const String& aname) { if(aname == REGEX_PATTERN_NAME) return new VString(*new String(fpattern, String::L_TAINTED)); if(aname == REGEX_OPTIONS_NAME) return new VString(*new String(foptions_cstr, String::L_TAINTED)); // .CLASS, .CLASS_NAME if(Value* result=VStateless_object::get_element(aname)) return result; throw Exception(PARSER_RUNTIME, &aname, "reading of invalid field"); } parser-3.4.3/src/types/pa_vmail.C000644 000000 000000 00000060432 12176225033 016751 0ustar00rootwheel000000 000000 /** @file Parser: @b mail class. relies on gmime library, by Jeffrey Stedfast Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_sapi.h" #include "pa_vmail.h" #include "pa_vstring.h" #include "pa_request.h" #include "pa_common.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_vdate.h" #include "pa_vfile.h" #include "pa_uue.h" volatile const char * IDENT_PA_VMAIL_C="$Id: pa_vmail.C,v 1.105 2013/07/31 15:15:39 moko Exp $" IDENT_PA_VMAIL_H; #ifdef WITH_MAILRECEIVE extern "C" { #include "gmime/gmime.h" } #include "pa_charsets.h" #endif // defines #define RAW_NAME "raw" // internals enum PartType { P_TEXT, P_HTML, P_FILE, P_MESSAGE, P_TYPES_COUNT }; static const char* const part_name_begins[P_TYPES_COUNT] = { "text", "html", "file", "message" }; // defines for statics #define FORMAT_NAME "format" #define CHARSET_NAME "charset" #define CID_NAME "content-id" // statics static const String format_name(FORMAT_NAME); static const String charset_name(CHARSET_NAME); static const String cid_name(CID_NAME); // consts const int MAX_CHARS_IN_HEADER_LINE=500; // VMail extern Methoded* mail_base_class; VMail::VMail(): VStateless_class(0, mail_base_class) {} #ifdef WITH_MAILRECEIVE #define EXCEPTION_VALUE "x-exception" static Charset* source_charset; static void putReceived(HashStringValue& received, const char* name, Value* value, bool capitalizeName=false) { if(name && value) received.put(capitalizeName ? capitalize(pa_strdup(name)) : pa_strdup(name), value); } static void putReceived(HashStringValue& received, const char* name, const char* value, bool capitalizeName=false) { if(name && value) putReceived(received, name, new VString(*new String(pa_strdup(value))), capitalizeName); } static void putReceived(HashStringValue& received, const char* name, time_t value) { if(name) received.put(pa_strdup(name), new VDate(value) ); } static void MimeHeaderField2received(const char* name, const char* value, gpointer data) { HashStringValue* received=static_cast(data); putReceived(*received, name, value, true /*capitalizeName*/); } static void parse(Request& r, GMimeMessage *message, HashStringValue& received); #ifndef DOXYGEN struct MimePart2body_info { Request* r; HashStringValue* body; int partCounts[P_TYPES_COUNT]; }; #endif static char *readStream(GMimeStream* gstream, size_t &length){ length=MAX_STRING; char *result=(char*)pa_malloc_atomic(length+1); char *ptr=result; while(true) { size_t current_size=ptr-result; ssize_t todo_size=length-current_size; ssize_t received_size=g_mime_stream_read (gstream, ptr, todo_size); if(received_size<0) throw Exception(PARSER_RUNTIME, 0,"mail content stream read error"); if(received_size==0) break; if(received_size==todo_size) { length=length*2; result=(char *)pa_realloc(result, length+1); ptr=result+current_size+received_size; } else { ptr+=received_size; } } length=ptr-result; result[length]='\0'; return result; } static void MimePart2body(GMimeObject *parent, GMimeObject *part, gpointer data) { MimePart2body_info& info=*static_cast(data); // skipping message/partial & frames if (GMIME_IS_MESSAGE_PARTIAL (part) || GMIME_IS_MULTIPART (part)) return; if (GMimeContentType *type=g_mime_object_get_content_type(part)) { PartType partType=P_FILE; if (GMIME_IS_MESSAGE_PART(part)) partType=P_MESSAGE; else if(g_mime_content_type_is_type(type, "text", "plain")) partType=P_TEXT; else if(g_mime_content_type_is_type(type, "text", "html")) partType=P_HTML; // partName int partNumber=++info.partCounts[partType]; const char *partName=part_name_begins[partType]; char partNameNumbered[MAX_STRING]; snprintf(partNameNumbered, MAX_STRING, "%s%d", partName, partNumber); // $.partN[ VHash* vpartHash(new VHash); if(partNumber==1) putReceived(*info.body, partName, vpartHash); putReceived(*info.body, partNameNumbered, vpartHash); HashStringValue& partHash=vpartHash->hash(); // $.raw[ VHash* vraw(new VHash); putReceived(partHash, RAW_NAME, vraw); g_mime_header_list_foreach(part->headers, MimeHeaderField2received, &vraw->hash()); // $.content-type[ VHash* vcontent_type(new VHash); putReceived(partHash, "content-type", vcontent_type); // $.value[text/plain] char value[MAX_STRING]; snprintf(value, MAX_STRING, "%s/%s", type->type ? type->type : "x-unknown", type->subtype ? type->subtype : "x-unknown"); putReceived(vcontent_type->hash(), VALUE_NAME, value); const GMimeParam *param=g_mime_content_type_get_params(type); while(param) { // $.charset[windows-1251] && co putReceived(vcontent_type->hash(), g_mime_param_get_name(param), g_mime_param_get_value(param), true /*capitalizeName*/); param=g_mime_param_next(param); } if (GMIME_IS_MESSAGE_PART (part)) { /* message/rfc822, $.raw[] will be overwitten */ GMimeMessage *message = g_mime_message_part_get_message ((GMimeMessagePart *) part); parse(*info.r, message, partHash); } else { GMimePart *gpart = (GMimePart *)part; putReceived(partHash, "description", g_mime_part_get_content_description(gpart)); putReceived(partHash, "content-id", g_mime_part_get_content_id(gpart)); putReceived(partHash, "content-md5", g_mime_part_get_content_md5(gpart)); putReceived(partHash, "content-location", g_mime_part_get_content_location(gpart)); // $.value[string|file] if(GMimeDataWrapper* gcontent=g_mime_part_get_content_object(gpart)){ GMimeStream* gstream=g_mime_stream_filter_new(g_mime_data_wrapper_get_stream(gcontent)); if(GMimeFilter* filter=g_mime_filter_basic_new(g_mime_part_get_content_encoding(gpart), false)) g_mime_stream_filter_add(GMIME_STREAM_FILTER(gstream), filter); size_t length; if(partType==P_FILE) { char *content=readStream(gstream, length); const char* content_filename=g_mime_part_get_filename(gpart); VFile* vfile(new VFile); vfile->set_binary(true/*tainted*/, content, length, new String(content_filename), content_filename ? new VString(info.r->mime_type_of(content_filename)) : 0); putReceived(partHash, VALUE_NAME, vfile); } else { // P_TEXT, P_HTML if(Value *charset=vcontent_type->hash().get("Charset")) if(GMimeFilter* filter=g_mime_filter_charset_new(charset->get_string()->cstr(), source_charset->NAME_CSTR())) g_mime_stream_filter_add(GMIME_STREAM_FILTER(gstream), filter); char *content=readStream(gstream, length); putReceived(partHash, VALUE_NAME,new VString(*new String(content))); } } } } } int gmt_offset() { #if defined(HAVE_TIMEZONE) && defined(HAVE_DAYLIGHT) return timezone+(daylight?60*60*(timezone<0?-1:timezone>0?+1:0):0); #else time_t t=time(0); tm *tm=localtime(&t); #if defined(HAVE_TM_GMTOFF) return tm->tm_gmtoff; #elif defined(HAVE_TM_TZADJ) return tm->tm_tzadj; #else #error neither HAVE_TIMEZONE&HAVE_DAYIGHT nor HAVE_TM_GMTOFF nor HAVE_TM_TZADJ defined #endif #endif } static void parse(Request& r, GMimeMessage *message, HashStringValue& received) { try { // firstly user-defined strings go // user headers { // $.raw[ VHash* vraw(new VHash); putReceived( received, RAW_NAME, vraw); g_mime_header_list_foreach(g_mime_object_get_header_list(GMIME_OBJECT(message)), MimeHeaderField2received, &vraw->hash()); } // secondly standard headers putReceived(received, "message-id", g_mime_message_get_message_id(message)); putReceived(received, "from", g_mime_message_get_sender(message)); putReceived(received, "reply-to", g_mime_message_get_reply_to(message)); putReceived(received, "subject", g_mime_message_get_subject(message)); // @todo: g_mime_message_get_recipients(message) // .date(date+gmt_offset) time_t date; int tz_offset; g_mime_message_get_date(message, &date, &tz_offset); int tt_offset = ((tz_offset / 100) *(60 * 60)) + (tz_offset % 100) * 60; putReceived(received, "date", date // local sender -tt_offset // move local sender to GMT sender -gmt_offset() // move GMT sender to our local time ); // .body[part/parts MimePart2body_info info={&r, &received, {0}}; g_mime_message_foreach(message, MimePart2body, &info); } catch(const Exception& e) { putReceived(received, VALUE_NAME, ""); putReceived(received, EXCEPTION_VALUE, e.comment()); } catch(...) { putReceived(received, VALUE_NAME, ""); } } void VMail::fill_received(Request& r) { if(r.request_info.mail_received) { source_charset=&r.charsets.source(); g_mime_init(0); // create stream with CRLF filter GMimeStream *stream = g_mime_stream_filter_new(g_mime_stream_file_new(stdin)); g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream), g_mime_filter_crlf_new(false, false)); try { // parse incoming message GMimeMessage *message=g_mime_parser_construct_message(g_mime_parser_new_with_stream(stream)); parse(r, message, vreceived.hash()); g_object_unref(GMIME_OBJECT(message)); } catch(const Exception& e) { HashStringValue& received=vreceived.hash(); putReceived(received, VALUE_NAME, ""); putReceived(received, EXCEPTION_VALUE, e.comment()); } catch(...) { // abnormal stream free g_object_unref(stream); rethrow; } g_object_unref(stream); g_mime_shutdown(); } } #else // WITH_MAILRECEIVE void VMail::fill_received(Request&){} #endif // WITH_MAILRECEIVE typedef int (*string_contains_char_which_check)(int); static bool string_contains_char_which(const char* string, string_contains_char_which_check check) { while(char c=*string++) { if(check((unsigned char)c)) return true; } return false; } static char *trimBoth(char *s) { // sanity check if(!s) return 0; // trim head whitespace while(*s && isspace((unsigned char)*s)) s++; // trim tail whitespace char *tail=s+strlen(s); if(tail>s) { do { --tail; if(isspace((unsigned char)*tail)) *tail=0; } while(tail>s); } // return it return s; } static void extractEmail(String& result, char *email) { email=trimBoth(email); result.append_help_length(email, 0, String::L_TAINTED); /* http://www.faqs.org/rfcs/rfc822.html addr-spec = local-part "@" domain ; global address local-part = word *("." word) ; uninterpreted case-preserved word = atom / quoted-string domain = sub-domain *("." sub-domain) sub-domain = domain-ref / domain-literal domain-ref = atom ; symbolic reference domain-literal << ignoring for now quoted-string in word << ignoring for now atom = 1* << the ONLY to check specials = "(" / ")" / "<" / ">" / "@" ; Must be in quoted- / "," / ";" / ":" / "\" / <"> ; string, to use / "." / "[" / "]" ; within a word. */ const char* exception_type="email.format"; if(strpbrk(email, "()<>,;:\\\"[]"/*specials minus @ and . */)) throw Exception(exception_type, &result, "email contains bad characters (specials)"); if(string_contains_char_which(email, (string_contains_char_which_check)isspace)) throw Exception(exception_type, &result, "email contains bad characters (whitespace)"); if(string_contains_char_which(email, (string_contains_char_which_check)iscntrl)) throw Exception(exception_type, &result, "email contains bad characters (control)"); if(result.is_empty()) throw Exception(exception_type, 0, "email is empty"); } static const String& extractEmails(const String& string) { char *emails=string.cstrm(); String& result=*new String; while(char *email=lsplit(&emails, ',')) { rsplit(email, '>'); if(char *in_brackets=lsplit(email, '<')) email=in_brackets; if(!result.is_empty()) result<<","; extractEmail(result, email); } return result; } #ifndef DOXYGEN struct Store_message_element_info { Request_charsets& charsets; String& header; const String* & from; bool extract_to; String* & to; const String* errors_to; bool mime_version_specified; ArrayValue* parts[P_TYPES_COUNT]; int parts_count; bool backward_compatibility; Value* content_type; bool had_content_disposition; Store_message_element_info( Request_charsets& acharsets, String& aheader, const String* & afrom, bool aextract_to, String* & ato ): charsets(acharsets), header(aheader), from(afrom), extract_to(aextract_to), to(ato), errors_to(0), mime_version_specified(false), parts_count(0), backward_compatibility(false), content_type(0), had_content_disposition(false){ } }; #endif static void store_message_element(HashStringValue::key_type raw_element_name, HashStringValue::value_type element_value, Store_message_element_info *info) { const String& low_element_name=String(raw_element_name, String::L_TAINTED).change_case( info->charsets.source(), String::CC_LOWER); // exclude internals if(low_element_name==MAIL_OPTIONS_NAME || low_element_name==CHARSET_NAME || low_element_name==VALUE_NAME || low_element_name==RAW_NAME || low_element_name==FORMAT_NAME || low_element_name==NAME_NAME || low_element_name==CID_NAME || low_element_name==MAIL_DEBUG_NAME) return; // grep parts for(int pt=0; ptstart_len) { const char* at_num=low_element_name.mid(start_len, start_len+1).cstr(); if(!isdigit((unsigned char)*at_num)) continue; } *info->parts[pt]+=element_value; info->parts_count++; return; } } // fetch some special headers if(low_element_name=="from") info->from=&extractEmails(element_value->as_string()); if(low_element_name==CONTENT_DISPOSITION) info->had_content_disposition=true; if(info->extract_to) { // defined only when SMTP used, see mail.C [collecting info for RCPT to-s] bool is_to=low_element_name=="to" ; bool is_cc=low_element_name=="cc" ; bool is_bcc=low_element_name=="bcc" ; if(is_to||is_cc||is_bcc) { if(!info->to) info->to=new String; else *info->to << ","; *info->to << extractEmails(element_value->as_string()); } if(is_bcc) // blinding it return; } if(low_element_name=="errors-to") info->errors_to=&extractEmails(element_value->as_string()); if(low_element_name=="mime-version") info->mime_version_specified=true; // has content type? if(low_element_name==CONTENT_TYPE_NAME) { info->content_type=element_value; if(info->backward_compatibility) return; } // preparing header line const String& source_line=attributed_meaning_to_string(*element_value, String::L_PASS_APPENDED/*does not matter, would cstr(AS_IS) right away*/); if(source_line.is_empty()) return; // we don't need empty headers here [used in clearing content-disposition] const char* source_line_cstr=source_line.cstr(); String::C mail=Charset::transcode( String::C(source_line_cstr, source_line.length()), info->charsets.source(), info->charsets.mail()); String& mail_line=*new String; if(low_element_name=="to" || low_element_name=="cc" || low_element_name=="bcc") { // never wrap address lines, mailer can not handle wrapped properly mail_line.append_strdup(mail.str, mail.length, String::L_MAIL_HEADER); } else { while(mail.length) { bool too_long=mail.length>MAX_CHARS_IN_HEADER_LINE; size_t length=too_long ? MAX_CHARS_IN_HEADER_LINE : mail.length; mail_line.append_strdup(mail.str, length, String::L_MAIL_HEADER); mail.length-=length; if(too_long) mail_line << "\n "; // break header and continue it on next line } } // append header line info->header << capitalize(raw_element_name.cstr()) << ": " << mail_line.untaint_cstr(String::L_AS_IS, 0, &info->charsets) << "\n"; } static const String& file_value_to_string(Request& r, Value* send_value) { String& result=*new String; VFile* vfile; const String* file_name=0; Value* vformat=0; Value* vcid=0; const String* dummy_from; String* dummy_to; Store_message_element_info info(r.charsets, result, dummy_from, false, dummy_to); if(HashStringValue *send_hash=send_value->get_hash()) { // hash send_hash->for_each(store_message_element, &info); // $.value if(Value* value=send_hash->get(value_name)) vfile=value->as_vfile(String::L_AS_IS); else throw Exception(PARSER_RUNTIME, 0, "file part has no $value"); // $.format vformat=send_hash->get(format_name); // $.content-id vcid=send_hash->get(cid_name); // $.name if(Value* vfile_name=send_hash->get(name_name)) // $name specified file_name=&vfile_name->as_string(); } else // must be VFile then vfile=send_value->as_vfile(String::L_AS_IS); if(!file_name) file_name=&vfile->fields().get(name_name)->as_string(); const char* file_name_cstr; const char* quoted_file_name_cstr; { Request_charsets charsets(r.charsets.source(), r.charsets.mail()/*uri!*/, r.charsets.mail()); file_name_cstr=file_name->untaint_and_transcode_cstr(String::L_FILE_SPEC, &charsets); quoted_file_name_cstr=String(file_name_cstr).taint_cstr(String::L_MAIL_HEADER, 0, &charsets); } // Content-Type: application/octet-stream result << HTTP_CONTENT_TYPE_CAPITALIZED ": " << r.mime_type_of(file_name_cstr) << "; name=\"" << quoted_file_name_cstr << "\"\n"; if(!info.had_content_disposition) // $.Content-Disposition wasn't specified by user result << CONTENT_DISPOSITION_CAPITALIZED ": " << ( vcid ? CONTENT_DISPOSITION_INLINE : CONTENT_DISPOSITION_ATTACHMENT ) << "; " << CONTENT_DISPOSITION_FILENAME_NAME"=\"" << quoted_file_name_cstr << "\"\n"; if(vcid) result << "Content-Id: <" << vcid->as_string() << ">\n"; // @todo: value must be escaped as %hh const String* type=vformat?&vformat->as_string():0; if(!type/*default*/ || *type=="base64") { result << CONTENT_TRANSFER_ENCODING_CAPITALIZED ": base64\n\n"; result << pa_base64_encode(vfile->value_ptr(), vfile->value_size()); } else { if(*type=="uue") { result << CONTENT_TRANSFER_ENCODING_CAPITALIZED ": x-uuencode\n\n"; result << pa_uuencode((const unsigned char*)vfile->value_ptr(), vfile->value_size(), file_name_cstr); } else throw Exception(PARSER_RUNTIME, type, "unknown attachment encode format"); } return result; } static const String& text_value_to_string(Request& r, PartType pt, Value* send_value, Store_message_element_info& info) { String& result=*new String; Value* text_value; Value* content_transfer_encoding=0; if(HashStringValue* send_hash=send_value->get_hash()) { // $.USER-HEADERS info.content_type=0; info.backward_compatibility=false; // reset send_hash->for_each(store_message_element, &info); // $.value text_value=send_hash->get(value_name); if(!text_value) throw Exception(PARSER_RUNTIME, 0, "%s part has no $" VALUE_NAME, part_name_begins[pt]); content_transfer_encoding=send_hash->get(content_transfer_encoding_name); } else text_value=send_value; if(!info.content_type) { result << HTTP_CONTENT_TYPE_CAPITALIZED ": text/" << (pt==P_TEXT?"plain":"html") << "; charset=" << info.charsets.mail().NAME() << "\n"; } if(!content_transfer_encoding) result << CONTENT_TRANSFER_ENCODING_CAPITALIZED << ": 8bit\n"; // header|body separator result << "\n"; // body const String* body; switch(pt) { case P_TEXT: { body=&text_value->as_string(); break; } case P_HTML: { Temp_lang temp_lang(r, String::Language(String::L_HTML | String::L_OPTIMIZE_BIT)); if(text_value->get_junction()) body=&r.process_to_string(*text_value); else throw Exception(PARSER_RUNTIME, 0, "html part value must be code"); break; } default: throw Exception(0, 0, "unhandled part type #%d", pt); } if(body) { Request_charsets charsets(r.charsets.source(), r.charsets.mail()/*uri!*/, r.charsets.mail()); const char* body_cstr=body->untaint_and_transcode_cstr(String::L_AS_IS, &charsets); result.append_know_length(body_cstr, strlen(body_cstr), String::L_CLEAN); } return result; }; /// @todo files and messages in order (file, file2, ...) const String& VMail::message_hash_to_string(Request& r, HashStringValue* message_hash, int level, const String* & from, bool extract_to, String* & to) { if(!message_hash) throw Exception(PARSER_RUNTIME, 0, "message must be hash"); String& result=*new String; if(Value* vrecodecharset_name=message_hash->get(charset_name)) r.charsets.set_mail(charsets.get(vrecodecharset_name->as_string() .change_case(r.charsets.source(), String::CC_UPPER))); else r.charsets.set_mail(r.charsets.source()); // no big deal that we leave it set. they wont miss this point which would reset it Store_message_element_info info(r.charsets, result, from, extract_to, to); { // for backward compatibilyty $.body+$.content-type -> // $.text[$.value[] $.content-type[]] for(int pt=0; ptget("body"); if(body) { message_hash->remove("body"); info.backward_compatibility=true; } message_hash->for_each(store_message_element, &info); if(body) { VHash& text_part=*new VHash(); HashStringValue& hash=text_part.hash(); hash.put(value_name, body); if(info.content_type) hash.put(content_type_name, info.content_type); *info.parts[P_TEXT]+=&text_part; info.parts_count++; } if(!info.errors_to) result << "Errors-To: postmaster\n"; // errors-to: default if(!info.mime_version_specified) result << "MIME-Version: 1.0\n"; // MIME-Version: default } int textCount=info.parts[P_TEXT]->count(); if(textCount>1) throw Exception(PARSER_RUNTIME, 0, "multiple text parts not supported, use file part"); int htmlCount=info.parts[P_HTML]->count(); if(htmlCount>1) throw Exception(PARSER_RUNTIME, 0, "multiple html parts not supported, use file part"); bool multipart=info.parts_count>1; bool alternative=textCount && htmlCount; // header char *boundary=0; if(multipart) { boundary=new(PointerFreeGC) char[MAX_NUMBER]; snprintf(boundary, MAX_NUMBER-5/*lEvEl*/, "lEvEl%d", level); bool is_inline = false; { ArrayValue& files=*info.parts[P_FILE]; for(size_t i=0; iget_hash()) && file->get(cid_name)){ is_inline = true; break; } } } result << HTTP_CONTENT_TYPE_CAPITALIZED ": " << ( is_inline ? HTTP_CONTENT_TYPE_MULTIPART_RELATED : HTTP_CONTENT_TYPE_MULTIPART_MIXED ) << ";"; // multi-part result << " boundary=\"" << boundary << "\"\n" "\n" "This is a multi-part message in MIME format."; } // alternative or not { if(alternative) { result << "\n\n--" << boundary << "\n" // intermediate boundary HTTP_CONTENT_TYPE_CAPITALIZED ": multipart/alternative; boundary=\"ALT" << boundary << "\"\n"; } for(int i=0; i<2; i++) { PartType pt=i==0?P_TEXT:P_HTML; if(info.parts[pt]->count()) { if(alternative) result << "\n\n--ALT" << boundary << "\n"; // intermediate boundary else if(boundary) result << "\n\n--" << boundary << "\n"; // intermediate boundary result << text_value_to_string(r, pt, info.parts[pt]->get(0), info); } } if(alternative) result << "\n\n--ALT" << boundary << "--\n"; } // files { ArrayValue& files=*info.parts[P_FILE]; for(size_t i=0; iget_hash(), level+1, dummy_from, false, dummy_to); } } // tailer if(boundary) result << "\n\n--" << boundary << "--\n"; // finish boundary // return return result; } Value* VMail::get_element(const String& aname) { // $fields #ifdef WITH_MAILRECEIVE if(aname==MAIL_RECEIVED_ELEMENT_NAME) return &vreceived; #endif // $CLASS,$method if(Value* result=VStateless_class::get_element(aname)) return result; return 0; } parser-3.4.3/src/types/pa_vvoid.C000644 000000 000000 00000000617 11752025366 016775 0ustar00rootwheel000000 000000 /** @file Parser: @b string class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vvoid.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VVOID_C="$Id: pa_vvoid.C,v 1.6 2012/05/07 20:05:10 moko Exp $" IDENT_PA_VVOID_H; #ifdef STRICT_VARS bool VVoid::strict_vars = false; #endif parser-3.4.3/src/types/pa_vrequest.h000644 000000 000000 00000002337 12223630565 017567 0ustar00rootwheel000000 000000 /** @file Parser: @b request class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VREQUEST_H #define PA_VREQUEST_H #define IDENT_PA_VREQUEST_H "$Id: pa_vrequest.h,v 1.40 2013/10/04 21:21:57 moko Exp $" // includes #include "pa_common.h" #include "pa_value.h" // defines #define REQUEST_CLASS_NAME "request" #define REQUEST_ARGV_ELEMENT_NAME "argv" #define POST_CHARSET_NAME "post-charset" #define POST_BODY_NAME "post-body" static const String request_class_name(REQUEST_CLASS_NAME); // forwards class Request_info; class VForm; /// request class class VRequest: public Value { Request_info& finfo; Request_charsets& fcharsets; HashStringValue fargv; VForm& fform; public: // Value override const char* type() const { return REQUEST_CLASS_NAME; } /// VRequest: 0 override VStateless_class *get_class() { return 0; } /// request: CLASS,CLASS_NAME,field override Value* get_element(const String& name); /// request: (key)=value override const VJunction* put_element(const String& name, Value* value); public: // usage VRequest(Request_info& ainfo, Request_charsets& acharsets, VForm& aform); }; #endif parser-3.4.3/src/types/pa_vhash.h000644 000000 000000 00000006130 12223630564 017014 0ustar00rootwheel000000 000000 /** @file Parser: @b hash parser type decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VHASH_H #define PA_VHASH_H #define IDENT_PA_VHASH_H "$Id: pa_vhash.h,v 1.69 2013/10/04 21:21:56 moko Exp $" #include "classes.h" #include "pa_value.h" #include "pa_hash.h" #include "pa_vint.h" #include "pa_globals.h" // defines #define VHASH_TYPE "hash" #define HASH_FIELDS_NAME "fields" #define HASH_DEFAULT_ELEMENT_NAME "_default" extern const String hash_fields_name, hash_default_element_name; extern Methoded* hash_class; // forwards class VHash_lock; /// value of type 'hash', implemented with Hash class VHash: public VStateless_object { friend class VHash_lock; public: // value override const char* type() const { return VHASH_TYPE; } override VStateless_class *get_class() { return hash_class; } /// VHash: finteger override int as_int() const { return fhash.count(); } /// VHash: finteger override double as_double() const { return fhash.count(); } /// VHash: count!=0 override bool is_defined() const { return fhash.count()!=0; } /// VHash: count!=0 override bool as_bool() const { return fhash.count()!=0; } /// VHash: count override Value& as_expr_result() { return *new VInt(as_int()); } /// VHash: fhash override HashStringValue *get_hash() { return &hash(); } override HashStringValue* get_fields() { return &fhash; } /// VHash: (key)=value override Value* get_element(const String& aname) { // $element if(Value* result=fhash.get(aname)) return result; // $fields -- pseudo field to make 'hash' more like 'table' if(aname == hash_fields_name) return this; // $method if(Value* result=VStateless_object::get_element(aname)) return result; // default value return get_default(); } /// VHash: (key)=value override const VJunction* put_element(const String& aname, Value* avalue) { if(aname==hash_default_element_name) set_default(avalue); else if(flocked) { if(!fhash.put_replaced(aname, avalue)) throw Exception(PARSER_RUNTIME, &aname, "can not insert new hash key (hash flocked)"); } else fhash.put(aname, avalue); return PUT_ELEMENT_REPLACED_ELEMENT; } override VFile* as_vfile(String::Language lang, const Request_charsets *charsets=0); public: // usage VHash(): flocked(false), _default(0) {} VHash(const HashStringValue& source): fhash(source), flocked(false), _default(0) {} HashStringValue& hash() { check_lock(); return fhash; } HashStringValue& hash_ro() { return fhash; } void set_default(Value* adefault) { _default=adefault; } Value* get_default() { return _default; } void extract_default(); void check_lock() { if(flocked) throw Exception(PARSER_RUNTIME, 0, "can not modify hash (flocked)"); } private: HashStringValue fhash; bool flocked; Value* _default; }; class VHash_lock { VHash& fhash; bool saved; public: VHash_lock(VHash& ahash): fhash(ahash) { saved=fhash.flocked; fhash.flocked=true; } ~VHash_lock() { fhash.flocked=saved; } }; #endif parser-3.4.3/src/types/pa_vform.C000644 000000 000000 00000024354 12171262342 016774 0ustar00rootwheel000000 000000 /** @file Parser: @b form class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) based on The CGI_C library, by Thomas Boutell. */ #include "pa_sapi.h" #include "pa_vform.h" #include "pa_vstring.h" #include "pa_globals.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_common.h" #include "pa_vtable.h" #include "pa_charset.h" volatile const char * IDENT_PA_VFORM_C="$Id: pa_vform.C,v 1.106 2013/07/16 15:21:06 moko Exp $" IDENT_PA_VFORM_H; // defines //#define DEBUG_POST // parse helper funcs static size_t getHeader(const char* data, size_t len){ size_t i; int enter=-1; if (data) for (i=0;i=0) enter++; if (enter>1) return i; } else if (data[i]!='\r') enter=0; return 0; } static const char* searchAttribute(const char* data, const char* attr, //< expected to be lowercased size_t len){ size_t i; if (data) for (i=0;istart) { // ?x,y int x=atoi(data+start, aftercomma-1-start); int y=atoi(data+aftercomma, length-aftercomma); imap.put(String("x"), new VInt(x)); imap.put(String("y"), new VInt(y)); } else { // ?qtail AppendFormEntry("qtail", data+start, length-start, client_charset); } // cut tail length=pos; break; } } } // Scan for pairs, unescaping and storing them as they are found for(size_t pos=0; posstart)?unescape_chars(data+start, aftereq-1-start, &fcharsets.client()):"nameless"; char *value=unescape_chars(data+aftereq, finish-aftereq, &fcharsets.client()); AppendFormEntry(attr, value, strlen(value), client_charset); } } static char* pa_tolower(char *str){ if(!str) return 0; for(char *p=str; *p; p++) *p=(char)tolower((unsigned char)*p); return str; } void VForm::ParseMimeInput( char *content_type, const char* data, size_t length, Charset* client_charset) { /* Scan for mime-presented pairs, storing them as they are found. */ const char* boundary=pa_tolower(getAttributeValue(content_type, "boundary=", strlen(content_type))); if(!boundary) throw Exception(0, 0, "VForm::ParseMimeInput no boundary attribute of Content-Type"); const char* lastData=&data[length]; while(true) { const char *dataStart=searchAttribute(data, boundary, lastData-data), *dataEnd=searchAttribute(dataStart, boundary, lastData-dataStart); size_t headerSize=getHeader(dataStart, lastData-dataStart); if(!dataStart || !dataEnd || !headerSize) break; if(searchAttribute(dataStart, "content-disposition: form-data", headerSize)) { size_t valueSize=(dataEnd-dataStart)-headerSize-5-strlen(boundary); char *attr=getAttributeValue(dataStart, " name=", headerSize), *fName=getAttributeValue(dataStart, " filename=", headerSize); if(attr) { /* OK, we have a new pair, add it to the list. */ // fName checks are because MSIE passes unassigned as filename="" and empty body if( fName && (strlen(fName) || valueSize) ){ AppendFormFileEntry(attr, valueSize? &dataStart[headerSize+1]: "", valueSize, fName, client_charset); } else { AppendFormEntry(attr, valueSize? &dataStart[headerSize+1]: "", valueSize, client_charset); } } } data=(dataEnd-strlen(boundary)); } } void VForm::AppendFormFileEntry(const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, const char* file_name_cstr, Charset* client_charset){ const char* fname = strdup(file_name_cstr); const String* sfile_name=new String(transcode(fname, strlen(fname), client_charset)); const String& sname=*new String(transcode(cname_cstr, strlen(cname_cstr), client_charset)); // maybe transcode text/* files? // NO!!! some users want to upload file 'as is' or file encoding can be unknown VFile* vfile=new VFile; vfile->set_binary(true/*tainted*/, raw_cvalue_ptr, raw_cvalue_size, sfile_name); fields.put_dont_replace(sname, vfile); // files Value* vhash=files.get(sname); if(!vhash){ // first appearence vhash=new VHash; files.put(sname, vhash); } HashStringValue& hash=*vhash->get_hash(); hash.put(String::Body::Format(hash.count()), vfile); } void VForm::AppendFormEntry(const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, Charset* client_charset) { const String& sname=*new String(transcode(cname_cstr, strlen(cname_cstr), client_charset)); const char* premature_zero_pos=(const char* )memchr(raw_cvalue_ptr, 0, raw_cvalue_size); size_t cvalue_size=premature_zero_pos?premature_zero_pos-(const char* )raw_cvalue_ptr :raw_cvalue_size; char *cvalue_ptr=strdup(raw_cvalue_ptr, cvalue_size); fix_line_breaks(cvalue_ptr, cvalue_size); String& string=*new String(transcode(cvalue_ptr, cvalue_size, client_charset), String::L_TAINTED); // tables { Value* vtable=tables.get(sname); if(!vtable) { // first appearence Table::columns_type columns(new ArrayString(1)); *columns+=new String("field"); vtable=new VTable(new Table(columns)); tables.put(sname, vtable); } Table& table=*vtable->get_table(); // this string becomes next row Table::element_type row(new ArrayString(1)); *row+=&string; table+=row; } fields.put_dont_replace(sname, new VString(string)); } void VForm::refill_fields_tables_and_files() { fields.clear(); tables.clear(); files.clear(); imap.clear(); //frequest_info.query_string="a=123"; // parsing QS [GET and ?name=value from uri rewrite)] if(frequest_info.query_string) { size_t length=strlen(frequest_info.query_string); char *buf=strdup(frequest_info.query_string, length); ParseGetFormInput(buf, length); } #ifdef DEBUG_POST frequest_info.method="POST"; File_read_result file=file_read(fcharsets, *new String("test.stdin"), true/*as_text*/, 0, true, 0, 0, 0, false/*transcode*/); frequest_info.post_size=file.length; frequest_info.post_data=(char*)file.str; frequest_info.content_type="multipart/form-data; boundary=----------mcqY2UDNcdEAoN1mLmne2i"; #endif // parsing POST data if(is_post && frequest_info.content_type) switch(post_content_type){ case FORM_URLENCODED: { detect_post_charset(); ParseFormInput(frequest_info.post_data, frequest_info.post_size, fpost_charset); break; } case MULTIPART_FORMDATA: { ParseMimeInput(strdup(frequest_info.content_type), frequest_info.post_data, frequest_info.post_size); break; } } filled_source=&fcharsets.source(); filled_client=&fcharsets.client(); } void VForm::detect_post_charset(){ if(is_post && !is_post_charset_detected){ fpost_charset=detect_charset(frequest_info.content_type); is_post_charset_detected=true; } } bool VForm::should_refill_fields_tables_and_files() { return &fcharsets.source()!=filled_source || &fcharsets.client()!=filled_client; } Value* VForm::get_element(const String& aname) { if(should_refill_fields_tables_and_files()) refill_fields_tables_and_files(); // $fields if(aname==FORM_FIELDS_ELEMENT_NAME) return new VHash(fields); // $tables if(aname==FORM_TABLES_ELEMENT_NAME) return new VHash(tables); // $files if(aname==FORM_FILES_ELEMENT_NAME) return new VHash(files); // $imap if(aname==FORM_IMAP_ELEMENT_NAME) return new VHash(imap); // CLASS, CLASS_NAME if(Value* result=VStateless_class::get_element(aname)) return result; // $field return fields.get(aname); } Charset* VForm::get_post_charset(){ detect_post_charset(); return fpost_charset; } parser-3.4.3/src/types/pa_vmethod_frame.C000644 000000 000000 00000005750 11764362602 020471 0ustar00rootwheel000000 000000 /** @file Parser: method frame class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru)\ */ #include "pa_vmethod_frame.h" #include "pa_request.h" volatile const char * IDENT_PA_VMETHOD_FRAME_C="$Id: pa_vmethod_frame.C,v 1.21 2012/06/08 11:44:02 misha Exp $" IDENT_PA_VMETHOD_FRAME_H; // globals const String result_var_name(RESULT_VAR_NAME), caller_element_name(CALLER_ELEMENT_NAME), self_element_name(SELF_ELEMENT_NAME); VVoid void_result; // unique value to be sure the result is changed // MethodParams: methods Value& MethodParams::get_processed(Value* value, const char* msg, int index, Request& r) { return r.process_to_value(as_junction(value, msg, index), false /*do not intercept string*/); } HashStringValue* MethodParams::as_hash(int index, const char* name) { Value* value=get(index); if(value) { if(value->get_junction()) throw Exception(PARSER_RUNTIME, 0, "%s param must not be code (parameter #%d)", name ? name : "options", 1+index); if(!value->is_defined()) // empty hash is not defined, but we don't need it anyway return 0; if(HashStringValue* result=value->get_hash()) return result; if(value->is_string() && value->get_string()->trim().is_empty()) return 0; } throw Exception(PARSER_RUNTIME, 0, "%s must have hash representation (parameter #%d)", name ? name : "options", 1+index); } Table* MethodParams::as_table(int index, const char* name) { Value* value=get(index); if(value) { if(value->get_junction()) throw Exception(PARSER_RUNTIME, 0, "%s param must not be code (parameter #%d)", name ? name : "options", 1+index); if(Table* result=value->get_table()) return result; } throw Exception(PARSER_RUNTIME, 0, "%s param must have table representation (parameter #%d)", name ? name : "options", 1+index); }; // VMethodFrame: methods VMethodFrame::VMethodFrame(const Method& amethod, VMethodFrame *acaller, Value& aself) : WContext(0 /* no parent, junctions can be reattached only up to VMethodFrame */), fcaller(acaller), my(0), fself(aself), method(amethod) { put_element_impl=(method.all_vars_local)?&VMethodFrame::put_element_local:&VMethodFrame::put_element_global; if(!method.max_numbered_params_count){ // this method uses numbered params? my=new HashString; if(method.locals_names) { // are there any local var names? // remember them // those are flags that fname is local == to be looked up in 'my' for(Array_iterator i(*method.locals_names); i.has_next(); ) { // speedup: not checking for clash with "result" fname const String& fname=*i.next(); set_my_variable(fname, *VString::empty()); } } #ifdef OPTIMIZE_RESULT if(method.result_optimization!=Method::RO_USE_WCONTEXT) #endif set_my_variable(result_var_name, void_result); } } Value* VMethodFrame::get_result_variable() { if(!my) return 0; Value* result=my->get(result_var_name); return result!=&void_result?result:0; } parser-3.4.3/src/types/pa_vdouble.h000644 000000 000000 00000003716 12116213475 017351 0ustar00rootwheel000000 000000 /** @file Parser: @b double parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VDOUBLE_H #define PA_VDOUBLE_H #define IDENT_PA_VDOUBLE_H "$Id: pa_vdouble.h,v 1.60 2013/03/07 22:39:57 moko Exp $" // includes #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" // defines #define VDOUBLE_TYPE "double" // externs extern Methoded* double_class; /// value of type 'double'. implemented with @c double class VDouble: public VStateless_object { public: // Value override const char* type() const { return VDOUBLE_TYPE; } override VStateless_class *get_class() { return double_class; } /// VDouble: true override bool is_evaluated_expr() const { return true; } /// VDouble: clone override Value& as_expr_result() { return *new VDouble(fdouble); } /** VDouble: fdouble */ override const String* get_string() { char local_buf[MAX_NUMBER]; size_t length=snprintf(local_buf, MAX_NUMBER, "%.15g", fdouble); return new String(strdup(local_buf, length)); } /// VDouble: fdouble override double as_double() const { return fdouble; } /// VDouble: fdouble override int as_int() const { return get_int(); } /// VDouble: 0 or !0 override bool as_bool() const { return fdouble!=0; } /// VInt: json-string override const String* get_json_string(Json_options&) { return get_string(); } public: // usage VDouble(double adouble): fdouble(adouble) {} int get_int() const { return (int)trunc(fdouble); } double get_double() const { return fdouble; } void inc(double increment) { fdouble+=increment; } void mul(double k) { fdouble*=k; } void div(double d) { if(d == 0) throw Exception("number.zerodivision", 0, "Division by zero"); fdouble/=d; } void mod(int d) { if(d == 0) throw Exception("number.zerodivision", 0, "Modulus by zero"); fdouble=((int)fdouble)%d; } private: double fdouble; }; #endif parser-3.4.3/src/types/pa_venv.h000644 000000 000000 00000001463 11730603301 016654 0ustar00rootwheel000000 000000 /** @file Parser: @b env class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VENV_H #define PA_VENV_H #define IDENT_PA_VENV_H "$Id: pa_venv.h,v 1.38 2012/03/16 09:24:17 moko Exp $" // includes #include "pa_sapi.h" #include "pa_value.h" #include "pa_string.h" // defines #define ENV_CLASS_NAME "env" static const String env_class_name(ENV_CLASS_NAME); /// env class class VEnv: public Value { SAPI_Info& finfo; public: // Value const char* type() const { return ENV_CLASS_NAME; } /// VEnv: 0 VStateless_class *get_class() { return 0; } // env: CLASS, CLASS_NAME, field Value* get_element(const String& aname); public: // usage VEnv(SAPI_Info& ainfo): finfo(ainfo) {} }; #endif parser-3.4.3/src/types/pa_vmath.h000644 000000 000000 00000001504 11730603302 017012 0ustar00rootwheel000000 000000 /** @file Parser: @b math class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VMATH_H #define PA_VMATH_H #define IDENT_PA_VMATH_H "$Id: pa_vmath.h,v 1.21 2012/03/16 09:24:18 moko Exp $" // includes #include "classes.h" #include "pa_common.h" // defines #define PI 3.14159265358979 #define MathE 2.718281828459 /** */ class VMath: public VStateless_class { public: // Value const char* type() const { return "math"; } // math: CLASS,method,field Value* get_element(const String& aname) { // $CLASS,$method if(Value* result=VStateless_class::get_element(aname)) return result; // $const return fconsts.get(aname); } public: // usage VMath(); private: HashStringValue fconsts; }; #endif parser-3.4.3/src/types/pa_vform.h000644 000000 000000 00000005345 12171262342 017040 0ustar00rootwheel000000 000000 /** @file Parser: @b form class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VFORM_H #define PA_VFORM_H #define IDENT_PA_VFORM_H "$Id: pa_vform.h,v 1.60 2013/07/16 15:21:06 moko Exp $" // includes #include "classes.h" #include "pa_common.h" #include "pa_value.h" // defines #define FORM_FIELDS_ELEMENT_NAME "fields" #define FORM_TABLES_ELEMENT_NAME "tables" #define FORM_IMAP_ELEMENT_NAME "imap" #define FORM_FILES_ELEMENT_NAME "files" // forwards class Request_info; class Request_charsets; enum POST_CONTENT_TYPE { UNKNOWN, FORM_URLENCODED, MULTIPART_FORMDATA }; /** derivates from VStateless_class so that :CLASS element referred to @a this. and users could do such tricks: @verbatim ^rem{pass somebody something with elements} ^rem{this time that would be elements of a form} ^somebody[$form:CLASS] ^rem{this time that would be elements of a table record} $news[^table:sql[select * from news]] ^somebody[^news.record[]] @endverbatim */ class VForm: public VStateless_class { public: // Value const char* type() const { return "form"; } // form: CLASS,CLASS_NAME,fields,tables,files,imap,method,field Value* get_element(const String& aname); Charset* get_post_charset(); public: // usage VForm(Request_charsets& acharsets, Request_info& arequest_info); private: Request_charsets& fcharsets; Request_info& frequest_info; bool is_post; bool is_post_charset_detected; POST_CONTENT_TYPE post_content_type; char *strpart(const char* str, size_t len); char *getAttributeValue(const char* data,const char *attr,size_t len); void UnescapeChars(char **sp, const char* cp, size_t len); void ParseGetFormInput(const char* query_string, size_t length); void ParseFormInput(const char* data, size_t length, Charset* client_charset=0); void ParseMimeInput(char *content_type, const char* data, size_t length, Charset* client_charset=0); void AppendFormEntry( const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, Charset* client_charset=0); void AppendFormFileEntry( const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, const char* file_name_cstr, Charset* client_charset=0); bool should_refill_fields_tables_and_files(); void refill_fields_tables_and_files(); void detect_post_charset(); private: Charset* filled_source; Charset* filled_client; Charset* fpost_charset; // charset which was specified in content-type in incoming POST HashStringValue fields; HashStringValue tables; HashStringValue files; HashStringValue imap; private: String::C transcode(const char* client, size_t client_size, Charset* client_charset=0); }; #endif parser-3.4.3/src/types/Makefile.in000644 000000 000000 00000044320 11766635216 017134 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/types DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libtypes_la_LIBADD = am_libtypes_la_OBJECTS = pa_value.lo pa_vcookie.lo pa_vfile.lo \ pa_vform.lo pa_vimage.lo pa_vjunction.lo pa_vregex.lo \ pa_vrequest.lo pa_vresponse.lo pa_vstateless_class.lo \ pa_vstring.lo pa_wcontext.lo pa_vtable.lo pa_vxnode.lo \ pa_vxdoc.lo pa_vstatus.lo pa_vmail.lo pa_vobject.lo \ pa_vclass.lo pa_vhashfile.lo pa_vmath.lo pa_vmethod_frame.lo \ pa_vvoid.lo pa_vhash.lo pa_venv.lo pa_vmemcached.lo libtypes_la_OBJECTS = $(am_libtypes_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtypes_la_SOURCES) DIST_SOURCES = $(libtypes_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I../classes -I../sql -I../lib/gd -I../lib/gc/include -I../lib/cord/include -I../lib/sdbm/pa-include -I../lib/memcached -I../classes/gd @PCRE_INCLUDES@ @XML_INCLUDES@ @MIME_INCLUDES@ noinst_HEADERS = pa_value.h pa_junction.h pa_method.h pa_vbool.h pa_vclass.h pa_vcode_frame.h pa_vcookie.h pa_vdate.h pa_vdouble.h pa_venv.h pa_vfile.h pa_vform.h pa_vhash.h pa_vhashfile.h pa_vimage.h pa_vint.h pa_vjunction.h pa_vmath.h pa_vmethod_frame.h pa_vobject.h pa_vregex.h pa_vrequest.h pa_vresponse.h pa_vstateless_class.h pa_vstateless_object.h pa_vstatus.h pa_vstring.h pa_vtable.h pa_vvoid.h pa_vxdoc.h pa_vxnode.h pa_wcontext.h pa_wwrapper.h pa_vmail.h pa_vmemory.h pa_vconsole.h pa_property.h pa_vmemcached.h noinst_LTLIBRARIES = libtypes.la libtypes_la_SOURCES = pa_value.C pa_vcookie.C pa_vfile.C pa_vform.C pa_vimage.C pa_vjunction.C pa_vregex.C pa_vrequest.C pa_vresponse.C pa_vstateless_class.C pa_vstring.C pa_wcontext.C pa_vtable.C pa_vxnode.C pa_vxdoc.C pa_vstatus.C pa_vmail.C pa_vobject.C pa_vclass.C pa_vhashfile.C pa_vmath.C pa_vmethod_frame.C pa_vvoid.C pa_vhash.C pa_venv.C pa_vmemcached.C EXTRA_DIST = types.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/types/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/types/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtypes.la: $(libtypes_la_OBJECTS) $(libtypes_la_DEPENDENCIES) $(CXXLINK) $(libtypes_la_OBJECTS) $(libtypes_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_value.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vclass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vcookie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_venv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vform.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vhash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vhashfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vimage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vjunction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmail.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmemcached.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmethod_frame.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vobject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vregex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vrequest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vresponse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vstateless_class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vstatus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vtable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vvoid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vxdoc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vxnode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_wcontext.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-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: parser-3.4.3/src/types/pa_vdate.h000644 000000 000000 00000013167 11760753150 017020 0ustar00rootwheel000000 000000 /** @file Parser: @b date parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VDATE_H #define PA_VDATE_H #define IDENT_PA_VDATE_H "$Id: pa_vdate.h,v 1.55 2012/05/28 19:47:52 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_vint.h" // defines #define VDATE_TYPE "date" // externs extern Methoded* date_class; inline void set_tz(const char* tz, char* buf, size_t buf_size) { #ifndef WIN32 if(tz && *tz){ #endif snprintf(buf, buf_size, "TZ=%s", tz); putenv(buf); #ifndef WIN32 } else #ifdef HAVE_UNSETENV unsetenv("TZ"); #else putenv("TZ"); #endif #endif tzset(); } /// value of type 'date'. implemented with @c time_t class VDate: public VStateless_object { public: // Value override const char* type() const { return VDATE_TYPE; } override VStateless_class *get_class() { return date_class; } /// VDate: json-string override const String* get_json_string(Json_options& options) { String* result=new String(); switch(options.date){ case Json_options::D_SQL: result->append_quoted(get_sql_string()); break; case Json_options::D_GMT: result->append_quoted(get_gmt_string()); break; case Json_options::D_TIMESTAMP: *result << format((int)ftime, 0); break; } return result; } /// VDate: ftime -> float days override Value& as_expr_result() { return *new VDouble(as_double()); } /// VDate: true override bool is_evaluated_expr() const { return true; } /// VDate: ftime -> float days override double as_double() const { return ((double)ftime)/ SECS_PER_DAY; } /// VDate: 0 or !0 override bool as_bool() const { return ftime!=0; } /// @TODO 'static' approach is NOT thread safe! tm& get_localtime() { char saved_tz[MAX_STRING]; static char saved_tz_pair[MAX_STRING]; // @TODO: this is NOT thread safe! static char temp_tz_pair[MAX_STRING]; if(ftz_cstr) { if(const char* ltz=getenv("TZ")) { strncpy(saved_tz, ltz, sizeof(saved_tz)-1); saved_tz[sizeof(saved_tz)-1]=0; } else saved_tz[0]=0; ::set_tz(ftz_cstr, temp_tz_pair, sizeof(temp_tz_pair)); } tm *result=::localtime(&ftime); if(ftz_cstr) { ::set_tz(saved_tz, saved_tz_pair, sizeof(saved_tz_pair)); } if(!result) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid datetime (after changing TZ)"); return *result; } enum sql_string_type {sql_string_datetime, sql_string_date, sql_string_time}; const String* get_sql_string(sql_string_type format = sql_string_datetime) { static const char* formats[]={ "%Y-%m-%d %H:%M:%S", "%Y-%m-%d", "%H:%M:%S" }; static int sizes[]={ 4+1+2+1+2 +1+ 2+1+2+1+2 +1/*terminator*/, 4+1+2+1+2 +1/*terminator*/, 2+1+2+1+2 +1/*terminator*/ }; size_t size=sizes[format]; char *buf=new(PointerFreeGC) char[size]; strftime(buf, size, formats[format], &get_localtime()); return new String(buf); } const String* get_gmt_string(){ return new String(date_gmt_string(gmtime(&ftime))); } /// VDate: method,field override Value* get_element(const String& aname) { // $method if(Value* result=VStateless_object::get_element(aname)) return result; // $TZ if(aname=="TZ") return ftz? new VString(*ftz): new VString(); // $year month day hour minute second weekday tm& tms=get_localtime(); int result; if(aname=="year") result=1900+tms.tm_year; else if(aname=="month") result=1+tms.tm_mon; else if(aname=="day") result=tms.tm_mday; else if(aname=="hour") result=tms.tm_hour; else if(aname=="minute") result=tms.tm_min; else if(aname=="second") result=tms.tm_sec; else if(aname=="weekday") result=tms.tm_wday; else if(aname=="yearday") result=tms.tm_yday; else if(aname=="daylightsaving") result=tms.tm_isdst; else if(aname=="week") { yw week = CalcWeek(tms); result=week.week; } else if(aname=="weekyear") { yw week = CalcWeek(tms); result=1900+week.year; } else { return bark("%s field not found", &aname); } return new VInt(result); } public: // usage VDate(time_t adate) : ftz(0), ftz_cstr(0) { set_time(adate); } VDate(tm tmIn) : ftime(0), ftz(0), ftz_cstr(0) { set_time(tmIn); } time_t get_time() const { return ftime; } void set_time(time_t atime) { if(atime<0) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid datetime"); ftime=atime; } void set_time(tm tmIn) { time_t t=mktime(&tmIn); if(t<0) { // on some platforms mktime does not fix spring daylightsaving time hole // in russia -- last sunday of march, 2am->3am hole // trying to recover: tmIn.tm_hour--; t=mktime(&tmIn); } set_time(t); } void set_tz(const String* atz) { if((ftz=atz)) ftz_cstr=ftz->cstr(); } struct yw { int year; int week; }; static yw CalcWeek(tm& tms) { yw week = {tms.tm_year, 0}; // http://www.merlyn.demon.co.uk/weekinfo.htm static const unsigned int FirstThurs[] = {7,5,4,3,2,7,6,5,4,2,1,7,6,4,3,2,1,6,5,4,3,1,7,6,5,3,2,1}; int diff = tms.tm_yday-(FirstThurs[(tms.tm_year+1900) % 28]-4); if (diff < 0){ tms.tm_mday = diff; mktime(&tms); // normalize week = CalcWeek(tms); } else { week.week = 1 + diff/7; if ( week.week > 52 && ISOWeekCount(week.year) < week.week ){ week.year++; week.week = 1; } } return week; } static int ISOWeekCount (int year) { static const unsigned int YearWeeks[] = { 52,52,52,52,53, 52,52,52,52,52, 53,52,52,52,52, 52,53,52,52,52, 52,53,52,52,52, 52,52,53 }; return YearWeeks[(year+1900) % 28]; } private: time_t ftime; const String* ftz; const char* ftz_cstr; }; #endif parser-3.4.3/src/types/pa_vhash.C000644 000000 000000 00000001304 11730603301 016734 0ustar00rootwheel000000 000000 /** @file Parser: @b hash class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vhash.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VHASH_C="$Id: pa_vhash.C,v 1.10 2012/03/16 09:24:17 moko Exp $" IDENT_PA_VHASH_H; // globals const String hash_fields_name(HASH_FIELDS_NAME), hash_default_element_name(HASH_DEFAULT_ELEMENT_NAME); VFile* VHash::as_vfile(String::Language /*lang*/, const Request_charsets * /*charsets*/) { return new VFile(fhash); } void VHash::extract_default() { if( (_default=fhash.get(HASH_DEFAULT_ELEMENT_NAME) ) ) fhash.remove(HASH_DEFAULT_ELEMENT_NAME); } parser-3.4.3/src/types/pa_vfile.h000644 000000 000000 00000006110 12175501771 017011 0ustar00rootwheel000000 000000 /** @file Parser: @b file parser type decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VFILE_H #define PA_VFILE_H #define IDENT_PA_VFILE_H "$Id: pa_vfile.h,v 1.77 2013/07/29 15:02:17 moko Exp $" // include #include "pa_common.h" #include "pa_globals.h" #include "pa_vstateless_object.h" #include "pa_vbool.h" // defines #define NONAME_DAT "noname.dat" #define VFILE_TYPE "file" #define MODE_NAME "mode" static const String mode_name(MODE_NAME); // forwards class Methoded; /** holds received from user or read from disk file. @see VForm */ class VFile: public VStateless_object { const char* fvalue_ptr; size_t fvalue_size; bool ftext_tainted; bool fis_text_mode; bool fis_text_content; HashStringValue ffields; public: // Value override const char* type() const { return VFILE_TYPE; } override VStateless_class *get_class(); /// VFile: true override bool as_bool() const { return true; } /// VFile: true override Value& as_expr_result() { return VBool::get(true); } /// VFile: this override VFile* as_vfile(String::Language /*lang*/, const Request_charsets* /*charsets*/) { return this; } /// VFile: json-string override const String* get_json_string(Json_options& options); /// VFile: method,field override Value* get_element(const String& aname); public: // usage VFile(): fvalue_ptr(0), fvalue_size(0), ftext_tainted(false), fis_text_mode(false), fis_text_content(false){} VFile(HashStringValue& afields): fvalue_ptr(0), fvalue_size(0), ftext_tainted(false), fis_text_mode(false), fis_text_content(false), ffields(afields) {} /// WARNING: when setting text files be sure to append terminating zero to avalue_ptr /// WARNING: the content can be modified while creating "text" vfile void set(bool atainted, bool ais_text_mode, char* avalue_ptr, size_t avalue_size, const String* afile_name=0, Value* acontent_type=0, Request* r=0); void set(VFile& avfile, bool aset_text_mode, bool ais_text_mode, const String* afile_name=0, Value* acontent_type=0, Request* r=0); void set_binary(bool atainted, const char* avalue_ptr, size_t avalue_size, const String* afile_name=0, Value* acontent_type=0, Request* r=0); void set_binary_string(bool atainted, const char* avalue_ptr, size_t avalue_size); void save(Request_charsets& charsets, const String& file_spec, bool is_text, Charset* asked_charset=0); static bool is_text_mode(const String& mode); static bool is_valid_mode (const String& mode); const char* value_ptr() const { if(!fvalue_ptr) throw Exception(PARSER_RUNTIME, 0, "getting value of stat-ed file"); return fvalue_ptr; } size_t value_size() const { return fvalue_size; } HashStringValue& fields() { return ffields; } private: const char* text_cstr(); void set_all(bool atainted, bool ais_text_mode, const char* avalue_ptr, size_t avalue_size, const String* afile_name); void set_mode(bool ais_text); void set_name(const String* afile_name); void set_content_type(Value* acontent_type, const String* afile_name=0, Request* r=0); }; #endif parser-3.4.3/src/types/pa_vtable.C000644 000000 000000 00000012534 11760753150 017122 0ustar00rootwheel000000 000000 /** @file Parser: @b table class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vtable.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vvoid.h" volatile const char * IDENT_PA_VTABLE_C="$Id: pa_vtable.C,v 1.38 2012/05/28 19:47:52 moko Exp $" IDENT_PA_VTABLE_H; #ifndef DOXYGEN struct Record_info { Table* table; HashStringValue* hash; }; #endif static void store_column_item_to_hash(const String* column_name, Record_info *info) { const String* column_item=info->table->item(*column_name); info->hash->put(*column_name, (column_item && !column_item->is_empty()) ?new VString(*column_item) :new VString() ); } Value* VTable::fields_element() { Value& result=*new VHash; Table& ltable=table(); if(!ltable.count()) return &result; HashStringValue* hash=result.get_hash(); if(Table::columns_type columns=ltable.columns()) { // named Record_info record_info={<able, hash}; columns->for_each(store_column_item_to_hash, &record_info); } else { // nameless size_t row_size=ltable[ltable.current()]->count(); // number of columns in current row for(size_t index=0; indexput(String::Body::Format(index), (column_item && !column_item->is_empty()) ?new VString(*column_item) :new VString() ); } } return &result; } Value* VTable::get_element(const String& aname) { // fields if(aname==TABLE_FIELDS_ELEMENT_NAME) return fields_element(); // methods if(Value* result=VStateless_object::get_element(aname)) return result; // columns if(ftable) { int index=ftable->column_name2index(aname, false); if(index>=0) // column aname|number valid { const String* string=ftable->item(index); // there is such column return new VString(string ? *string : String::Empty); } } throw Exception(PARSER_RUNTIME, &aname, "column not found"); } String& VTable::get_json_string_array(String& result, const char *indent) { // [ // ["c1", "c2", "c3" ...] || null (for nameless), // ["v11", "v12", "v13" ...], // ["v21", "v22", "v23" ...], // ... // ] Table& ltable=table(); // columns if(ltable.columns()){ // named indent ? result << "\n\t" << indent << "[\"" : result << "\n[\""; bool need_delim=false; for(Array_iterator c(*ltable.columns()); c.has_next(); ) { if(need_delim) result << "\",\""; result.append(*c.next(), String::L_JSON, true/*forced lang*/); need_delim=true; } result << "\"]"; } else { // nameless indent ? result << "\n\t" << indent << "null" : result << "\nnull"; } // data if(ltable.count()){ result << ","; for(Array_iterator r(ltable); r.has_next(); ) { indent ? result << "\n\t" << indent << "[\"" : result << "\n[\""; bool need_delim=false; for(Array_iterator c(*r.next()); c.has_next(); ) { if(need_delim) result << "\",\""; result.append(*c.next(), String::L_JSON, true/*forced lang*/); need_delim=true; } r.has_next() ? result << "\"]," : result << "\"]"; } } result << "\n" << indent; return result; } String& VTable::get_json_string_object(String& result, const char *indent) { // [ // {"c1":"v11", "c2":"v12", "c3":"v13"}, // {"c1":"v21", "c2":"v22", "c3":"v23"}, // ... // ] Table& ltable=table(); ArrayString* columns=ltable.columns(); size_t columns_count = (columns) ? columns->count() : 0; for(Array_iterator r(ltable); r.has_next(); ) { indent ? result << "\n\t" << indent << "{\"" : result << "\n{\""; ArrayString* row=r.next(); for(size_t index=0; indexcount(); index++){ if(index) result << "\",\""; result.append(index < columns_count ? *columns->get(index) : String(format(index, 0)), String::L_JSON, true/*forced lang*/); result << "\":\""; result.append(*row->get(index), String::L_JSON, true/*forced lang*/); } r.has_next() ? result << "\"}," : result << "\"}\n" << indent; } return result; } String& VTable::get_json_string_compact(String& result, const char *indent) { // [ // "v11", // ["v21", "v22", "v23" ...], // ... // ] Table& ltable=table(); for(Array_iterator r(ltable); r.has_next(); ) { ArrayString& line=*r.next(); if (line.count()==1){ indent ? result << "\n\t" << indent << "\"" : result << "\n\""; result.append(*line[0], String::L_JSON, true/*forced lang*/); r.has_next() ? result << "\"," : result << "\"\n" << indent; } else { indent ? result << "\n\t" << indent << "[\"" : result << "\n[\""; bool need_delim=false; for(Array_iterator c(line); c.has_next(); ) { if(need_delim) result << "\",\""; result.append(*c.next(), String::L_JSON, true/*forced lang*/); need_delim=true; } r.has_next() ? result << "\"]," : result << "\"]\n" << indent; } } return result; } const String* VTable::get_json_string(Json_options& options) { String* result = new String("[", String::L_AS_IS); switch(options.table){ case Json_options::T_ARRAY: result=&get_json_string_array(*result, options.indent); break; case Json_options::T_OBJECT: result=&get_json_string_object(*result, options.indent); break; case Json_options::T_COMPACT: result=&get_json_string_compact(*result, options.indent); break; } *result << "]"; return result; } parser-3.4.3/src/types/pa_vresponse.C000644 000000 000000 00000002552 12223630565 017667 0ustar00rootwheel000000 000000 /** @file Parser: @b response class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vresponse.h" #include "pa_request_charsets.h" #include "pa_charsets.h" #include "pa_charset.h" #include "pa_vstring.h" #include "pa_vdate.h" #include "pa_vhash.h" volatile const char * IDENT_PA_VRESPONSE_C="$Id: pa_vresponse.C,v 1.31 2013/10/04 21:21:57 moko Exp $" IDENT_PA_VRESPONSE_H; // defines #define REQUEST_HEADERS_ELEMENT_NAME "headers" Value* VResponse::get_element(const String& aname) { // $charset if(aname==CHARSET_NAME) return new VString(*new String(fcharsets.client().NAME(), String::L_TAINTED)); // $headers if(aname==REQUEST_HEADERS_ELEMENT_NAME) return new VHash(ffields); // $method if(Value* result=VStateless_object::get_element(aname)) return result; // $field return ffields.get(aname.change_case(fcharsets.source(), String::CC_LOWER)); } const VJunction* VResponse::put_element(const String& aname, Value* avalue) { // guard charset change if(aname==CHARSET_NAME) fcharsets.set_client(charsets.get(avalue->as_string(). change_case(UTF8_charset, String::CC_UPPER))); else ffields.put( aname.change_case(fcharsets.source(), String::CC_LOWER), avalue && avalue->is_void()? 0: avalue); return PUT_ELEMENT_REPLACED_ELEMENT; } parser-3.4.3/src/types/pa_vmail.h000644 000000 000000 00000001764 11730603302 017013 0ustar00rootwheel000000 000000 /** @file Parser: @b mail class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VMAIL_H #define PA_VMAIL_H #define IDENT_PA_VMAIL_H "$Id: pa_vmail.h,v 1.20 2012/03/16 09:24:18 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vhash.h" // defines #define MAIL_RECEIVED_ELEMENT_NAME "received" #define MAIL_OPTIONS_NAME "options" #define MAIL_DEBUG_NAME "print-debug" // forwards class Request_info; /** $mail:received letter */ class VMail: public VStateless_class { VHash vreceived; public: // Value override const char* type() const { return "mail"; } // mail: CLASS,methods,received field Value* get_element(const String& aname); public: // usage VMail(); void fill_received(Request& r); const String& message_hash_to_string(Request& r, HashStringValue* message_hash, int level, const String* & from, bool extract_to, String* & to); }; #endif parser-3.4.3/src/types/pa_vjunction.h000644 000000 000000 00000003537 11757207701 017736 0ustar00rootwheel000000 000000 /** @file Parser: @b junction class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VJUNCTION_H #define PA_VJUNCTION_H #define IDENT_PA_VJUNCTION_H "$Id: pa_vjunction.h,v 1.32 2012/05/23 16:26:41 moko Exp $" // include #include "pa_value.h" #include "pa_junction.h" #define JUNCTION_CLASS_NAME "junction" static const String junction_class_name(JUNCTION_CLASS_NAME); /// junction is method+self+context, implemented with Junction class VJunction: public Value { public: // VJunction override const char* type() const { return JUNCTION_CLASS_NAME; } /// VJunction: 0 override VStateless_class *get_class() { return 0; } /// VJunction: false override bool is_defined() const { return false; } /// VJunction: false override bool as_bool() const { return false; } /// VJunction: false override Value& as_expr_result(); /// VJunction: method, root,self,rcontext, code override Junction* get_junction() { return &fjunction; } // VJunction: CLASS, CLASS_NAME override Value* get_element(const String& aname); public: // usage /// Code-Junction constructor VJunction(Value& aself, const Method* amethod, VMethodFrame* amethod_frame, Value* arcontext, WContext* awcontext, ArrayOperation* acode): fjunction(aself, amethod, amethod_frame, arcontext, awcontext, acode) {} /// Method-Junction or Getter-Junction constructor VJunction(Value& aself, const Method* amethod, bool ais_getter=false, String* aauto_name=0 ): fjunction(aself, amethod, ais_getter, aauto_name) {} const Junction& junction() const { return fjunction; } inline VJunction *get(Value& aself){ return &(fjunction.self)==&aself?this:new VJunction(aself, fjunction.method); } void reattach(WContext *new_wcontext); private: Junction fjunction; }; #endif parser-3.4.3/src/types/Makefile.am000644 000000 000000 00000002164 11766067564 017130 0ustar00rootwheel000000 000000 INCLUDES = -I../classes -I../sql -I../lib/gd -I../lib/gc/include -I../lib/cord/include -I../lib/sdbm/pa-include -I../lib/memcached -I../classes/gd @PCRE_INCLUDES@ @XML_INCLUDES@ @MIME_INCLUDES@ noinst_HEADERS = pa_value.h pa_junction.h pa_method.h pa_vbool.h pa_vclass.h pa_vcode_frame.h pa_vcookie.h pa_vdate.h pa_vdouble.h pa_venv.h pa_vfile.h pa_vform.h pa_vhash.h pa_vhashfile.h pa_vimage.h pa_vint.h pa_vjunction.h pa_vmath.h pa_vmethod_frame.h pa_vobject.h pa_vregex.h pa_vrequest.h pa_vresponse.h pa_vstateless_class.h pa_vstateless_object.h pa_vstatus.h pa_vstring.h pa_vtable.h pa_vvoid.h pa_vxdoc.h pa_vxnode.h pa_wcontext.h pa_wwrapper.h pa_vmail.h pa_vmemory.h pa_vconsole.h pa_property.h pa_vmemcached.h noinst_LTLIBRARIES = libtypes.la libtypes_la_SOURCES = pa_value.C pa_vcookie.C pa_vfile.C pa_vform.C pa_vimage.C pa_vjunction.C pa_vregex.C pa_vrequest.C pa_vresponse.C pa_vstateless_class.C pa_vstring.C pa_wcontext.C pa_vtable.C pa_vxnode.C pa_vxdoc.C pa_vstatus.C pa_vmail.C pa_vobject.C pa_vclass.C pa_vhashfile.C pa_vmath.C pa_vmethod_frame.C pa_vvoid.C pa_vhash.C pa_venv.C pa_vmemcached.C EXTRA_DIST = types.vcproj parser-3.4.3/src/types/pa_vxnode.C000644 000000 000000 00000013213 12223630566 017143 0ustar00rootwheel000000 000000 /** @node Parser: @b dnode parser type. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "pa_vxnode.h" #include "pa_vxdoc.h" #include "pa_vstring.h" #include "pa_vbool.h" #include "pa_vhash.h" #include "pa_request_charsets.h" #include "pa_charset.h" #include "pa_xml_exception.h" volatile const char * IDENT_PA_VXNODE_C="$Id: pa_vxnode.C,v 1.54 2013/10/04 21:21:58 moko Exp $" IDENT_PA_VXNODE_H; Request_charsets& VXnode::charsets() { return get_vxdoc().charsets(); } /// VXnode: true Value& VXnode::as_expr_result() { return VBool::get(as_bool()); } Value* VXnode::get_element(const String& aname) { // $CLASS,$method if(Value* result=VStateless_object::get_element(aname)) return result; // fields xmlNode& selfNode=get_xmlnode(); if(aname=="nodeName") { return new VString(charsets().source().transcode(selfNode.name)); } else if(aname=="nodeValue") { switch(selfNode.type) { case XML_ATTRIBUTE_NODE: case XML_PI_NODE: case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: return new VString(charsets().source().transcode(xmlNodeGetContent(&selfNode))); default: return 0; } } else if(aname=="nodeType") { return new VInt(selfNode.type); } else if(aname=="parentNode") { if(xmlNode* result_node=selfNode.parent) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="childNodes") { if(xmlNode* currentNode=selfNode.children) { VHash* result=new VHash; int i=0; do { result->hash().put( String::Body::Format(i++), &get_vxdoc().wrap(*currentNode)); } while((currentNode=currentNode->next)); return result; } return 0; } else if(aname=="firstChild") { if(xmlNode* result_node=selfNode.children) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="lastChild") { if(xmlNode* result_node=selfNode.last) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="previousSibling") { if(xmlNode* result_node=selfNode.prev) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="nextSibling") { if(xmlNode* result_node=selfNode.next) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="ownerDocument") { return &get_vxdoc(); } else switch(selfNode.type) { case XML_ELEMENT_NODE: if(aname=="attributes") { if(xmlNode* currentNode=(xmlNode*)selfNode.properties) { VHash* result=new VHash; do { result->hash().put( charsets().source().transcode(currentNode->name), &get_vxdoc().wrap(*currentNode)); } while((currentNode=currentNode->next)); return result; } return 0; } else if(aname=="tagName") return new VString(charsets().source().transcode(selfNode.name)); else if(aname=="prefix") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->prefix)) : 0); else if(aname=="namespaceURI") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->href)) : 0); break; case XML_ATTRIBUTE_NODE: if(aname=="specified") return &VBool::get(true); // were not working in gdome, leaving out else if(aname=="name") return new VString(charsets().source().transcode(selfNode.name)); else if(aname=="value") return new VString(charsets().source().transcode(xmlNodeGetContent(&selfNode))); else if(aname=="prefix") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->prefix)) : 0); else if(aname=="namespaceURI") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->href)) : 0); break; /* case XML_COMMENT_NODE: substringData(unsigned int offset, unsigned int count) */ case XML_PI_NODE: if(aname=="target") return new VString(charsets().source().transcode(selfNode.name)); else if(aname=="data") return new VString(charsets().source().transcode(xmlNodeGetContent(&selfNode))); break; case XML_DTD_NODE: { if(aname=="name") { // readonly attribute DOMString aname; // The aname of DTD; i.e., the aname immediately following // the DOCTYPE keyword in an XML source document. return new VString(charsets().source().transcode(selfNode.name)); } /* readonly attribute NamedNodeMap entities; readonly attribute NamedNodeMap notations; virtual const XalanNamedNodeMap* getEntities () const = 0 This function returns a NamedNodeMap containing the general entities, both external and internal, declared in the DTD. More... virtual const XalanNamedNodeMap* getNotations () const = 0 This function returns a named selfNode map containing an entry for each notation declared in a document's DTD. More... */ } break; /* someday case XML_NOTATION_NODE: { GdomeNotation *notation=XML_NOT(selfNode); if(aname=="publicId") { // readonly attribute DOMString publicId; return new VString(charsets().source().transcode(gdome_not_publicId(notation, &exc))); } else if(aname=="systemId") { // readonly attribute DOMString systemId; return new VString(charsets().source().transcode(gdome_not_systemId(notation, &exc))); } } break; */ default: // calm compiler on unhandled cases break; } return bark("%s field not found", &aname); } const VJunction* VXnode::put_element(const String& aname, Value* avalue) { xmlNode& selfNode=get_xmlnode(); if(aname=="nodeValue") { xmlNodeSetContent(&selfNode, charsets().source().transcode(avalue->as_string())); return PUT_ELEMENT_REPLACED_ELEMENT; } bark("element can not be stored to %s", &aname); return 0; } #endif parser-3.4.3/src/types/pa_vbool.h000644 000000 000000 00000003272 11760753150 017032 0ustar00rootwheel000000 000000 /** @file Parser: @b bool class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VBOOL_H #define PA_VBOOL_H #define IDENT_PA_VBOOL_H "$Id: pa_vbool.h,v 1.35 2012/05/28 19:47:52 moko Exp $" // include #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" // defines #define VBOOL_TYPE "bool" #define MAX_BOOL_AS_STRING 20 extern Methoded* bool_class; // VBool class VBool: public VStateless_object { public: // Value override const char* type() const { return VBOOL_TYPE; } /// VBool: 0 override VStateless_class *get_class() { return bool_class; } /// VBool: true override bool is_evaluated_expr() const { return true; } /// VBool: clone override Value& as_expr_result() { return *this; } /// VBool: true virtual bool is_defined() const { return true; } /// VBool: fbool override double as_double() const { return fbool ? 1 : 0; } /// VBool: fbool override int as_int() const { return fbool ? 1 : 0; } /// VBool: fbool override bool as_bool() const { return fbool; } override bool is_bool() const { return true; } /// VBool: json-string ("true"|"false") override const String* get_json_string(Json_options&) { static const String singleton_json_true(String("true")), singleton_json_false(String("false")); return fbool ? &singleton_json_true : &singleton_json_false; } inline static VBool &get(bool abool){ static VBool singleton_true(true), singleton_false(false); return abool?singleton_true:singleton_false; } public: // usage VBool(bool abool): fbool(abool) {} bool get_bool() { return fbool; } private: bool fbool; }; #endif parser-3.4.3/src/types/pa_vmemcached.h000644 000000 000000 00000002465 12223630564 020006 0ustar00rootwheel000000 000000 /** @file Parser: memcached class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Ivan Poluyanov Artem Stepanov */ #ifndef PA_VMEMCACHED_H #define PA_VMEMCACHED_H #define IDENT_PA_VMEMCACHED_H "$Id: pa_vmemcached.h,v 1.6 2013/10/04 21:21:56 moko Exp $" #include "classes.h" #include "pa_vstateless_object.h" #include "pa_memcached.h" // defines #define VMEMCACHED_TYPE "memcached" // externs extern Methoded *memcached_class; class VMemcached: public VStateless_object { public: override const char* type() const { return VMEMCACHED_TYPE; } override VStateless_class *get_class() { return memcached_class; } override bool as_bool() const { return true; } override Value* get_element(const String& aname); override const VJunction* put_element(const String& aname, Value* avalue); public: // usage VMemcached(): fm(0), fttl(0) {} ~VMemcached(){ if(fm) f_memcached_free(fm); } void open(const String& options_string, time_t attl); void open_parse(const String& connect_string, time_t attl); bool add(const String& aname, Value* avalue); void remove(const String& aname); void flush(time_t attl=0); void quit(); Value &mget(ArrayString &akeys); private: memcached_st* fm; time_t fttl; }; #endif parser-3.4.3/src/types/pa_vstateless_class.C000644 000000 000000 00000010055 12225074132 021214 0ustar00rootwheel000000 000000 /** @file Parser: stateless class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru)\ */ #include "pa_vstateless_class.h" #include "pa_vstring.h" #include "pa_vbool.h" #include "pa_request.h" volatile const char * IDENT_PA_VSTATELESS_CLASS_C="$Id: pa_vstateless_class.C,v 1.50 2013/10/08 21:25:46 moko Exp $" IDENT_PA_VSTATELESS_CLASS_H IDENT_PA_METHOD_H; /// globals const String class_name(CLASS_NAME), class_nametext(CLASS_NAMETEXT); override Value& VStateless_class::as_expr_result() { return VBool::get(as_bool()); } /// @TODO why?! request must be different ptr from global [used in VStateless_class.set_method] void VStateless_class::set_method(const String& aname, Method* amethod) { if(flocked) throw Exception(PARSER_RUNTIME, &aname, "can not add method to system class (maybe you have forgotten .CLASS in ^process[$caller.CLASS]{...}?)"); if(fderived.count()) { Method *omethod=fmethods.get(aname); Array_iterator i(fderived); while(i.has_next()) { VStateless_class *c=i.next(); if(c->fmethods.get(aname)==omethod) c->real_set_method(aname, amethod); } } real_set_method(aname, amethod); } void VStateless_class::real_set_method(const String& aname, Method* amethod) { fmethods.put(aname, amethod); } void VStateless_class::add_native_method( const char* cstr_name, Method::Call_type call_type, NativeCodePtr native_code, int min_numbered_params_count, int max_numbered_params_count, Method::Call_optimization #ifdef OPTIMIZE_CALL call_optimization #endif ) { Method* method=new Method( call_type, min_numbered_params_count, max_numbered_params_count, 0/*params_names*/, 0/*locals_names*/, 0/*parser_code*/, native_code, false/*all_vars_local*/ #ifdef OPTIMIZE_RESULT , Method::RO_USE_WCONTEXT #endif #ifdef OPTIMIZE_CALL , call_optimization #endif ); set_method(*new String(cstr_name), method); } /// VStateless_class: $CLASS, $CLASS_NAME, $method Value* VStateless_class::get_element(Value& aself, const String& aname) { // $CLASS if(aname==class_name) return this; // $CLASS_NAME if(aname==class_nametext) return new VString(name()); // $method=junction(self+class+method) if(Method* method=get_method(aname)) return method->get_vjunction(aself); return 0; } Value* VStateless_class::get_scalar(Value& aself){ if(fscalar) return new VJunction(aself, fscalar, true /*getter*/); return 0; } void VStateless_class::set_scalar(Method* amethod){ fscalar=amethod; } Value* VStateless_class::get_default_getter(Value& aself, const String& aname){ if(fdefault_getter && aself.is_enabled_default_getter()) return new VJunction(aself, fdefault_getter, true /*getter*/, (String*)&aname); return 0; } void VStateless_class::set_default_getter(Method* amethod){ fdefault_getter=amethod; } bool VStateless_class::has_default_getter(){ return fdefault_getter != NULL; } VJunction* VStateless_class::get_default_setter(Value& aself, const String& aname){ if(fdefault_setter && aself.is_enabled_default_setter()) return new VJunction(aself, fdefault_setter, false /*setter*/, (String*)&aname); return 0; } void VStateless_class::set_default_setter(Method* amethod){ fdefault_setter=amethod; } bool VStateless_class::has_default_setter(){ return fdefault_setter != NULL; } void VStateless_class::set_base(VStateless_class* abase){ if(abase){ fbase=abase; fbase->add_derived(*this); bool no_auto = fmethods.get(auto_method_name) == NULL; // we assume there is no derivatives at this point fmethods.merge_dont_replace(abase->fmethods); // we don't want to inherit @auto (issue #75) if (no_auto) fmethods.remove(auto_method_name); if(fbase->fscalar && !fscalar) fscalar=fbase->fscalar; if(fbase->fdefault_getter && !fdefault_getter) fdefault_getter=fbase->fdefault_getter; if(fbase->fdefault_setter && !fdefault_setter) fdefault_setter=fbase->fdefault_setter; } } void VStateless_class::add_derived(VStateless_class &aclass){ fderived+=&aclass; if (fbase) fbase->add_derived(aclass); } parser-3.4.3/src/types/pa_vint.h000644 000000 000000 00000003604 11760753150 016670 0ustar00rootwheel000000 000000 /** @file Parser: @b int parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VINT_H #define PA_VINT_H #define IDENT_PA_VINT_H "$Id: pa_vint.h,v 1.51 2012/05/28 19:47:52 moko Exp $" // include #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" // defines #define VINT_TYPE "int" extern Methoded* int_class; /// value of type 'int'. implemented with @c int class VInt: public VStateless_object { public: // Value override const char* type() const { return VINT_TYPE; } override VStateless_class *get_class() { return int_class; } /// VInt: true override bool is_evaluated_expr() const { return true; } /// VInt: clone override Value& as_expr_result() { return *new VInt(finteger); } /// VInt: finteger override const String* get_string() { char local_buf[MAX_NUMBER]; size_t length=snprintf(local_buf, MAX_NUMBER, "%d", finteger); return new String(strdup(local_buf, length)); } /// VInt: finteger override double as_double() const { return as_int(); } /// VInt: finteger override int as_int() const { return finteger; } /// VInt: 0 or !0 override bool as_bool() const { return finteger!=0; } /// VInt: json-string override const String* get_json_string(Json_options&) { return get_string(); } public: // usage VInt(int ainteger): finteger(ainteger) {} int get_int() { return finteger; } void set_int(int ainteger) { finteger=ainteger; } void inc(int increment) { finteger+=increment; } void mul(double k) { finteger=(int)(finteger*k); } void div(double d) { if(d == 0) throw Exception("number.zerodivision", 0, "Division by zero"); finteger=(int)(finteger/d); } void mod(int d) { if(d == 0) throw Exception("number.zerodivision", 0, "Modulus by zero"); finteger%=d; } private: int finteger; }; #endif parser-3.4.3/src/types/pa_vimage.h000644 000000 000000 00000005174 12223630564 017162 0ustar00rootwheel000000 000000 /** @file Parser: @b image parser type decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VIMAGE_H #define PA_VIMAGE_H #define IDENT_PA_VIMAGE_H "$Id: pa_vimage.h,v 1.55 2013/10/04 21:21:56 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_charset.h" // defines #define VIMAGE_TYPE "image" #define EXIF_ELEMENT_NAME "exif" // forwards class gdImage; /// simple gdImage-based font storage & text output class Font: public PA_Object { public: int letterspacing; int height; ///< Font heigth int monospace; ///< Default char width int spacebarspace; ///< spacebar width gdImage* ifont; const String& alphabet; Font( Charset& acharset, const String& aalphabet, gdImage* aifont, int aheight, int amonospace, int aspacebarspace, int aletterspacing); //@{******************************** char ********************************** size_t index_of(char ch); size_t index_of(XMLCh ch); int index_width(size_t index); void index_display(gdImage& image, int x, int y, size_t index); //@} //@{******************************* string ********************************* int step_width(int index); //@} /// counts trailing letter_spacing, consider this OK. useful for contiuations int string_width(const String& s); void string_display(gdImage& image, int x, int y, const String& s); private: Charset& fsource_charset; Hash fletter2index; }; // externs extern Methoded* image_class; /** holds img attributes and [image itself] */ class VImage: public VStateless_object { public: // Value override const char* type() const { return VIMAGE_TYPE; } override VStateless_class *get_class() { return image_class; } /// VImage: true override bool as_bool() const { return true; } /// VImage: true override Value& as_expr_result(); /// VImage: method,field override Value* get_element(const String& aname); /// VImage: field override const VJunction* put_element(const String& name, Value* value); public: // usage void set(const String* src, int width, int height, gdImage* aimage, Value* aexif=0); HashStringValue& fields() { return ffields; } public: gdImage& image() { if(!fimage) throw Exception(PARSER_RUNTIME, 0, "using unitialized image object"); return *fimage; } void set_font(Font* afont) { ffont=afont; } Font& font() { if(!ffont) throw Exception(PARSER_RUNTIME, 0, "set the font first"); return *ffont; } private: gdImage* fimage; Font* ffont; HashStringValue ffields; Value* fexif; }; #endif parser-3.4.3/src/types/pa_junction.h000644 000000 000000 00000004354 11730603300 017530 0ustar00rootwheel000000 000000 /** @file Parser: Junction class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_JUNCTION_H #define PA_JUNCTION_H #define IDENT_PA_JUNCTION_H "$Id: pa_junction.h,v 1.11 2012/03/16 09:24:16 moko Exp $" #include "pa_string.h" #include "pa_array.h" #include "pa_exception.h" #include "pa_operation.h" #include "pa_value.h" /** \b junction is some code joined with context of it's evaluation. there are code-junctions and method-junctions - code-junctions are used when some parameter passed in cury brackets - method-junctions used in ^method[] calls or $method references Junctions register themselves in method_frame [if any] for consequent invalidation. This prevents evaluation of junctions in outdated context To stop situations like this: @code @main[] ^method1[] ^method2[] @method1[] $junction{ some code } @method2[] ^junction[] @endcode On wcontext[most dynamic context of all] scope exit (WContext::~WContext()) got cleaned - Junction::wcontext becomes WContext.fparent (if any), or Junction::method_frame becomes 0 (if no parent), which later in Request::process triggers exception parent changing helps ^switch implementation to remain simple */ class Junction { public: /// Code-Junction constructor Junction(Value& aself, const Method* amethod, VMethodFrame* amethod_frame, Value* arcontext, WContext* awcontext, ArrayOperation* acode ): self(aself), method(amethod), method_frame(amethod_frame), rcontext(arcontext), wcontext(awcontext), code(acode) {} /// Method-Junction or Getter-Junction constructor Junction(Value& aself, const Method* amethod, bool ais_getter=false, String* aauto_name=0 ): self(aself), method(amethod), is_getter(ais_getter), auto_name(aauto_name) {} void reattach(WContext *new_wcontext); /// always present Value& self; //@{ /// @name either these // so called 'method-junction' const Method* method; //@} //@{ /// @name or these are present // so called 'code-junction' VMethodFrame* method_frame; Value* rcontext; WContext* wcontext; ArrayOperation* code; //@} //@{ String* auto_name; //@} //@{ bool is_getter; //@{ }; #endif parser-3.4.3/src/types/pa_vcookie.C000644 000000 000000 00000020601 12223630564 017274 0ustar00rootwheel000000 000000 /** @file Parser: cookie class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_sapi.h" #include "pa_common.h" #include "pa_vcookie.h" #include "pa_vstring.h" #include "pa_vdate.h" #include "pa_vhash.h" #include "pa_request.h" volatile const char * IDENT_PA_VCOOKIE_C="$Id: pa_vcookie.C,v 1.88 2013/10/04 21:21:56 moko Exp $" IDENT_PA_VCOOKIE_H; // defines #define PATH_NAME "path" #define PATH_VALUE_DEFAULT "/" #define SESSION_NAME "session" #define DEFAULT_EXPIRES_DAYS 90 #define COOKIE_FIELDS_ELEMENT_NAME "fields" // statics static const String path_name(PATH_NAME); static const String path_value_default(PATH_VALUE_DEFAULT); // VCookie VCookie::VCookie(Request_charsets& acharsets, Request_info& arequest_info): fcharsets(acharsets), frequest_info(arequest_info) { } Value* VCookie::get_element(const String& aname) { // $CLASS if(aname==CLASS_NAME) return this; // $CLASS_NAME if(aname==CLASS_NAMETEXT) return new VString(cookie_class_name); // $fields if(aname==COOKIE_FIELDS_ELEMENT_NAME){ if(should_refill()) refill(); HashStringValue *result=new HashStringValue(before); after.for_each(copy_all_overwrite_to, result); deleted.for_each(remove_key_from, result); return new VHash(*result); } // $cookie if(deleted.get(aname)) // deleted? return 0; if(Value* after_meaning=after.get(aname)) // assigned 'after'? if(HashStringValue *hash=after_meaning->get_hash()) return hash->get(value_name); else return after_meaning; if(should_refill()) refill(); // neither deleted nor assigned // return any value it had 'before' return before.get(aname); } time_t expires_sec(double days_till_expire) { time_t result=time(NULL)+(time_t)(60*60*24*days_till_expire); struct tm* tms=gmtime(&result); if(!tms) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "bad expires time (seconds from epoch=%u)", result); return result; } const VJunction* VCookie::put_element(const String& aname, Value* avalue) { // $cookie Value* lvalue; if(HashStringValue *hash=avalue->get_hash()) { if(Value* expires=hash->get(expires_name)){ const String* string; if(!(expires->is_string() && (string=expires->get_string()) && (*string==SESSION_NAME))) if(double days_till_expire=expires->as_double()) expires_sec(days_till_expire); } lvalue=hash->get(value_name); } else lvalue=avalue; if(lvalue && lvalue->is_string()) { // taint string being assigned String& tainted=*new String; tainted.append(*lvalue->get_string(), String::L_TAINTED, true /*forced*/); lvalue=new VString(tainted); } if( !lvalue || lvalue->as_string().is_empty() ) { deleted.put(aname, avalue); after.put(aname, 0); } else { after.put(aname, avalue); deleted.put(aname, 0); } return PUT_ELEMENT_REPLACED_ELEMENT; } static Value& expires_vdate(double days_till_expire) { return *new VDate(expires_sec(days_till_expire)); } /* @todo http://curl.haxx.se/rfc/cookie_spec.html http://www.w3.org/Protocols/rfc2109/rfc2109 When sending cookies to a server, all cookies with a more specific path mapping should be sent before cookies with less specific path mappings. For example, a cookie "name1=foo" with a path mapping of "/" should be sent after a cookie "name1=foo2" with a path mapping of "/bar" if they are both to be sent. There are limitations on the number of cookies that a client can store at any one time. This is a specification of the minimum number of cookies that a client should be prepared to receive and store. 300 total cookies 4 kilobytes per cookie, where the name and the OPAQUE_STRING combine to form the 4 kilobyte limit. 20 cookies per server or domain. (note that completely specified hosts and domains are treated as separate entities and have a 20 cookie limitation for each, not combined) */ const String* output_set_cookie_value( HashStringValue::key_type aname, HashStringValue::value_type ameaning, bool adelete){ String* result=new String(); // attribute= *result << String(aname, String::L_HTTP_COOKIE) << "="; Value* lmeaning; // figure out 'meaning' // Set-Cookie: (attribute)=(value); path=/ HashStringValue *hash; double default_expires_days=adelete?-DEFAULT_EXPIRES_DAYS:+DEFAULT_EXPIRES_DAYS; if((hash=ameaning->get_hash())) { // ...[hash value] // clone to safely change it lmeaning=new VHash(*hash); hash=lmeaning->get_hash(); // $expires if(Value* expires=hash->get(expires_name)) { const String* string; if(expires->is_string() && (string=expires->get_string()) && (*string==SESSION_NAME)) { // $expires[session] hash->remove(expires_name); } else { if(Value* vdate=expires->as(VDATE_TYPE)) hash->put(expires_name, vdate); // $expires[DATE] else if(double days_till_expire=expires->as_double()) hash->put(expires_name, &expires_vdate(days_till_expire)); // $expires(days) else hash->remove(expires_name); // $expires(0) } } else // $expires not assigned, defaulting hash->put(expires_name, &expires_vdate(default_expires_days)); } else { // ...[string value] Value* wrap_meaning=new VHash; hash=wrap_meaning->get_hash(); // wrapping lmeaning into hash hash->put(value_name, ameaning); // string = $expires not assigned, defaulting hash->put(expires_name, &expires_vdate(default_expires_days)); // replacing lmeaning with hash-wrapped one lmeaning=wrap_meaning; } if(adelete) {// removing value /* http://curl.haxx.se/rfc/cookie_spec.html http://www.w3.org/Protocols/rfc2109/rfc2109 to delete a cookie, it can do so by returning a cookie with the same name, and an expires time which is in the past */ // Set-Cookie: (attribute)=; path=/ lmeaning->get_hash()->remove(value_name); } // defaulting path if(!lmeaning->get_hash()->get(path_name)) lmeaning->get_hash()->put(path_name, new VString(path_value_default)); // append lmeaning *result << attributed_meaning_to_string(*lmeaning, String::L_HTTP_COOKIE, true, true /* allow bool attr */); return result; } struct Cookie_pass_info { SAPI_Info* sapi_info; Request_charsets* charsets; }; void output_set_cookie_header( HashStringValue::key_type aattribute, HashStringValue::value_type ameaning, bool adelete, Cookie_pass_info& cookie_info ){ SAPI::add_header_attribute(*cookie_info.sapi_info, "set-cookie", output_set_cookie_value(aattribute, ameaning, adelete)->untaint_cstr(String::L_AS_IS, 0, cookie_info.charsets)); } void output_after( HashStringValue::key_type aattribute, HashStringValue::value_type ameaning, Cookie_pass_info& cookie_info ){ output_set_cookie_header(aattribute, ameaning, false, cookie_info); } void output_deleted( HashStringValue::key_type aattribute, HashStringValue::value_type ameaning, Cookie_pass_info& cookie_info ){ if(ameaning) output_set_cookie_header(aattribute, ameaning, true, cookie_info); } void VCookie::output_result(SAPI_Info& sapi_info) { Cookie_pass_info cookie_info={&sapi_info, &fcharsets}; after.for_each(output_after, cookie_info); deleted.for_each(output_deleted, cookie_info); } bool VCookie::should_refill(){ return !( &fcharsets.source()==filled_source && &fcharsets.client()==filled_client ); } //#include void VCookie::refill(){ //request_info.cookie="test-session=value%3D5; test-default1=value%3D1; test-default2=value%3D2; test-tomorrow=value%3D3"; //request_info.cookie="enabled=yes; auth.uid=196325308053599810; enabled=yes; msnames; msuri"; // mdm if(!frequest_info.cookie) return; /* FILE *f=fopen("c:\\temp\\a", "wt"); fprintf(f, "cookie=%s", request_info.cookie); fclose(f); */ char *cookies=strdup(frequest_info.cookie); char *current=cookies; //_asm int 3; do { if(char *attribute=search_stop(current, '=')) if(char *meaning=search_stop(current, ';')) { const String& sattribute= *new String(unescape_chars(attribute, strlen(attribute), &fcharsets.source(), true), String::L_TAINTED); const String& smeaning= *new String(unescape_chars(meaning, strlen(meaning), &fcharsets.source(), true), String::L_TAINTED); before.put(sattribute, new VString(smeaning)); //if(sattribute == "test_js") throw Exception(0, 0, "'%s' '%s'", meaning, smeaning.cstr()); } } while(current); filled_source=&fcharsets.source(); filled_client=&fcharsets.client(); } parser-3.4.3/src/types/pa_vimage.C000644 000000 000000 00000003320 12223630564 017104 0ustar00rootwheel000000 000000 /** @file Parser: @b image parser type. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vimage.h" #include "pa_vint.h" #include "pa_vstring.h" #include "gif.h" #include "pa_vbool.h" volatile const char * IDENT_PA_VIMAGE_C="$Id: pa_vimage.C,v 1.43 2013/10/04 21:21:56 moko Exp $" IDENT_PA_VIMAGE_H; void VImage::set(const String* src, int width, int height, gdImage* aimage, Value* aexif) { fimage=aimage; fexif=aexif; // $src if(src) ffields.put(String::Body("src"), new VString(*src)); // $width if(width) ffields.put(String::Body("width"), new VInt(width)); // $height if(height) ffields.put(String::Body("height"), new VInt(height)); // defaults // $border(0) ffields.put(String::Body("border"), new VInt(0)); // internals, take a look at image.C append_attrib_pair before update // $line-width(1) ffields.put(String::Body("line-width"), new VInt(1)); } Value& VImage::as_expr_result() { return VBool::get(as_bool()); } Value* VImage::get_element(const String& aname) { // $method if(Value* result=VStateless_object::get_element(aname)) return result; // $exif if(aname==EXIF_ELEMENT_NAME) return fexif; // $src, $size return ffields.get(aname); } const VJunction* VImage::put_element(const String& aname, Value* avalue) { ffields.put(aname, avalue); if(fimage) { if(aname=="line-width") { fimage->SetLineWidth(min(max(avalue->as_int(), 1), 10)); } else if(aname=="line-style") { const String& sline_style=avalue->as_string(); fimage->SetLineStyle(sline_style.length()?sline_style.taint_cstr(String::L_AS_IS):0); } } return PUT_ELEMENT_REPLACED_ELEMENT; } parser-3.4.3/src/types/pa_vobject.h000644 000000 000000 00000005401 12225074132 017332 0ustar00rootwheel000000 000000 /** @file Parser: @b object class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VOBJECT_H #define PA_VOBJECT_H #define IDENT_PA_VOBJECT_H "$Id: pa_vobject.h,v 1.62 2013/10/08 21:25:46 moko Exp $" // includes #include "pa_vjunction.h" #include "pa_vclass.h" #include "pa_vstateless_object.h" #include "pa_vfile.h" // defines #define BASE_NAME "BASE" /** parser class instance, stores - class VObject::fclass; - fields VObject::ffields (dynamic, not static, which are stored in class). */ class VObject: public Value { VClass& fclass; HashStringValue ffields; enum State { IS_GETTER_ACTIVE = 0x01, IS_SETTER_ACTIVE = 0x02 }; int state; // default setter & getter state public: // Value const char* type() const { return fclass.name_cstr(); } override Value* as(const char* atype); /// VObject: fclass override VStateless_class *get_class() { return &fclass; } override bool is_defined() const; override Value& as_expr_result(); override int as_int() const; override double as_double() const; override bool as_bool() const; override VFile* as_vfile(String::Language lang, const Request_charsets *charsets=0); override HashStringValue* get_hash(); override Table *get_table(); override HashStringValue* get_fields() { return &ffields; } override Value* get_element(const String& aname); override const VJunction* put_element(const String& name, Value* value); override const String* get_json_string(Json_options& options); /// VObject default getter & setter support override void enable_default_getter(){ state |= IS_GETTER_ACTIVE; } override void enable_default_setter(){ if(fclass.has_default_setter()) state |= IS_SETTER_ACTIVE; } override void disable_default_getter(){ state &= ~IS_GETTER_ACTIVE; } override void disable_default_setter(){ state &= ~IS_SETTER_ACTIVE; } override bool is_enabled_default_getter(){ return (state & IS_GETTER_ACTIVE) > 0; } override bool is_enabled_default_setter(){ return (state & IS_SETTER_ACTIVE) > 0; } public: // creation VObject(VClass& aclass): fclass(aclass), state(IS_GETTER_ACTIVE){} private: Value* get_scalar_value(const char* as_something) const; }; /// Auto-objects used for temporarily disabling setter/getter class Temp_disable_default_getter { Value& fwhere; public: Temp_disable_default_getter(Value& awhere) : fwhere(awhere) { fwhere.disable_default_getter(); } ~Temp_disable_default_getter() { fwhere.enable_default_getter(); } }; class Temp_disable_default_setter { Value& fwhere; public: Temp_disable_default_setter(Value& awhere) : fwhere(awhere) { fwhere.disable_default_setter(); } ~Temp_disable_default_setter() { fwhere.enable_default_setter(); } }; #endif parser-3.4.3/src/types/pa_vxdoc.h000644 000000 000000 00000005313 11770627022 017031 0ustar00rootwheel000000 000000 /** @file Parser: @b xdoc parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VXDOC_H #define PA_VXDOC_H #define IDENT_PA_VXDOC_H "$Id: pa_vxdoc.h,v 1.52 2012/06/21 14:22:10 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_vxnode.h" #include "pa_vhash.h" // defines #define VXDOC_TYPE "xdoc" // externals extern Methoded* xdoc_class; struct XDocOutputOptions { const String* method; /* the output method */ const String* encoding; /* encoding string */ const String* mediaType; /* media-type string */ int indent; /* should output being indented */ const String* version; /* version string */ int standalone; /* standalone = "yes" | "no" */ int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */ const String* filename; /* Parser3 option: filename */ XDocOutputOptions() { memset(this, 0, sizeof(*this)); indent=standalone=omitXmlDeclaration=-1; }; void append(Request& r, HashStringValue* options, bool with_filename=false); }; /// value of type 'xdoc'. implemented with libxml & co class VXdoc: public VXnode { public: // Value override const char* type() const { return VXDOC_TYPE; } override Value* as(const char* atype); override VStateless_class* get_class() { return xdoc_class; } /// VXdoc: true override bool as_bool() const { return true; } /// VXdoc: true override Value& as_expr_result(); /// VFile: json-string override const String* get_json_string(Json_options& options); /// VXdoc: $CLASS,$method, fields override Value* get_element(const String& aname); public: // VXNode override xmlNode& get_xmlnode() { return *reinterpret_cast(&get_xmldoc()); } override VXdoc& get_vxdoc() { return *this; } public: // usage VXdoc() : VXnode(*this), fcharsets(0), fdocument(0) {} VXdoc(Request_charsets& acharsets, xmlDoc& adocument) : VXnode(*this) { set_xmldoc(acharsets, adocument); } public: // VXdoc void set_xmldoc(Request_charsets& acharsets, xmlDoc& adocument) { fcharsets=&acharsets; fdocument=&adocument; fdocument->_private=this; } xmlDoc& get_xmldoc() { if(!fdocument) throw Exception(PARSER_RUNTIME, 0, "using unitialized xdoc object"); return *fdocument; } Request_charsets& charsets() { if(!fcharsets) throw Exception(PARSER_RUNTIME, 0, "using unitialized xdoc object"); return *fcharsets; } VXnode& wrap(xmlNode& anode); public: VHash search_namespaces; XDocOutputOptions output_options; private: Request_charsets* fcharsets; xmlDoc* fdocument; }; #endif parser-3.4.3/src/types/pa_vobject.C000644 000000 000000 00000007250 12225074132 017271 0ustar00rootwheel000000 000000 /** @file Parser: @b object class impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vobject.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_vstring.h" #include "pa_vmethod_frame.h" #include "pa_request.h" volatile const char * IDENT_PA_VOBJECT_C="$Id: pa_vobject.C,v 1.39 2013/10/08 21:25:46 moko Exp $" IDENT_PA_VOBJECT_H; Value* VObject::get_scalar_value(const char* as_something) const { VObject* unconst_this=const_cast(this); if(Value* scalar=fclass.get_scalar(*unconst_this)) if(Junction* junction=scalar->get_junction()) if(const Method *method=junction->method){ VMethodFrame frame(*method, 0 /*no caller*/, *unconst_this); Value *param; if(size_t param_count=frame.method_params_count()){ if(param_count==1){ param=new VString(*new String(as_something)); frame.store_params(¶m, 1); } else throw Exception(PARSER_RUNTIME, 0, "scalar getter method can't have more then 1 parameter (has %d parameters)", param_count); } // no need for else frame.empty_params() pa_thread_request().execute_method(frame); return &frame.result().as_value(); } return 0; } Value* VObject::as(const char* atype) { return fclass.as(atype) ? this:0; } bool VObject::is_defined() const { if(Value* value=get_scalar_value("def")) return value->is_defined(); return Value::is_defined(); } Value& VObject::as_expr_result() { if(Value* value=get_scalar_value("expression")) return value->as_expr_result(); return Value::as_expr_result(); } int VObject::as_int() const { if(Value* value=get_scalar_value("int")) return value->as_int(); return Value::as_int(); } double VObject::as_double() const { if(Value* value=get_scalar_value("double")) return value->as_double(); return Value::as_double(); } bool VObject::as_bool() const { if(Value* value=get_scalar_value("bool")) return value->as_bool(); return Value::as_bool(); } VFile* VObject::as_vfile(String::Language lang, const Request_charsets *charsets) { if(Value* value=get_scalar_value("file")) return value->as_vfile(lang, charsets); return Value::as_vfile(lang, charsets); } HashStringValue* VObject::get_hash() { if(Value* value=get_scalar_value("hash")) return value->get_hash(); return &ffields; } Table *VObject::get_table() { if(Value* value=get_scalar_value("table")) return value->get_table(); return Value::get_table(); } Value* VObject::get_element(const String& aname) { // object field if(Value* result=ffields.get(aname)) return result; // class method or property, or _object_ default getter return fclass.get_element(*this, aname); } const VJunction* VObject::put_element(const String& aname, Value* avalue){ // class property if(const VJunction* result=fclass.put_element_replace_only(*this, aname, avalue)) return result; // object field or default setter, avoiding virtual is_enabled_default_setter call if (state & IS_SETTER_ACTIVE){ return ffields.put_replaced(aname, avalue) ? 0 : fclass.get_default_setter(*this, aname); } else { ffields.put(aname, avalue); } return 0; } const String* VObject::get_json_string(Json_options& options){ if(options.default_method){ Junction* junction=options.default_method->get_junction(); VMethodFrame frame(*junction->method, options.r->method_frame, junction->self); Value *params[]={new VString(*new String(options.key, String::L_JSON)), this, options.params ? options.params : VVoid::get()}; frame.store_params(params, 3); options.r->execute_method(frame); return &frame.result().as_string(); } return options.hash_json_string(*get_hash()); } parser-3.4.3/src/types/pa_value.h000644 000000 000000 00000014772 12225074132 017025 0ustar00rootwheel000000 000000 /** @file Parser: Value, Method, Junction . Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VALUE_H #define PA_VALUE_H #define IDENT_PA_VALUE_H "$Id: pa_value.h,v 1.152 2013/10/08 21:25:46 moko Exp $" #include "pa_common.h" #include "pa_array.h" #include "pa_exception.h" #include "pa_property.h" // forwards class VStateless_class; class WContext; class Request; class Request_charsets; class Junction; class VJunction; class Method; class Value; class MethodParams; class VObject; class VMethodFrame; class VFile; class Table; struct XDocOutputOptions; typedef Array ArrayValue; struct Json_options { Request* r; String::Body key; HashStringValue* methods; Value* default_method; Value* params; bool skip_unknown; uint json_string_recoursion; const char* indent; XDocOutputOptions* xdoc_options; enum Date { D_SQL, D_GMT, D_TIMESTAMP } date; enum Table { T_ARRAY, T_OBJECT, T_COMPACT } table; enum File { F_BODYLESS, F_BASE64, F_TEXT } file; Json_options(Request* arequest): r(arequest), methods(NULL), default_method(NULL), params(NULL), skip_unknown(false), xdoc_options(NULL), json_string_recoursion(0), indent(NULL), date(D_SQL), table(T_OBJECT), file(F_BODYLESS) {} bool set_date_format(const String &value){ if(value == "gmt-string") date = D_GMT; else if (value == "sql-string") date = D_SQL; else if (value == "unix-timestamp") date = D_TIMESTAMP; else return false; return true; } bool set_table_format(const String &value){ if(value == "array") table = T_ARRAY; else if (value == "object") table = T_OBJECT; else if (value == "compact") table = T_COMPACT; else return false; return true; } bool set_file_format(const String &value){ if(value == "base64") file = F_BASE64; else if (value == "text") file = F_TEXT; else if (value == "stat") file = F_BODYLESS; else return false; return true; } const String* hash_json_string(HashStringValue &hash); }; /// grandfather of all @a values in @b Parser class Value: public PA_Object { public: // Value /// value type, used for error reporting and 'is' expression operator virtual const char* type() const =0; /** all except VObject/VClass: this if @atype eq type() VObject/VClass: can locate parent class by it's type */ virtual Value* as(const char* atype) { return atype && strcmp(type(), atype)==0?this:0; } /// type checking helper, uses Value::as bool is(const char* atype) { return as(atype)!=0; } /// is this value defined? virtual bool is_defined() const { return true; } /// is this value string? virtual bool is_string() const { return false; } /// is this value void? virtual bool is_void() const { return false; } /// is this value bool? virtual bool is_bool() const { return false; } /// is this value number? virtual bool is_evaluated_expr() const { return false; } /// what's the meaning of this value in context of expression? virtual Value& as_expr_result() { return *bark("is '%s', can not be used in expression"); } /** extract HashStringValue if any WARNING: FOR LOCAL USE ONLY, THIS POINTER IS NOT TO PASS TO ANYBODY! */ virtual HashStringValue* get_hash() { return 0; } /// extract const String virtual const String* get_string() { return 0; } /// extract json-string virtual const String* get_json_string(Json_options& options); virtual HashStringValue* get_fields() { return 0; } /// extract double virtual double as_double() const { bark("is '%s', it does not have numerical (double) value"); return 0; } /// extract integer virtual int as_int () const { bark("is '%s', it does not have numerical (int) value"); return 0; } /// extract bool virtual bool as_bool() const { bark("is '%s', it does not have logical value"); return 0; } /// extract file virtual VFile* as_vfile(String::Language lang, const Request_charsets* charsets=0); /// extract Junction virtual Junction* get_junction(); /// @return Value element; can return Junction for methods; Code-Junction for code; Getter-Junction for property virtual Value* get_element(const String& /*aname*/); /// indicator value meaning that put_element overwritten something #define PUT_ELEMENT_REPLACED_ELEMENT reinterpret_cast(1) /// store Value element under @a name /// @returns putter method junction, or it can just report[PUT_ELEMENT_REPLACED_ELEMENT] /// that it replaced something in base fields virtual const VJunction* put_element(const String& aname, Value* /*avalue*/) { // to prevent modification of system classes, // created at system startup, and not having exception // handler installed, we neet to bark using request.pool bark("element can not be stored to %s", &aname); return 0; } /// VObject default getter & setter support virtual void enable_default_getter(){ } virtual void enable_default_setter(){ } virtual void disable_default_getter(){ } virtual void disable_default_setter(){ } virtual bool is_enabled_default_getter(){ return true; } virtual bool is_enabled_default_setter(){ return true; } /// extract VStateless_class virtual VStateless_class* get_class()=0; /// extract base class, if any virtual VStateless_class* base() { return 0; } /// extract VTable virtual Table* get_table() { return 0; } public: // usage /// @return sure String. if it doesn't have string value barks const String& as_string() { const String* result=get_string(); if(!result) bark("is '%s', it has no string representation"); return *result; } /// throws exception specifying bark-reason and name() type() of problematic value Value* bark(const char *reason, const String *problem_source=0) const { //if(this) // removing warnings on unreachable code throw Exception(PARSER_RUNTIME, problem_source, reason, type()); //return 0; } }; /** $content-type[text/html] -> content-type: text/html $content-type[$.value[text/html] $.charset[windows-1251]] -> content-type: text/html; charset=windows-1251 */ const String& attributed_meaning_to_string(Value& meaning, String::Language lang, bool forced=false, bool allow_bool=false); // defines ///@{common field names #define CHARSET_NAME "charset" #define VALUE_NAME "value" #define EXPIRES_NAME "expires" #define CONTENT_TYPE_NAME "content-type" #define NAME_NAME "name" //@} ///@{common field names extern const String value_name; extern const String expires_name; extern const String content_type_name; extern const String name_name; ///@} #endif parser-3.4.3/src/types/pa_method.h000644 000000 000000 00000007414 12230056040 017156 0ustar00rootwheel000000 000000 /** @file Parser: Method class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_METHOD_H #define PA_METHOD_H #define IDENT_PA_METHOD_H "$Id: pa_method.h,v 1.22 2013/10/17 21:52:32 moko Exp $" #define OPTIMIZE_CALL #define OPTIMIZE_RESULT #include "pa_operation.h" #include "pa_vjunction.h" /** native code method params can be NULL when method min&max params (see VStateless_class::add_native_method) counts are zero. */ typedef void (*NativeCodePtr)(Request& request, MethodParams& params); /** class method. methods can have - named or - numbered parameters methods can be - parser or - native onces holds - parameter names or number limits - local names - code [parser or native] */ class Method: public PA_Object { public: /// allowed method call types enum Call_type { CT_ANY, ///< method can be called either statically or dynamically CT_STATIC, ///< method can be called only statically CT_DYNAMIC ///< method can be called only dynamically }; enum Result_optimization { RO_UNKNOWN, RO_USE_RESULT, // write to $result detected, will not collect all writes to output scope. RO_USE_WCONTEXT // native code or parser code without $result usage. }; enum Call_optimization { CO_NONE, CO_WITHOUT_FRAME, // for some native methods method frame is not required, faster CO_WITHOUT_WCONTEXT // for some native methods wcontext is not required, faster }; /// Call_type call_type; //@{ /// @name either numbered params // for native-code methods = operators int min_numbered_params_count, max_numbered_params_count; //@} //@{ /// @name or named params&locals // for parser-code methods ArrayString* params_names; ArrayString* locals_names; //@} //@{ /// @name the Code ArrayOperation* parser_code;/*OR*/NativeCodePtr native_code; //@} VJunction *junction_template; bool all_vars_local; // in local vars list 'locals' was specified: all vars are local bool allways_use_result; // write to $result detected. will not collect all writes to output scope. String *extra_params; // method has *name as an argument #ifdef OPTIMIZE_RESULT Result_optimization result_optimization; #endif #ifdef OPTIMIZE_CALL Call_optimization call_optimization; #endif Method( Call_type acall_type, int amin_numbered_params_count, int amax_numbered_params_count, ArrayString* aparams_names, ArrayString* alocals_names, ArrayOperation* aparser_code, NativeCodePtr anative_code, bool aall_vars_local=false #ifdef OPTIMIZE_RESULT , Result_optimization aresult_optimization=RO_UNKNOWN #endif #ifdef OPTIMIZE_CALL , Call_optimization acall_optimization=CO_NONE #endif ) : call_type(acall_type), min_numbered_params_count(amin_numbered_params_count), max_numbered_params_count(amax_numbered_params_count), params_names(aparams_names), locals_names(alocals_names), parser_code(aparser_code), native_code(anative_code), #ifdef OPTIMIZE_RESULT result_optimization(aresult_optimization), #endif #ifdef OPTIMIZE_CALL call_optimization(acall_optimization), #endif all_vars_local(aall_vars_local){ if (params_names){ const char *last_param = params_names->get(params_names->count()-1)->cstr(); if (last_param[0] == '*' && last_param[1]){ extra_params = new String(pa_strdup(last_param+1)); params_names->remove(params_names->count()-1); return; } } extra_params = NULL; } /// call this before invoking to ensure proper actual numbered params count void check_actual_numbered_params( Value& self, MethodParams* actual_numbered_params) const; VJunction* get_vjunction(Value& aself) { if(!junction_template) return junction_template=new VJunction(aself, this); return junction_template->get(aself); } }; #endif parser-3.4.3/src/types/pa_vcode_frame.h000644 000000 000000 00000001751 12223630564 020161 0ustar00rootwheel000000 000000 /** @file Parser: @b code_frame write wrapper write context Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VCODE_FRAME_H #define PA_VCODE_FRAME_H #define IDENT_PA_VCODE_FRAME_H "$Id: pa_vcode_frame.h,v 1.38 2013/10/04 21:21:56 moko Exp $" #include "pa_wcontext.h" #include "pa_vvoid.h" /// specialized write wrapper, completely transparent class VCodeFrame: public WContext { public: // Value override const char* type() const { return "code_frame"; } /// VCodeFrame: twice transparent override Value* get_element(const String& aname) { return fparent->get_element(aname); } /// VCodeFrame: twice transparent override const VJunction* put_element(const String& aname, Value* avalue) { // $hash[^if(1){$.field[]}] // put goes to $hash return fparent->put_element(aname, avalue); } public: // usage VCodeFrame(WContext& parent): WContext(&parent){ } }; #endif parser-3.4.3/src/types/pa_vstring.h000644 000000 000000 00000004267 11760753150 017412 0ustar00rootwheel000000 000000 /** @file Parser: @b string parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VSTRING_H #define PA_VSTRING_H #define IDENT_PA_VSTRING_H "$Id: pa_vstring.h,v 1.70 2012/05/28 19:47:52 moko Exp $" // includes #include "pa_vstateless_object.h" #include "pa_vdouble.h" // externs extern Methoded* string_class; /// value of type 'string'. implemented with @c String class VString: public VStateless_object { public: // Value override const char* type() const { return "string"; } override VStateless_class *get_class() { return string_class; } /// VString: eq ''=false, ne ''=true override bool is_defined() const { return !fstring->is_empty(); } /// VString: 0 or !0 override bool as_bool() const { return as_double()!=0; } /// VString: true override bool is_string() const { return true; } /// VString: VDouble override Value& as_expr_result() { return *new VDouble(fstring->as_double()); } /// VString: fstring override const String* get_string() { return fstring; }; /// VString: fstring override double as_double() const { return fstring->as_double(); } /// VString: fstring override int as_int() const { return fstring->as_int(); } /// VString: vfile override VFile* as_vfile(String::Language lang, const Request_charsets *charsets=0); /// VString: json string override const String* get_json_string(Json_options&) { String* result = new String(); result->append_quoted(fstring); return result; } /// VString: $method override Value* get_element(const String& aname) { // $method if(Value* result=VStateless_object::get_element(aname)) return result; // empty string is void compatible if (fstring->is_empty()) return 0; // bad $string.field return bark("%s method not found", &aname); } public: // usage VString(): fstring(new String) {} VString(const String& avalue): fstring(&avalue) {} const String& string() const { return *fstring; } void set_string(const String& astring) { fstring=&astring; } inline static VString *empty(){ static VString singleton; return &singleton; } private: const String* fstring; }; #endif parser-3.4.3/src/types/pa_vmethod_frame.h000644 000000 000000 00000022203 12226052627 020523 0ustar00rootwheel000000 000000 /** @file Parser: @b method_frame write context Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VMETHOD_FRAME_H #define PA_VMETHOD_FRAME_H #define IDENT_PA_VMETHOD_FRAME_H "$Id: pa_vmethod_frame.h,v 1.95 2013/10/11 19:46:31 moko Exp $" #include "pa_wcontext.h" #include "pa_vvoid.h" #include "pa_vjunction.h" // defines #define CALLER_ELEMENT_NAME "caller" #define SELF_ELEMENT_NAME "self" #define RESULT_VAR_NAME "result" extern const String result_var_name, caller_element_name, self_element_name; // forwards class Request; /** @b method parameters passed in this array. contains handy typecast ad junction/not junction ensurers */ class MethodParams { public: MethodParams() : felements(0), fused(0){} #ifdef USE_DESTRUCTORS ~MethodParams(){ Value **flast=felements+count(); for(Value **current=felements;currentget_junction(); if (junction && junction->code) delete *current; } } #endif void store_params(Value **params, size_t count){ felements=params; fused=count; } inline size_t count() const { return fused; } inline Value *get(size_t index) const { assert(indexis_evaluated_expr()){ return *value; } else { return get_as(value, true, msg, index); } } /// handy expression auto-processing to double double as_double(int index, const char* msg, Request& r) { Value* value=get(index); if(!value->is_evaluated_expr()) value=&get_processed(value, msg, index, r); return value->as_double(); } /// handy expression auto-processing to int int as_int(int index, const char* msg, Request& r) { Value* value=get(index); if(!value->is_evaluated_expr()) value=&get_processed(value, msg, index, r); return value->as_int(); } /// handy expression auto-processing to bool bool as_bool(int index, const char* msg, Request& r) { Value* value=get(index); if(!value->is_evaluated_expr()) value=&get_processed(value, msg, index, r); return value->as_bool(); } /// handy string ensurer const String& as_string(int index, const char* msg) { return as_no_junction(index, msg).as_string(); } /// handy hash ensurers HashStringValue* as_hash(int index, const char* name=0); /// handy table ensurer Table* as_table(int index, const char* name=0); private: Value **felements; size_t fused; /// handy value-is/not-a-junction ensurer Value& get_as(Value* value, bool as_junction, const char* msg, int index) { if((value->get_junction()!=0) ^ as_junction) throw Exception(PARSER_RUNTIME, 0, "%s (parameter #%d)", msg, 1+index); return *value; } Value& get_processed(Value* value, const char* msg, int index, Request& r); }; /** Method frame write context accepts values written by method code also handles method parameters and local variables */ class VMethodFrame: public WContext { protected: VMethodFrame *fcaller; HashString* my; /*OR*/ MethodParams fnumbered_params; Value& fself; typedef const VJunction* (VMethodFrame::*put_element_t)(const String& aname, Value* avalue); put_element_t put_element_impl; public: // Value override const char* type() const { return "method_frame"; } /// VMethodFrame: $result | parent get_string(=accumulated fstring) override const String* get_string() { // check the $result value Value* result=get_result_variable(); // if we have one, return it's string value, else return as usual: accumulated fstring or fvalue return result ? result->get_string() : WContext::get_string(); } /// VMethodFrame: my or self_transparent or $caller override Value* get_element(const String& aname) { if(aname==caller_element_name) return caller(); if(aname==self_element_name) return &self(); Value* result; if(my && (result=my->get(aname))) return result; if(result=self().get_element(aname)) return result; return 0; } /// VMethodFrame: self_transparent override VStateless_class* get_class() { return self().get_class(); } /// VMethodFrame: self_transparent override VStateless_class* base() { return self().base(); } /// VMethodFrame: my or self_transparent override const VJunction* put_element(const String& aname, Value* avalue) { return (this->*put_element_impl)(aname, avalue); } /// VMethodFrame: appends a fstring to result override void write(const String& astring, String::Language alang) { #ifdef OPTIMIZE_RESULT switch (method.result_optimization){ case Method::RO_USE_RESULT: return; case Method::RO_UNKNOWN: if(get_result_variable()){ ((Method *)&method)->result_optimization=Method::RO_USE_RESULT; return; } } #endif WContext::write(astring, alang); } private: const VJunction* put_element_local(const String& aname, Value* avalue){ set_my_variable(aname, *avalue); return PUT_ELEMENT_REPLACED_ELEMENT; } const VJunction* put_element_global(const String& aname, Value* avalue){ if(my && my->put_replaced(aname, avalue)) return PUT_ELEMENT_REPLACED_ELEMENT; return self().put_element(aname, avalue); } public: // WContext override StringOrValue result() { if(my){ // check the $result value Value* result_value=get_result_variable(); // if we have one, return it, else return as usual: accumulated fstring or fvalue if(result_value) return StringOrValue(*result_value); #ifdef OPTIMIZE_RESULT if(method.result_optimization==Method::RO_USE_RESULT) return StringOrValue(*VVoid::get()); ((Method *)&method)->result_optimization=Method::RO_USE_WCONTEXT; #ifdef OPTIMIZE_CALL // nested as CO_WITHOUT_WCONTEXT assumes that $result not used ((Method *)&method)->call_optimization=Method::CO_WITHOUT_WCONTEXT; #endif #endif } return WContext::result(); } override void write(Value& avalue) { WContext::write(avalue); } public: // usage VMethodFrame(const Method& amethod, VMethodFrame *acaller, Value& aself); VMethodFrame *caller() { return fcaller; } #ifdef USE_DESTRUCTORS ~VMethodFrame(){ if(my){ delete my; } } #endif Value& self() { return fself; } size_t method_params_count() { return method.params_names ? method.params_names->count():0; } void store_params(Value **params, size_t count) { if(my) { size_t param_count=method.params_names ? method.params_names->count():0; size_t i=0; if(count>param_count){ if(method.extra_params){ for(; iname_cstr(), self().type(), param_count, count); } for(; iput(fname, VVoid::get()); } } else fnumbered_params.store_params(params,count); } void empty_params(){ if(method.params_names){ size_t param_count=method.params_names->count(); if(param_count>0){ const String& fname=*(*method.params_names)[0]; my->put(fname, VString::empty()); for(size_t i=1; iput(fname, VVoid::get()); } } } } MethodParams* numbered_params() { return &fnumbered_params; } protected: void set_my_variable(const String& fname, Value& value) { my->put(fname, &value); // remember param } Value* get_result_variable(); public: const Method& method; }; class VConstructorFrame: public VMethodFrame { public: VConstructorFrame(const Method& amethod, VMethodFrame *acaller, Value& aself) : VMethodFrame(amethod, acaller, aself) { // prevent non-string writes for better error reporting [constructors are not expected to return anything] VMethodFrame::write(aself); } override void write(const String& /*astring*/, String::Language /*alang*/) {} }; #endif parser-3.4.3/src/types/pa_vmath.C000644 000000 000000 00000001057 11730603302 016750 0ustar00rootwheel000000 000000 /** @file Parser: @b math class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vmath.h" #include "pa_vdouble.h" volatile const char * IDENT_PA_VMATH_C="$Id: pa_vmath.C,v 1.10 2012/03/16 09:24:18 moko Exp $" IDENT_PA_VMATH_H; // externs extern Methoded* math_base_class; // methods VMath::VMath(): VStateless_class(0, math_base_class) { fconsts.put(String::Body("PI"), new VDouble(PI)); fconsts.put(String::Body("E"), new VDouble(MathE)); } parser-3.4.3/src/types/pa_vstatus.C000644 000000 000000 00000017136 12173056751 017363 0ustar00rootwheel000000 000000 /** @file Parser: @b status class impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) Win32 rusage author: Victor Fedoseev */ #include "pa_vstatus.h" #include "pa_cache_managers.h" #include "pa_vhash.h" #include "pa_vdouble.h" #include "pa_threads.h" volatile const char * IDENT_PA_VSTATUS_C="$Id: pa_vstatus.C,v 1.30 2013/07/21 22:17:13 moko Exp $" IDENT_PA_VSTATUS_H; #ifdef _MSC_VER #include #include "psapi.h" // should be in windows.h, but were't typedef struct _IO_COUNTERS_ { ULONGLONG ReadOperationCount; ULONGLONG WriteOperationCount; ULONGLONG OtherOperationCount; ULONGLONG ReadTransferCount; ULONGLONG WriteTransferCount; ULONGLONG OtherTransferCount; } IO_COUNTERS_; typedef IO_COUNTERS_ *PIO_COUNTERS_; typedef unsigned __int64 ui64; // kernel32.dll (NT/2K/XP) typedef BOOL (WINAPI *PGETPROCESSTIMES)(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME); //typedef BOOL (WINAPI *PGETPROCESSHEAPS)(DWORD,PHANDLE); typedef BOOL (WINAPI *GETPROCESSIOCOUNTERS)(HANDLE,PIO_COUNTERS_); // psapi.dll (2K/XP) typedef BOOL (WINAPI *PGETPROCESSMEMORYINFO)(HANDLE,PPROCESS_MEMORY_COUNTERS,DWORD); // from CRT time.c /* * Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */ #define EPOCH_BIAS 116444736000000000i64 /* * Union to facilitate converting from FILETIME to unsigned __int64 */ typedef union { unsigned __int64 ft_scalar; FILETIME ft_struct; } FT; #endif Value& rusage_element() { VHash& rusage=*new VHash; HashStringValue& hash=rusage.hash(); #ifdef _MSC_VER double d1; HANDLE hProc = GetCurrentProcess(); HMODULE hMod = LoadLibrary("kernel32.dll"); if(hMod){ // NT/2K/XP PGETPROCESSTIMES pGetProcessTimes = (PGETPROCESSTIMES)GetProcAddress(hMod, "GetProcessTimes"); if(pGetProcessTimes){ FILETIME CreationTime, ExitTime; FT KernelTime, UserTime; if(pGetProcessTimes(hProc, &CreationTime, &ExitTime, &KernelTime.ft_struct, &UserTime.ft_struct)){ // dwHighDateTime & dwLowDateTime - 1/10 000 000 seconds in 64 bit /* the amount of time that the process has executed in user mode */ d1 = double((LONGLONG)UserTime.ft_scalar)/10000000.0; hash.put(String::Body("utime"), new VDouble(d1)); // hash.put(String::Body("UserTime"), new VDouble(d1)); /* the amount of time that the process has executed in kernel mode */ d1 = double((LONGLONG)KernelTime.ft_scalar)/10000000.0; hash.put(String::Body("stime"), new VDouble(d1)); // hash.put(String::Body("KernelTime"), new VDouble( d1)); } } // NT/2K/XP GETPROCESSIOCOUNTERS pGetProcessIoCounters = (GETPROCESSIOCOUNTERS)GetProcAddress(hMod, "GetProcessIoCounters"); if(pGetProcessIoCounters){ IO_COUNTERS_ ioc; if(pGetProcessIoCounters(hProc, &ioc)){ /* Specifies the number of I/O operations performed, other than read and write operations */ hash.put(String::Body( "OtherOperationCount"), new VDouble(double((LONGLONG)ioc.OtherOperationCount))); /* Specifies the number of bytes transferred during operations other than read and write operations */ hash.put(String::Body( "OtherTransferCount"), new VDouble(double((LONGLONG)ioc.OtherTransferCount)/1024.0)); /* Specifies the number of read operations performed */ hash.put(String::Body( "ReadOperationCount"), new VDouble(double((LONGLONG)ioc.ReadOperationCount))); /* Specifies the number of bytes read */ hash.put(String::Body( "ReadTransferCount"), new VDouble(double((LONGLONG)ioc.ReadTransferCount)/1024.0)); /* Specifies the number of write operations performed */ hash.put(String::Body( "WriteOperationCount"), new VDouble(double((LONGLONG)ioc.WriteOperationCount))); /* Specifies the number of bytes written */ hash.put(String::Body( "WriteTransferCount"), new VDouble(double((LONGLONG)ioc.WriteTransferCount)/1024.0)); } } FreeLibrary(hMod); /* PGETPROCESSHEAPS pGetProcessHeaps = (PGETPROCESSHEAPS)GetProcAddress(hMod, "GetProcessHeaps"); if(pGetProcessHeaps){ } */ } // 2K/XP hMod = LoadLibrary("psapi.dll"); if(hMod){ PGETPROCESSMEMORYINFO pGetProcessMemoryInfo = (PGETPROCESSMEMORYINFO)GetProcAddress(hMod, "GetProcessMemoryInfo"); if(pGetProcessMemoryInfo){ PROCESS_MEMORY_COUNTERS pmc; pmc.cb = sizeof(PROCESS_MEMORY_COUNTERS); if(pGetProcessMemoryInfo(hProc, &pmc, sizeof(PROCESS_MEMORY_COUNTERS))){ /* The peak working set size */ d1 = double(pmc.PeakWorkingSetSize)/1024.0; hash.put(String::Body("maxrss"), new VDouble(d1)); // hash.put(String::Body("PeakWorkingSetSize")), new VDouble( d1))); /* The peak nonpaged pool usage */ d1 = double(pmc.QuotaPeakNonPagedPoolUsage)/1024.0; // hash.put(String::Body("ixrss"), new VDouble(d1)); hash.put(String::Body("QuotaPeakNonPagedPoolUsage"), new VDouble( d1)); /* The peak paged pool usage */ d1 = double(pmc.QuotaPeakPagedPoolUsage)/1024.0; // hash.put(String::Body("idrss"), new VDouble( d1)); hash.put(String::Body("QuotaPeakPagedPoolUsage"), new VDouble( d1)); /* The peak pagefile usage */ d1 = double(pmc.PeakPagefileUsage)/1024.0; // hash.put(String::Body("isrss"), new VDouble( d1)); hash.put(String::Body("PeakPagefileUsage"), new VDouble( d1)); } } FreeLibrary(hMod); } // all windows. FT ft; GetSystemTimeAsFileTime( &(ft.ft_struct) ); ft.ft_scalar -= EPOCH_BIAS; ui64 tv_sec = ft.ft_scalar/10000000i64; ui64 tv_usec = (ft.ft_scalar-tv_sec*10000000i64)/10i64; hash.put(String::Body("tv_sec"), new VDouble(double((LONGLONG)tv_sec))); hash.put(String::Body("tv_usec"), new VDouble(double((LONGLONG)tv_usec))); #else #ifdef HAVE_GETRUSAGE struct rusage u; if(getrusage(RUSAGE_SELF,&u)<0) throw Exception(0, 0, "getrusage failed (#%d)", errno); hash.put(String::Body("utime"), new VDouble( u.ru_utime.tv_sec+u.ru_utime.tv_usec/1000000.0)); hash.put(String::Body("stime"), new VDouble( u.ru_stime.tv_sec+u.ru_stime.tv_usec/1000000.0)); hash.put(String::Body("maxrss"), new VDouble(u.ru_maxrss)); hash.put(String::Body("ixrss"), new VDouble(u.ru_ixrss)); hash.put(String::Body("idrss"), new VDouble(u.ru_idrss)); hash.put(String::Body("isrss"), new VDouble(u.ru_isrss)); #endif #ifdef HAVE_GETTIMEOFDAY struct timeval tp; if(gettimeofday(&tp, NULL)<0) throw Exception(0, 0, "gettimeofday failed (#%d)", errno); hash.put(String::Body("tv_sec"), new VDouble(tp.tv_sec)); hash.put(String::Body("tv_usec"), new VDouble(tp.tv_usec)); #endif #endif return rusage; } #ifndef PA_DEBUG_DISABLE_GC Value& memory_element() { VHash& memory=*new VHash; HashStringValue& hash=memory.hash(); size_t heap_size=GC_get_heap_size(); size_t free_bytes=GC_get_free_bytes(); size_t bytes_since_gc=GC_get_bytes_since_gc(); size_t total_bytes=GC_get_total_bytes(); hash.put(String::Body("used"), new VDouble((heap_size-free_bytes)/1024.0)); hash.put(String::Body("free"), new VDouble(free_bytes/1024.0)); hash.put(String::Body("ever_allocated_since_compact"), new VDouble(bytes_since_gc/1024.0)); hash.put(String::Body("ever_allocated_since_start"), new VDouble(total_bytes/1024.0)); return memory; } #endif Value* VStatus::get_element(const String& aname) { // getstatus if(Cache_manager* manager=cache_managers->get(aname)) return manager->get_status(); // $pid if(aname=="pid") return new VInt(getpid()); // $tid if(aname=="tid") return new VInt(pa_get_thread_id()); // $rusage if(aname=="rusage") return &rusage_element(); #ifndef PA_DEBUG_DISABLE_GC // $memory if(aname=="memory") return &memory_element(); #endif return 0; } parser-3.4.3/src/types/pa_vmemory.h000644 000000 000000 00000001431 11730603302 017370 0ustar00rootwheel000000 000000 /** @file Parser: @b memory parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VMEMORY_H #define PA_VMEMORY_H #define IDENT_PA_VMEMORY_H "$Id: pa_vmemory.h,v 1.7 2012/03/16 09:24:18 moko Exp $" #include "classes.h" #include "pa_vstateless_object.h" #include "pa_globals.h" extern Methoded* memory_base_class; /// class VMemory: public VStateless_class { public: // Value const char* type() const { return "memory"; } /// memory: CLASS,method Value* get_element(const String& aname) { // $CLASS,$method if(Value* result=VStateless_class::get_element(aname)) return result; return 0; } VMemory(): VStateless_class(0, memory_base_class) {} }; #endif parser-3.4.3/src/types/pa_vstatus.h000644 000000 000000 00000001212 11730603303 017401 0ustar00rootwheel000000 000000 /** @file Parser: @b status class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VSTATUS_H #define PA_VSTATUS_H #define IDENT_PA_VSTATUS_H "$Id: pa_vstatus.h,v 1.21 2012/03/16 09:24:19 moko Exp $" // includes #include "pa_value.h" // define #define STATUS_CLASS_NAME "status" /// status class class VStatus: public Value { public: // Value const char* type() const { return "status"; } VStateless_class *get_class() { return 0; } // VStatus: field Value* get_element(const String& aname); public: // usage }; #endif parser-3.4.3/src/types/pa_vstateless_class.h000644 000000 000000 00000012135 12223630565 021270 0ustar00rootwheel000000 000000 /** @file Parser: stateless class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VSTATELESS_CLASS_H #define PA_VSTATELESS_CLASS_H #define IDENT_PA_VSTATELESS_CLASS_H "$Id: pa_vstateless_class.h,v 1.75 2013/10/04 21:21:57 moko Exp $" // include #include "pa_pool.h" #include "pa_hash.h" #include "pa_vjunction.h" #include "pa_method.h" // defines #define CLASS_NAME "CLASS" #define CLASS_NAMETEXT "CLASS_NAME" extern const String class_name, class_nametext; // forwards class VStateless_class; typedef Array ArrayClass; typedef HashString HashStringProperty; typedef HashString HashStringMethod; class Temp_method; /** object' class. stores - base: VClass::base() - methods: VStateless_class::fmethods @see Method, VStateless_object, Temp_method */ class VStateless_class: public Value { friend class Temp_method; const String* fname; mutable const char* fname_cstr; HashStringMethod fmethods; bool flocked; bool fall_vars_local; bool fpartial; Method::Call_type fcall_type; protected: VStateless_class* fbase; /// all derived classes, recursively ArrayClass fderived; Method* fscalar; Method* fdefault_getter; Method* fdefault_setter; public: // Value const char* type() const { return "stateless_class"; } /// VStateless_class: this override VStateless_class* get_class() { return this; } /// VStateless_class: fbase override VStateless_class* base() { return fbase; } override Value* get_element(const String& aname) { return get_element(*this, aname); } /// get_element with aself for VObject junctions virtual Value* get_element(Value& aself, const String& aname); override const VJunction* put_element(const String& aname, Value* avalue) { return put_element(*this, aname, avalue); } /// put_element with aself for VObject junctions virtual const VJunction* put_element(Value& aself, const String& aname, Value* /*avalue*/) { aself.bark("element can not be stored to %s", &aname); return 0; } override Value& as_expr_result(); Value* get_scalar(Value& aself); void set_scalar(Method* amethod); Value* get_default_getter(Value& aself, const String& aname); void set_default_getter(Method* amethod); bool has_default_getter(); VJunction* get_default_setter(Value& aself, const String& aname); void set_default_setter(Method* amethod); bool has_default_setter(); void add_derived(VStateless_class &aclass); public: // usage VStateless_class( const String* aname=0, VStateless_class* abase=0): fname(aname), flocked(false), fbase(0), fderived(0), fall_vars_local(false), fpartial(false), fscalar(0), fdefault_getter(0), fdefault_setter(0), fcall_type(Method::CT_ANY) { set_base(abase); } void lock() { flocked=true; } const String& name() const { if(!fname) { if(fbase) return fbase->name(); throw Exception(PARSER_RUNTIME, 0, "getting name of nameless class"); } return *fname; } const char* name_cstr() const{ if(!fname_cstr) // remembering last calculated, and can't reassign 'fname_cstr'! fname_cstr=name().cstr(); return fname_cstr; } void set_name(const String& aname) { fname=&aname; fname_cstr=0; } Method* get_method(const String& aname) const { return fmethods.get(aname); } HashStringMethod get_methods(){ return fmethods; } bool is_vars_local(){ return fall_vars_local; } void set_all_vars_local(){ fall_vars_local=true; } bool is_partial(){ return fpartial; } void set_partial(){ fpartial=true; } Method::Call_type get_methods_call_type(){ return fcall_type; } void set_methods_call_type(Method::Call_type call_type){ if(fcall_type!=Method::CT_ANY) throw Exception(PARSER_RUNTIME, 0, "You can specify call type option in a class only once" ); fcall_type=call_type; } void add_native_method( const char* cstr_name, Method::Call_type call_type, NativeCodePtr native_code, int min_numbered_params_count, int max_numbered_params_count, Method::Call_optimization call_optimization=Method::CO_WITHOUT_WCONTEXT); void set_method(const String& aname, Method* amethod); /// overrided in VClass virtual void real_set_method(const String& aname, Method* amethod); virtual HashStringProperty* get_properties(){ return 0; }; virtual void set_base(VStateless_class* abase); VStateless_class* base_class() { return fbase; } bool derived_from(VStateless_class& vclass){ return fbase==&vclass || fbase && fbase->derived_from(vclass); } /// @returns new value for current class, used in classes/ & VClass virtual Value* create_new_value(Pool&) { return 0; } }; /// Auto-object used for temporarily substituting/removing class method class Temp_method { VStateless_class& fclass; const String& fname; Method* saved_method; public: Temp_method(VStateless_class& aclass, const String& aname, Method* amethod) : fclass(aclass), fname(aname), saved_method(aclass.get_method(aname)) { fclass.set_method(aname, amethod); } ~Temp_method() { fclass.set_method(fname, saved_method); } }; #endif parser-3.4.3/src/types/pa_vjunction.C000644 000000 000000 00000001761 11757207701 017666 0ustar00rootwheel000000 000000 /** @file Parser: @b junction class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ // include #include "pa_vjunction.h" #include "pa_vbool.h" #include "pa_wcontext.h" volatile const char * IDENT_PA_VJUNCTION_C="$Id: pa_vjunction.C,v 1.12 2012/05/23 16:26:41 moko Exp $" IDENT_PA_VJUNCTION_H IDENT_PA_JUNCTION_H; void VJunction::reattach(WContext *new_wcontext){ if(new_wcontext) { assert(fjunction.wcontext!=new_wcontext); fjunction.wcontext=new_wcontext; fjunction.wcontext->attach_junction(this); } else { fjunction.method_frame=0; fjunction.rcontext=0; fjunction.wcontext=0; } } override Value& VJunction::as_expr_result() { return VBool::get(false); } Value* VJunction::get_element(const String& aname) { // .CLASS if(aname==CLASS_NAME) return this; // .CLASS_NAME if(aname==CLASS_NAMETEXT) return new VString(junction_class_name); return Value::get_element(aname); } parser-3.4.3/src/types/pa_vvoid.h000644 000000 000000 00000003324 11760757160 017043 0ustar00rootwheel000000 000000 /** @file Parser: @b void parser class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VVOID_H #define PA_VVOID_H #define IDENT_PA_VVOID_H "$Id: pa_vvoid.h,v 1.40 2012/05/28 20:22:08 moko Exp $" #define STRICT_VARS #include "classes.h" #include "pa_vstateless_object.h" #include "pa_globals.h" #include "pa_vstring.h" extern Methoded* void_class; /// value of type 'void'. ex: usually $sjfklsjfksjdfk has this type class VVoid: public VString { public: // Value override const char* type() const { return "void"; } override VStateless_class *get_class() { return void_class; } /// VVoid: true [the only one, that reports true] override bool is_void() const { return true; } /// VVoid: json-string ("null") override const String* get_json_string(Json_options&) { static const String singleton_json_null(String("null")); return &singleton_json_null; } /// VVoid: methods override Value* get_element(const String& aname) { // methods if(Value* result=VStateless_object::get_element(aname)) return result; return 0; } #ifdef STRICT_VARS static bool strict_vars; #define CHECK_STRICT if(strict_vars) throw Exception(PARSER_RUNTIME, 0, "Use of uninitialized value"); #else #define CHECK_STRICT #endif /// VVoid: with OPTIMIZE_SINGLE_STRING_WRITE it allows void to survive in [$void] override bool is_string() const { return true; } override const String* get_string() { CHECK_STRICT return VString::get_string(); } override Value& as_expr_result() { CHECK_STRICT return VString::as_expr_result(); } inline static VVoid *get(){ static VVoid singleton; return &singleton; } }; #endif parser-3.4.3/src/types/pa_vmemcached.C000644 000000 000000 00000017117 12223630564 017741 0ustar00rootwheel000000 000000 /** @file Parser: memcached class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Ivan Poluyanov Artem Stepanov */ #include "pa_vmemcached.h" #include "pa_value.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vvoid.h" volatile const char * IDENT_PA_VMEMCACHED_C="$Id: pa_vmemcached.C,v 1.15 2013/10/04 21:21:56 moko Exp $" IDENT_PA_VMEMCACHED_H; const char *memcached_library="libmemcached" LT_MODULE_EXT; // support functions static void error(const char *step, memcached_st* m, memcached_return rc) { const char* str=f_memcached_strerror(m, rc); throw Exception("memcached", 0, "%s error: %s (%d)", step, str ? str : "", rc); } inline void check(const char *action, memcached_st* m, memcached_return rc) { if(rc==MEMCACHED_SUCCESS) return; error(action, m, rc); } inline void check(const char *action, memcached_st* m, memcached_return rc, memcached_return ok) { if(rc==MEMCACHED_SUCCESS || rc==ok) return; error(action, m, rc); } inline void check_key(const String& akey) { if(akey.is_empty()) throw Exception("memcached", 0, "key must not be empty"); if(akey.length() > MEMCACHED_MAX_KEY) throw Exception("memcached", &akey, "key length %d exceeds limit (%d bytes)", akey.length(), MEMCACHED_MAX_KEY); } // serialization helpers #define SERIALIZED_STRING 256 struct Serialization_data{ unsigned int flags; const char *ptr; size_t length; Serialization_data() : flags(0), ptr(0), length(0){} Serialization_data(unsigned int aflags) : flags(aflags), ptr(0), length(0){} Serialization_data(unsigned int aflags, const char *aptr, size_t alength) : flags(aflags), ptr(aptr), length(alength){} }; static void serialize_string(const String &str, Serialization_data &data){ if(str.is_empty()){ data = Serialization_data(SERIALIZED_STRING); return; } if (str.is_not_just_lang()){ String::Cm cm = str.serialize(0); data = Serialization_data(SERIALIZED_STRING, cm.str, cm.length); } else { data = Serialization_data(SERIALIZED_STRING + (unsigned int)str.just_lang(), str.cstr(), str.length()); } } static VString *deserialize_string(Serialization_data &data){ String *result; if(data.flags==SERIALIZED_STRING){ result = new String(); if (data.length>0 && !result->deserialize(0, (void *)data.ptr, data.length)) return NULL; } else { // we can't use length from memcached as there can be '\0' inside String::Language lang=(String::Language)(data.flags-SERIALIZED_STRING); result = new String(data.ptr, lang); } return new VString(*result); } static Value &deserialize(Serialization_data &data){ Value *result=NULL; if(data.flags>=SERIALIZED_STRING && data.flags<(SERIALIZED_STRING+256)){ // String->deserialize uses passed string if(data.length>0) data.ptr=pa_strdup(data.ptr, data.length); result=deserialize_string(data); } if (!result) throw Exception(PARSER_RUNTIME, 0, "unable to deserialize data id %d, size %d", data.flags, data.length); return *result; } // VMemcached static void load_memcached(const char *library){ const char *memcached_status = memcached_load(library); if(memcached_status) throw Exception("memcached", 0, "failed to load memcached library %s: %s", library, memcached_status); } void VMemcached::open(const String& options_string, time_t attl){ load_memcached(memcached_library); if(f_memcached==NULL) throw Exception("memcached", 0, "options hash requires libmemcached version 0.49 or later"); if(options_string.is_empty()) throw Exception("memcached", 0, "options hash must not be empty"); fttl=attl; fm=f_memcached(options_string.cstr(), options_string.length()); check("connect", fm, f_memcached_version(fm), MEMCACHED_NOT_SUPPORTED); } void VMemcached::open_parse(const String& connect_string, time_t attl){ load_memcached(memcached_library); if(connect_string.is_empty()) throw Exception("memcached", 0, "connect string must not be empty"); fttl=attl; fm=f_memcached_create(NULL); memcached_server_st* fservers = f_memcached_servers_parse(connect_string.cstr()); check("server_push", fm, f_memcached_server_push(fm, fservers)); check("connect", fm, f_memcached_version(fm), MEMCACHED_NOT_SUPPORTED); } void VMemcached::flush(time_t attl) { check("flush", fm, f_memcached_flush(fm, attl)); } void VMemcached::quit() { f_memcached_quit(fm); } void VMemcached::remove(const String& aname) { check_key(aname); check("delete", fm, f_memcached_delete(fm, aname.cstr(), aname.length(), (time_t)0), MEMCACHED_NOTFOUND); } Value* VMemcached::get_element(const String& aname) { if(Value *result=VStateless_object::get_element(aname)) return result; check_key(aname); memcached_return rc; Serialization_data data; data.ptr=f_memcached_get(fm, aname.cstr(), aname.length(), &data.length, &data.flags, &rc); if(rc==MEMCACHED_SUCCESS){ return &deserialize(data); } if(rc==MEMCACHED_NOTFOUND) return VVoid::get(); error("get", fm, rc); return 0; // calm down compiler } Value &VMemcached::mget(ArrayString& akeys) { VHash &hresult = *new VHash(); size_t kl = akeys.count(); if(kl==0) return hresult; const char **keys = new const char *[kl]; size_t *key_lengths = new size_t[kl]; for(size_t i=0; iget_hash()) { int valid_options=1; if(Value* ttl_value=hash->get(expires_name)){ ttl=ttl_value->as_int(); valid_options++; } if(avalue=hash->get(value_name)){ if(avalue->get_junction()) throw Exception("memcached", 0, VALUE_NAME " must not be code"); } else throw Exception("memcached", &aname, "value hash must contain ." VALUE_NAME); if(valid_options!=hash->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(avalue->is_string()){ serialize_string(*avalue->get_string(), data); } else { throw Exception("memcached", &aname, "%s serialization not supported yet", avalue->type()); } return ttl; } bool VMemcached::add(const String& aname, Value* avalue){ check_key(aname); Serialization_data data; time_t ttl=serialize_value(fttl, aname, avalue, data); memcached_return rc=f_memcached_add(fm, aname.cstr(), aname.length(), data.ptr, data.length, ttl, data.flags); if(rc == MEMCACHED_NOTSTORED) return false; if(rc != MEMCACHED_SUCCESS) error("add", fm, rc); return true; } const VJunction* VMemcached::put_element(const String& aname, Value* avalue){ check_key(aname); Serialization_data data; time_t ttl=serialize_value(fttl, aname, avalue, data); check("set", fm, f_memcached_set(fm, aname.cstr(), aname.length(), data.ptr, data.length, ttl, data.flags)); return PUT_ELEMENT_REPLACED_ELEMENT; } parser-3.4.3/src/types/pa_vhashfile.h000644 000000 000000 00000004364 12223630564 017663 0ustar00rootwheel000000 000000 /** @file Parser: @b hashfile parser type decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VHASHFILE_H #define PA_VHASHFILE_H #define IDENT_PA_VHASHFILE_H "$Id: pa_vhashfile.h,v 1.43 2013/10/04 21:21:56 moko Exp $" #include "classes.h" #include "pa_pool.h" #include "pa_value.h" #include "pa_hash.h" #include "pa_vint.h" #include "pa_sdbm.h" // defines #define VHASHFILE_TYPE "hashfile" // externs extern Methoded *hashfile_class; /// value of type 'hashfile', implemented with SDBM library bundled in ../libs/sdbm class VHashfile : public VStateless_object, Pooled { public: // value override const char *type() const { return VHASHFILE_TYPE; } override VStateless_class *get_class() { return hashfile_class; } /// VHashfile: convert to VHash override HashStringValue *get_hash(); override HashStringValue* get_fields() { return get_hash(); } /// VHashfile: (key)=value override Value* get_element(const String& aname) { // $CLASS,$method if(Value *result=VStateless_object::get_element(aname)) return result; // $element return get_field(aname); } /// VHashfile: (key)=value, (key)=(value+expires) override const VJunction* put_element(const String& aname, Value* avalue) { put_field(aname, avalue); return 0; // nobody is supposed to derive from hashfile, so does not matter } public: // usage VHashfile(Pool& apool): Pooled(apool), m_db(0) {} override ~VHashfile(); void open(const String& afile_name); void close(); bool is_open(); pa_sdbm_t *get_db_for_reading(); pa_sdbm_t *get_db_for_writing(); // void clear(); void delete_files(); void remove(const String& aname); void for_each(bool callback(pa_sdbm_datum_t, void*), void* info); void for_each(bool callback(const String::Body, const String&, void*), void* info); public: void remove(const pa_sdbm_datum_t key); pa_sdbm_datum_t serialize_value(const String& string, time_t time_to_die) const; const String* deserialize_value(const pa_sdbm_datum_t key, const pa_sdbm_datum_t value); private: Value *get_field(const String& aname); void put_field(const String& aname, Value *avalue); private: const char* file_name; pa_sdbm_t *m_db; }; #endif parser-3.4.3/src/types/pa_vfile.C000644 000000 000000 00000015456 12175501771 016761 0ustar00rootwheel000000 000000 /** @file Parser: @b file parser type. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "classes.h" #include "pa_vfile.h" #include "pa_vstring.h" #include "pa_vint.h" #include "pa_request.h" volatile const char * IDENT_PA_VFILE_C="$Id: pa_vfile.C,v 1.61 2013/07/29 15:02:17 moko Exp $" IDENT_PA_VFILE_H; // externs extern Methoded* file_class; // defines for statics #define SIZE_NAME "size" #define TEXT_NAME "text" #define MODE_VALUE_TEXT "text" #define MODE_VALUE_BINARY "binary" #define CONTENT_TYPE_TEXT "text/plain" #define CONTENT_TYPE_BINARY "application/octet-stream" // statics static const String size_name(SIZE_NAME); static const String text_name(TEXT_NAME); static const String mode_value_text(MODE_VALUE_TEXT); static const String mode_value_binary(MODE_VALUE_BINARY); static const String content_type_text(CONTENT_TYPE_TEXT); static const String content_type_binary(CONTENT_TYPE_BINARY); inline bool content_type_is_default(Value *content_type){ if(content_type){ const String *ct=content_type->get_string(); return ct == &content_type_text || ct == &content_type_binary; } return true; } // methods VStateless_class *VFile::get_class() { return file_class; } void VFile::set_all(bool atainted, bool ais_text_mode, const char* avalue_ptr, size_t avalue_size, const String* afile_name) { fvalue_ptr=avalue_ptr; fvalue_size=avalue_size; ftext_tainted=atainted; fis_text_content=ais_text_mode; ffields.clear(); set_name(afile_name); ffields.put(size_name, new VInt(fvalue_size)); set_mode(ais_text_mode); } void VFile::set(bool atainted, bool ais_text_mode, char* avalue_ptr, size_t avalue_size, const String* afile_name, Value* acontent_type, Request* r) { if(ais_text_mode && avalue_ptr && avalue_size) { fix_line_breaks(avalue_ptr, avalue_size); } set_all(atainted, ais_text_mode, avalue_ptr, avalue_size, afile_name); set_content_type(acontent_type, afile_name, r); } void VFile::set_binary(bool atainted, const char* avalue_ptr, size_t avalue_size, const String* afile_name, Value* acontent_type, Request* r) { set_all(atainted, false, avalue_ptr, avalue_size, afile_name); set_content_type(acontent_type, afile_name, r); } void VFile::set_binary_string(bool atainted, const char* avalue_ptr, size_t avalue_size) { set_all(atainted, false, avalue_ptr, avalue_size, 0); } void VFile::set(VFile& avfile, bool aset_text_mode, bool ais_text_mode, const String* afile_name, Value* acontent_type, Request* r) { fvalue_ptr=avfile.fvalue_ptr; fvalue_size=avfile.fvalue_size; ftext_tainted=avfile.ftext_tainted; fis_text_content=avfile.fis_text_content; ffields.clear(); for(HashStringValue::Iterator i(avfile.ffields); i; i.next()) if(i.key() != text_name) // do not copy cached .text value ffields.put(*new String(i.key(), String::L_TAINTED), i.value()); if(aset_text_mode) set_mode(ais_text_mode); if(afile_name) set_name(afile_name); if(acontent_type || afile_name || aset_text_mode && content_type_is_default(ffields.get(content_type_name))) set_content_type(acontent_type, afile_name, r); } const char* VFile::text_cstr() { const char* p=value_ptr(); if(fis_text_content) return p; size_t size=fvalue_size; if(const char *premature_zero_pos=(const char *)memchr(p, 0, size)) size=premature_zero_pos-p; char *copy_ptr=size?strdup(p, size):0; // text mode but binary content if(fis_text_mode && size) fix_line_breaks(copy_ptr, size); return copy_ptr; } void VFile::set_mode(bool ais_text_mode){ fis_text_mode=ais_text_mode; if(fvalue_ptr) ffields.put(mode_name, new VString(ais_text_mode? mode_value_text : mode_value_binary )); } void VFile::set_name(const String* afile_name){ char *lfile_name; if(afile_name && !afile_name->is_empty()) { lfile_name=strdup(afile_name->taint_cstr(String::L_FILE_SPEC)); if(char *after_slash=rsplit(lfile_name, '\\')) lfile_name=after_slash; if(char *after_slash=rsplit(lfile_name, '/')) lfile_name=after_slash; } else lfile_name=(char *)NONAME_DAT; ffields.put(name_name, new VString(*new String(lfile_name, String::L_FILE_SPEC))); } void VFile::set_content_type(Value* acontent_type, const String* afile_name, Request* r){ if(!acontent_type && afile_name && r) acontent_type=new VString(r->mime_type_of(afile_name)); if(!acontent_type) acontent_type=new VString(fis_text_mode ? content_type_text : content_type_binary); ffields.put(content_type_name, acontent_type); } void VFile::save(Request_charsets& charsets, const String& file_spec, bool is_text, Charset* asked_charset) { if(fvalue_ptr) file_write(charsets, file_spec, fvalue_ptr, fvalue_size, is_text, false/*do_append*/, asked_charset); else throw Exception(PARSER_RUNTIME, &file_spec, "saving stat-ed file"); } bool VFile::is_text_mode(const String& mode) { if(mode==mode_value_text) return true; if(mode==mode_value_binary) return false; throw Exception(PARSER_RUNTIME, &mode, "is invalid mode, must be either '"MODE_VALUE_TEXT"' or '"MODE_VALUE_BINARY"'"); } bool VFile::is_valid_mode (const String& mode) { return (mode==mode_value_text || mode==mode_value_binary); } Value* VFile::get_element(const String& aname) { Value* result; // $method if(result=VStateless_object::get_element(aname)) return result; // $field if(result=ffields.get(aname)) return result; // $text - if not cached if(aname == text_name && fvalue_ptr && fvalue_size) { // assigned file have ptr and we really have some bytes result=new VString(*new String(text_cstr(), ftext_tainted ? String::L_TAINTED : String::L_AS_IS)); // cache it ffields.put(text_name, result); return result; } return 0; } const String* VFile::get_json_string(Json_options& options){ String& result=*new String("{\n", String::L_AS_IS); String * indent=NULL; if (options.indent){ indent = new String(",\n\t", String::L_AS_IS); *indent << options.indent << "\""; result << "\t" << options.indent; } result << "\"class\":\"file\""; for(HashStringValue::Iterator i(ffields); i; i.next() ){ String::Body key=i.key(); if(key != text_name){ indent ? result << *indent : result << ",\n\""; result << String(key, String::L_JSON) << "\":" << *i.value()->get_json_string(options); } } if(fvalue_ptr){ switch(options.file){ case Json_options::F_BASE64: { indent ? result << *indent : result << ",\n\""; result << "base64\":\""; const char* encoded=pa_base64_encode(fvalue_ptr, fvalue_size); result.append_help_length(encoded, 0, String::L_JSON); result << "\""; break; } case Json_options::F_TEXT: { indent ? result << *indent : result << ",\n\""; result << "text\":\""; result.append_help_length(text_cstr(), 0, String::L_JSON); result << "\""; break; } } } result << "\n" << options.indent << "}"; return &result; } parser-3.4.3/src/types/pa_value.C000644 000000 000000 00000010507 11760753150 016757 0ustar00rootwheel000000 000000 /** @file Parser: Value class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_value.h" #include "pa_vstateless_class.h" #include "pa_vmethod_frame.h" #include "pa_vdate.h" #include "pa_vobject.h" volatile const char * IDENT_PA_VALUE_C="$Id: pa_value.C,v 1.35 2012/05/28 19:47:52 moko Exp $" IDENT_PA_VALUE_H IDENT_PA_PROPERTY_H; // globals const String name_name(NAME_NAME); const String value_name(VALUE_NAME); const String expires_name(EXPIRES_NAME); const String content_type_name(CONTENT_TYPE_NAME); // methods Junction* Value::get_junction() { return 0; } Value* Value::get_element(const String& /*aname*/) { return bark("is '%s', it has no elements"); } VFile* Value::as_vfile(String::Language /*lang*/, const Request_charsets* /*charsets*/) { bark("is '%s', it does not have file value"); return 0; } const String* Value::get_json_string(Json_options& options) { if(HashStringValue* hash=get_hash()) return options.hash_json_string(*hash); if(!options.skip_unknown) throw Exception(PARSER_RUNTIME, 0, "Unsupported value's type (%s)", type()); return new String("null"); } /// call this before invoking to ensure proper actual numbered params count void Method::check_actual_numbered_params(Value& self, MethodParams* actual_numbered_params) const { int actual_count=actual_numbered_params?actual_numbered_params->count():0; if(actual_countmax_numbered_params_count) throw Exception(PARSER_RUNTIME, 0, "native method of %s (%s) accepts %s %d parameter(s) (%d present)", self.get_class()->name_cstr(), self.type(), actual_count(*vdate)); result.append_help_length(attribute.str, attribute.length, String::L_CLEAN); } else throw Exception(PARSER_RUNTIME, &result, "trying to append here neither string nor date (%s)", value.type()); } #ifndef DOXYGEN struct Attributed_meaning_info { String* header; // header line being constructed String::Language lang; // language in which to append to that line bool forced; // do they force that lang? bool allow_bool; // allow bool types during print attributes }; #endif static void append_attribute_subattribute(HashStringValue::key_type akey, HashStringValue::value_type avalue, Attributed_meaning_info *info) { if(akey==VALUE_NAME) return; if(avalue->is_bool() && (!info->allow_bool || avalue->as_bool()==false)) return; // ...; charset=windows1251 *info->header << "; "; info->header->append(String(akey, String::L_TAINTED), info->lang, info->forced); if(!avalue->is_bool()) { if( akey==content_disposition_filename_name ) { *info->header << "=\""; append_attribute_meaning(*info->header, *avalue, info->lang, info->forced); *info->header << "\""; } else { *info->header << "="; append_attribute_meaning(*info->header, *avalue, info->lang, info->forced); } } } const String& attributed_meaning_to_string(Value& meaning, String::Language lang, bool forced, bool allow_bool) { String& result=*new String; if(HashStringValue *hash=meaning.get_hash()) { // $value(value) $subattribute(subattribute value) if(Value* value=hash->get(value_name)) append_attribute_meaning(result, *value, lang, forced); Attributed_meaning_info attributed_meaning_info={&result, lang, false, allow_bool}; hash->for_each(append_attribute_subattribute, &attributed_meaning_info); } else // result value append_attribute_meaning(result, meaning, lang, forced); return result; } parser-3.4.3/src/types/types.vcproj000644 000000 000000 00000017437 12230131504 017443 0ustar00rootwheel000000 000000 parser-3.4.3/src/types/pa_vxnode.h000644 000000 000000 00000002660 12223630566 017214 0ustar00rootwheel000000 000000 /** @file Parser: @b xnode parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VXNODE_H #define PA_VXNODE_H #define IDENT_PA_VXNODE_H "$Id: pa_vxnode.h,v 1.43 2013/10/04 21:21:58 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" extern "C" { #include "libxml/tree.h" }; // defines #define VXNODE_TYPE "xnode" // externals extern Methoded* xnode_class; // forwards class VXdoc; /// value of type 'xnode'. implemented with xmlNode class VXnode: public VStateless_object { public: // Value override const char* type() const { return VXNODE_TYPE; } override VStateless_class* get_class() { return xnode_class; } /// VXnode: true override bool as_bool() const { return true; } /// VXnode: true override Value& as_expr_result(); /// VXnode: $CLASS,$method, fields override Value* get_element(const String& aname); /// VXnode: $nodeValue override const VJunction* put_element(const String& aname, Value* avalue); public: // usage VXnode(xmlNode& anode) : fnode(anode) {} public: // VXnode virtual xmlNode& get_xmlnode() { return fnode; } virtual VXdoc& get_vxdoc() { assert(fnode.doc); VXdoc* result=static_cast(fnode.doc->_private); assert(result); return *result; } Request_charsets& charsets(); private: xmlNode& fnode; }; #endif parser-3.4.3/src/types/pa_vconsole.h000644 000000 000000 00000003333 12223630564 017535 0ustar00rootwheel000000 000000 /** @file Parser: @b console class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VCONSOLE_H #define PA_VCONSOLE_H #define IDENT_PA_VCONSOLE_H "$Id: pa_vconsole.h,v 1.19 2013/10/04 21:21:56 moko Exp $" // includes #include "pa_sapi.h" #include "pa_common.h" #include "pa_value.h" #include "pa_string.h" // defines #define CONSOLE_CLASS_NAME "console" static const String console_class_name(CONSOLE_CLASS_NAME); #define CONSOLE_LINE_NAME "line" /// console class class VConsole: public Value { public: // Value const char* type() const { return CONSOLE_CLASS_NAME; } /// VConsole: 0 VStateless_class *get_class() { return 0; } /// console: line, CLASS, CLASS_NAME Value* get_element(const String& aname) { // $line if(aname==CONSOLE_LINE_NAME) { char local_value[MAX_STRING]; if(fgets(local_value, sizeof(local_value), stdin)) return new VString(*new String(strdup(local_value), String::L_TAINTED)); return 0; // EOF } // $CLASS if(aname==CLASS_NAME) return this; // $CLASS_NAME if(aname==CLASS_NAMETEXT) return new VString(console_class_name); throw Exception(PARSER_RUNTIME, &aname, "reading of invalid field"); } /// console: $line override const VJunction* put_element(const String& aname, Value* avalue) { // $line if(aname==CONSOLE_LINE_NAME) { fused=true; puts(avalue->as_string().cstr()); fflush(stdout); return PUT_ELEMENT_REPLACED_ELEMENT; } throw Exception(PARSER_RUNTIME, &aname, "writing to invalid field"); } bool was_used(){ return fused; } public: // usage VConsole() { fused=false; } private: bool fused; }; #endif parser-3.4.3/src/types/pa_vstateless_object.h000644 000000 000000 00000002335 12223630565 021432 0ustar00rootwheel000000 000000 /** @file Parser: @b stateless_object class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VSTATELESS_OBJECT_H #define PA_VSTATELESS_OBJECT_H #define IDENT_PA_VSTATELESS_OBJECT_H "$Id: pa_vstateless_object.h,v 1.41 2013/10/04 21:21:57 moko Exp $" // include #include "pa_vjunction.h" #include "pa_vstateless_class.h" /** the object of some class. "of some class" means "with some set of methods and CLASS_fields". */ class VStateless_object: public Value { public: // Value /// VStateless_object: class_transparent override Value* get_element(const String& aname) { return get_class()->get_element(*this, aname); } /// VStateless_object: class_transparent override const VJunction* put_element(const String& aname, Value* avalue) { return get_class()->put_element(*this, aname, avalue); } /// VStateless_object: class_transparent override Value* get_default_getter(Value& aself, const String& aname) { return get_class()->get_default_getter(aself, aname); } /// VStateless_object: class_transparent override Value* get_scalar(Value& aself){ return get_class()->get_scalar(aself); } }; #endif parser-3.4.3/src/types/pa_vclass.h000644 000000 000000 00000004074 12225074132 017176 0ustar00rootwheel000000 000000 /** @file Parser: @b class parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VCLASS_H #define PA_VCLASS_H #define IDENT_PA_VCLASS_H "$Id: pa_vclass.h,v 1.62 2013/10/08 21:25:46 moko Exp $" // includes #include "pa_vstateless_class.h" #include "pa_vjunction.h" /** stores - static fields, getters & setters: VClass::ffields */ class VClass: public VStateless_class { public: // Value override const char* type() const { return name_cstr(); } /// VClass: true override bool as_bool() const { return true; } override Value* as(const char* atype); override Value* get_element(Value& aself, const String& aname); override const VJunction* put_element(Value& self, const String& name, Value* value); // for VObject::put_element const VJunction* put_element_replace_only(Value& self, const String& name, Value* value); override Value* create_new_value(Pool&); override HashStringValue *get_hash(); override HashStringValue* get_fields() { return get_hash(); }; public: // VStateless_class override void real_set_method(const String& aname, Method* amethod); override HashStringProperty* get_properties(){ return &ffields; }; override void set_base(VStateless_class* abase); /// VClass default getter & setter support override void enable_default_getter(){ state |= IS_GETTER_ACTIVE; } override void enable_default_setter(){ if(has_default_setter()) state |= IS_SETTER_ACTIVE; } override void disable_default_getter(){ state &= ~IS_GETTER_ACTIVE; } override void disable_default_setter(){ state &= ~IS_SETTER_ACTIVE; } override bool is_enabled_default_getter(){ return (state & IS_GETTER_ACTIVE) > 0; } override bool is_enabled_default_setter(){ return (state & IS_SETTER_ACTIVE) > 0; } private: enum State { IS_GETTER_ACTIVE = 0x01, IS_SETTER_ACTIVE = 0x02 }; int state; // default setter & getter state HashStringProperty ffields; Property& get_property(const String& aname); public: VClass() : state(IS_GETTER_ACTIVE){} }; #endif parser-3.4.3/src/types/pa_wwrapper.h000644 000000 000000 00000006061 12223630566 017557 0ustar00rootwheel000000 000000 /** @file Parser: @b write_wrapper write context Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_WWRAPPER_H #define PA_WWRAPPER_H #define IDENT_PA_WWRAPPER_H "$Id: pa_wwrapper.h,v 1.45 2013/10/04 21:21:58 moko Exp $" #define OPTIMIZE_SINGLE_STRING_WRITE #include "pa_wcontext.h" #include "pa_exception.h" /// specialized write context, adds to WContext VHash autocreation ability class WWrapper: public WContext { public: // Value override const char* type() const { return "wwrapper"; } /// WWrapper: transparent override Value* get_element(const String& aname) { return as_value().get_element(aname); } /// WWrapper: transparent override const VJunction* put_element(const String& aname, Value* avalue) { if(!fvalue) { fvalue=new VHash; // not constructing anymore [if were constructing] // so to allow method calls after real constructor-method call // sample: // $hash[ // $.key1[$i] // ^i.inc[] ^rem{allow such calls} // $.key2[$1] } return fvalue->put_element(aname, avalue); } public: // usage WWrapper(WContext *aparent) : WContext(aparent) { } private: // raises an exception on 0 value Value& as_value() const { if(!fvalue) throw Exception(0, 0, "accessing wrapper without value"); return *fvalue; } }; #ifdef OPTIMIZE_SINGLE_STRING_WRITE class WObjectPoolWrapper: public WWrapper { public: enum WState { WS_NONE, WS_KEEP_VALUE, WS_TRANSPARENT }; WObjectPoolWrapper(WContext *aparent) : WWrapper(aparent), fstate(WS_NONE) { } override const VJunction* put_element(const String& aname, Value* avalue) { if(fstate == WS_KEEP_VALUE) fvalue=0; // VHash will be created, thus no need to flush fvalue fstate=WS_TRANSPARENT; return WWrapper::put_element(aname, avalue); } override void write(const String& astring, String::Language alang) { if(fstate == WS_KEEP_VALUE) flush(); fstate=WS_TRANSPARENT; WWrapper::write(astring, alang); } override void write(Value& avalue) { if(fstate == WS_KEEP_VALUE) flush(); fstate=WS_TRANSPARENT; WWrapper::write(avalue); } override void write(Value& avalue, String::Language alang) { switch(fstate){ case WS_NONE:{ // alang is allways L_PASS_APPENDED, but just in case we check it // only VString can be cached, no get_string() call as VInt/etc will be affected if(avalue.is_string() && alang == String::L_PASS_APPENDED){ fvalue=&avalue; fstate=WS_KEEP_VALUE; return; } break; } case WS_KEEP_VALUE:{ flush(); break; } } fstate=WS_TRANSPARENT; // we copy WWrapper::write here to prevent virtual call to our class if(const String* fstring=avalue.get_string()) WWrapper::write(*fstring, alang); else WWrapper::write(avalue); } //override StringOrValue result() - not required as as_value() will be allways called private: WState fstate; inline void flush(){ WWrapper::write(*fvalue->get_string(), String::L_PASS_APPENDED); fvalue=0; } }; #endif #endif parser-3.4.3/src/types/pa_vregex.h000644 000000 000000 00000005135 12116552270 017205 0ustar00rootwheel000000 000000 /** @file Parser: @b regex class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VREGEX_H #define PA_VREGEX_H #define IDENT_PA_VREGEX_H "$Id: pa_vregex.h,v 1.8 2013/03/09 06:20:40 misha Exp $" // include #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_charset.h" #include "pcre.h" // defines #define VREGEX_TYPE "regex" enum Match_feature { MF_GLOBAL_SEARCH = 0x01, MF_NEED_PRE_POST_MATCH = 0x02, MF_JUST_COUNT_MATCHES = 0x04 }; extern Methoded* regex_class; // VRegex class VRegex: public VStateless_object { public: // Value override const char* type() const { return VREGEX_TYPE; } override VStateless_class *get_class() { return regex_class; } /// VRegex: count override int as_int() { return get_info_size(); } /// VRegex: count override double as_double() { return get_info_size(); } /// VRegex: true override bool is_evaluated_expr() const { return true; } /// VRegex: scalar override Value& as_expr_result(); /// VRegex: true virtual bool is_defined() const { return true; } /// VRegex: true override bool as_bool() const { return true; } override Value* get_element(const String& aname); public: // usage VRegex(): fcharset(0), fpattern(0), foptions_cstr(0), fcode(0), fextra(0), fstudied(false) { foptions[0]=0; foptions[1]=0; } VRegex(Charset& acharset, const String* aregex, const String* aoptions): fextra(0), fstudied(false) { set(acharset, aregex, aoptions); compile(); } ~VRegex(){ if(fextra) pcre_free(fextra); if(fcode) pcre_free(fcode); } void set(Charset& acharset, const String* aregex, const String* aoptions); void compile(); void study(); int exec(const char* string, size_t string_len, int* ovector, int ovector_size, int prestart=0); // size_t info(); size_t full_info(int type); size_t get_info_size(); size_t get_study_size(); size_t get_options(); bool is_pre_post_match_needed(){ return (foptions[1] & MF_NEED_PRE_POST_MATCH)!=0; } bool is_just_count(){ return (foptions[1] & MF_JUST_COUNT_MATCHES)!=0; } bool is_global_search(){ return (foptions[1] & MF_GLOBAL_SEARCH)!=0; } private: static void regex_options(const String* options, int* result); private: Charset* fcharset; const char* fpattern; const char* foptions_cstr; int foptions[2]; pcre* fcode; pcre_extra* fextra; bool fstudied; }; class VRegexCleaner { public: VRegex *vregex; VRegexCleaner(): vregex(0) { } ~VRegexCleaner(){ if(vregex) delete vregex; } }; #endif parser-3.4.3/src/types/pa_vstring.C000644 000000 000000 00000001262 12165271776 017346 0ustar00rootwheel000000 000000 /** @file Parser: @b string class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vstring.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VSTRING_C="$Id: pa_vstring.C,v 1.34 2013/07/04 13:09:18 moko Exp $" IDENT_PA_VSTRING_H; VFile* VString::as_vfile(String::Language lang, const Request_charsets* charsets) { VFile& result=*new VFile; String::Body sbody=fstring->cstr_to_string_body_untaint(lang, 0, charsets); /* we are using binary to avoid ^#0D to be altered */ result.set_binary_string(false/*not tainted*/, sbody.cstr() , sbody.length()); return &result; } parser-3.4.3/src/types/pa_vresponse.h000644 000000 000000 00000002515 12223630565 017733 0ustar00rootwheel000000 000000 /** @file Parser: response class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VRESPONSE_H #define PA_VRESPONSE_H #define IDENT_PA_VRESPONSE_H "$Id: pa_vresponse.h,v 1.44 2013/10/04 21:21:57 moko Exp $" #include "pa_vstateless_object.h" #include "pa_string.h" #include "classes.h" // defines #define RESPONSE_CLASS_NAME "response" // forwards class Response; class Request_info; class Request_charsets; // externals extern Methoded* response_class; /// value of type 'response' class VResponse: public VStateless_object { Request_info& finfo; Request_charsets& fcharsets; HashStringValue ffields; public: // Value override const char* type() const { return RESPONSE_CLASS_NAME; } override VStateless_class *get_class() { return response_class; } /// Response: ffields override HashStringValue* get_hash() { return &ffields; } /// Response: method,fields override Value* get_element(const String& aname); /// Response: (attribute)=value override const VJunction* put_element(const String& name, Value* value); public: // usage VResponse(Request_info& ainfo, Request_charsets& acharsets): finfo(ainfo), fcharsets(acharsets) {} /// used in pa_request.C HashStringValue& fields() { return ffields; } }; #endif parser-3.4.3/src/types/pa_vtable.h000644 000000 000000 00000003552 12116552270 017163 0ustar00rootwheel000000 000000 /** @file Parser: @b table parser class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VTABLE_H #define PA_VTABLE_H #define IDENT_PA_VTABLE_H "$Id: pa_vtable.h,v 1.61 2013/03/09 06:20:40 misha Exp $" #include "pa_vstateless_object.h" #include "pa_table.h" //#include "pa_vvoid.h" #include "pa_vint.h" // defines #define VTABLE_TYPE "table" #define TABLE_FIELDS_ELEMENT_NAME "fields" // externs extern Methoded* table_class; /// value of type 'table'. implemented with Table class VTable: public VStateless_object { public: // Value override const char* type() const { return VTABLE_TYPE; } override VStateless_class *get_class() { return table_class; } /// VTable: count override int as_int() const { return table().count(); } /// VTable: count override double as_double() const { return table().count(); } /// VTable: count!=0 override bool is_defined() const { return table().count()!=0; } /// VTable: 0 or !0 override bool as_bool() const { return table().count()!=0; } /// VTable: count override Value& as_expr_result() { return *new VInt(as_int()); } /// VTable: json-string override const String* get_json_string(Json_options& options); /// extract VTable override Table* get_table() { return ftable; } /// VTable: columns,methods override Value* get_element(const String& aname); public: // usage VTable(Table* atable=0): ftable(atable) {} void set_table(Table& avalue) { ftable=&avalue; } Table& table() const { if(!ftable) bark("getting unset vtable value", 0); return *ftable; } private: Value* fields_element(); String& get_json_string_array(String&, const char *); String& get_json_string_object(String&, const char *); String& get_json_string_compact(String&, const char *); private: Table* ftable; }; #endif parser-3.4.3/src/types/pa_vxdoc.C000644 000000 000000 00000013446 11770627021 016771 0ustar00rootwheel000000 000000 /** @dom Parser: @b dom parser type. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_config_includes.h" #ifdef XML #include "pa_vxdoc.h" #include "pa_vbool.h" #include "pa_request.h" #include "pa_charset.h" volatile const char * IDENT_PA_VXDOC_C="$Id: pa_vxdoc.C,v 1.47 2012/06/21 14:22:09 moko Exp $" IDENT_PA_VXDOC_H; // defines #define SEARCH_NAMESPACES_NAME "search-namespaces" #define XDOC_OUTPUT_METHOD_OPTION_NAME "method" #define XDOC_OUTPUT_METHOD_OPTION_VALUE_XML "xml" #define XDOC_OUTPUT_METHOD_OPTION_VALUE_HTML "html" #define XDOC_OUTPUT_METHOD_OPTION_VALUE_TEXT "text" #define XDOC_OUTPUT_FILENAME_OPTION_NAME "name" VXnode& VXdoc::wrap(xmlNode& anode) { VXnode* result; if((result=static_cast(anode._private))) { assert(anode.doc==fdocument); return *result; } result=new VXnode(anode); anode._private=result; anode.doc=fdocument; return *result; } Value* VXdoc::as(const char* atype) { return atype && ( strcmp(VXdoc::type(), atype)==0 || strcmp(VXnode::type(), atype)==0 )?this:0; } /// VXdoc: true Value& VXdoc::as_expr_result() { return VBool::get(as_bool()); } /// VXdoc: $CLASS,$method Value* VXdoc::get_element(const String& aname) { if(aname==SEARCH_NAMESPACES_NAME) { return &search_namespaces; } // up try { return VXnode::get_element(aname); } catch(Exception) { // ignore bad node elements, they can be valid here... // fields xmlDoc& xmldoc=get_xmldoc(); if(aname=="doctype") { // readonly attribute DocumentType doctype; if(xmlNode* node=(xmlNode*)xmldoc.intSubset) return &wrap(*node); else return 0; } else if(aname=="implementation") { // readonly attribute DOMImplementation implementation; return 0; } else if(aname=="documentElement") { // readonly attribute Element documentElement; xmlNode* rootElement=xmlDocGetRootElement(&xmldoc); return rootElement ? &wrap(*rootElement) : 0; } return bark("%s field not found", &aname); } } static int param_option_over_output_option( HashStringValue& param_options, const char* option_name, const String*& output_option) { if(Value* value=param_options.get(String::Body(option_name))){ output_option=&value->as_string(); return 1; } return 0; } static int param_option_over_output_option( HashStringValue& param_options, const char* option_name, int& output_option) { if(Value* value=param_options.get(String::Body(option_name))) { const String& s=value->as_string(); if(s=="yes") output_option=1; else if(s=="no") output_option=0; else throw Exception(PARSER_RUNTIME, &s, "%s must be either 'yes' or 'no'", option_name); return 1; } return 0; } void XDocOutputOptions::append(Request& r, HashStringValue* options, bool with_filename){ /* */ if(options) { int valid_options=0; // $.charset[windows-1251|...] valid_options+=param_option_over_output_option(*options, "charset", this->encoding); // $.encoding[windows-1251|...] valid_options+=param_option_over_output_option(*options, "encoding", this->encoding); if(valid_options==2) throw Exception(PARSER_RUNTIME, 0, "you can not specify $.charset and $.encoding together"); // $.method[xml|html|text] valid_options+=param_option_over_output_option(*options, XDOC_OUTPUT_METHOD_OPTION_NAME, this->method); // $.version[1.0] valid_options+=param_option_over_output_option(*options, "version", this->version); // $.omit-xml-declaration[yes|no] valid_options+=param_option_over_output_option(*options, "omit-xml-declaration", this->omitXmlDeclaration); // $.standalone[yes|no] valid_options+=param_option_over_output_option(*options, "standalone", this->standalone); // $.indent[yes|no] valid_options+=param_option_over_output_option(*options, "indent", this->indent); // $.media-type[text/{html|xml|plain}] valid_options+=param_option_over_output_option(*options, "media-type", this->mediaType); if(with_filename) // $.name[file name] valid_options+=param_option_over_output_option(*options, XDOC_OUTPUT_FILENAME_OPTION_NAME, this->filename); if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // default encoding from pool if(!this->encoding) this->encoding=new String(r.charsets.source().NAME(), String::L_TAINTED); // default method=xml if(!this->method) this->method=new String(XDOC_OUTPUT_METHOD_OPTION_VALUE_XML); // default mediaType = depending on method if(!this->mediaType) { if(*this->method==XDOC_OUTPUT_METHOD_OPTION_VALUE_XML) this->mediaType=new String("text/xml"); else if(*this->method==XDOC_OUTPUT_METHOD_OPTION_VALUE_HTML) this->mediaType=new String("text/html"); else // XDOC_OUTPUT_METHOD_OPTION_VALUE_TEXT & all others this->mediaType=new String("text/plain"); } } // defined at classes/xdoc.C String::C xdoc2buf(Request& r, VXdoc& vdoc, XDocOutputOptions& oo, const String* file_spec, bool use_source_charset_to_render_and_client_charset_to_write_to_header); const String* VXdoc::get_json_string(Json_options& options){ XDocOutputOptions xdoc_options_default; String::C buf=xdoc2buf(*options.r, *this, options.xdoc_options ? *options.xdoc_options : xdoc_options_default, 0/*file_name. not to file, to memory*/, true/*use source charset to render, client charset to put to header*/); String& result=*new String("\"", String::L_AS_IS); result << String(buf, String::L_JSON); result << "\""; return &result; } #endif parser-3.4.3/src/types/pa_vrequest.C000644 000000 000000 00000005312 12223630565 017516 0ustar00rootwheel000000 000000 /** @file Parser: @b request class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vrequest.h" #include "pa_request_info.h" #include "pa_request_charsets.h" #include "pa_charsets.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vform.h" #include "pa_vvoid.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VREQUEST_C="$Id: pa_vrequest.C,v 1.56 2013/10/04 21:21:57 moko Exp $" IDENT_PA_VREQUEST_H; // defines #define DOCUMENT_ROOT_NAME "document-root" VRequest::VRequest(Request_info& ainfo, Request_charsets& acharsets, VForm& aform): finfo(ainfo), fcharsets(acharsets), fform(aform) { if(ainfo.argv) for(size_t i=ainfo.args_skip; ainfo.argv[i]; i++) { char* value=new(PointerFreeGC) char[strlen(ainfo.argv[i])+1]; strcpy(value, ainfo.argv[i]); fargv.put_dont_replace( String(i-ainfo.args_skip, "%d"), new VString(*new String(value, String::L_TAINTED)) ); } } Value* VRequest::get_element(const String& aname) { // $request:charset if(aname==CHARSET_NAME) return new VString(*new String(fcharsets.source().NAME(), String::L_TAINTED)); // $request:post-charset if(aname==POST_CHARSET_NAME){ if(Charset* post_charset=fform.get_post_charset()) return new VString(*new String(post_charset->NAME(), String::L_TAINTED)); else return VVoid::get(); } // $resuest:post-body if(aname==POST_BODY_NAME){ VFile& result=*new VFile; result.set_binary(true/*tainted*/, (finfo.post_data)?finfo.post_data:"" /*to distinguish from stat-ed file*/, finfo.post_size); return &result; } // $CLASS if(aname==CLASS_NAME) return this; // $CLASS_NAME if(aname==CLASS_NAMETEXT) return new VString(request_class_name); // $request:argv if(aname==REQUEST_ARGV_ELEMENT_NAME) return new VHash(fargv); // $request:query $request:uri $request:document-root $request:body const char* buf; if(aname=="query") buf=finfo.query_string; else if(aname=="uri") buf=finfo.uri; else if(aname==DOCUMENT_ROOT_NAME) buf=finfo.document_root; else if(aname=="body") buf=finfo.post_data; else return bark("%s field not found", &aname); return new VString(*new String(buf, String::L_TAINTED)); } const VJunction* VRequest::put_element(const String& aname, Value* avalue) { // $charset if(aname==CHARSET_NAME) { fcharsets.set_source(charsets.get(avalue->as_string().change_case(UTF8_charset, String::CC_UPPER))); return PUT_ELEMENT_REPLACED_ELEMENT; } // $document-root if(aname==DOCUMENT_ROOT_NAME) { finfo.document_root=avalue->as_string().taint_cstr(String::L_FILE_SPEC); return PUT_ELEMENT_REPLACED_ELEMENT; } return Value::put_element(aname, avalue); } parser-3.4.3/src/types/pa_vcookie.h000644 000000 000000 00000002455 12223630564 017350 0ustar00rootwheel000000 000000 /** @file Parser: @b cookie class decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_VCOOKIE_H #define PA_VCOOKIE_H #define IDENT_PA_VCOOKIE_H "$Id: pa_vcookie.h,v 1.38 2013/10/04 21:21:56 moko Exp $" #include "pa_hash.h" #include "pa_common.h" #include "pa_value.h" #include "pa_sapi.h" #define COOKIE_CLASS_NAME "cookie" static const String cookie_class_name(COOKIE_CLASS_NAME); // forwards class Request_info; class Request_charsets; /// cookie class class VCookie: public Value { HashStringValue before; HashStringValue after; HashStringValue deleted; public: // Value override const char* type() const { return COOKIE_CLASS_NAME; } /// VCookie: 0 override VStateless_class *get_class() { return 0; } // cookie: CLASS, CLASS_NAME, field override Value* get_element(const String& aname); // cookie: field override const VJunction* put_element(const String& name, Value* value); public: // usage VCookie(Request_charsets& acharsets, Request_info& arequest_info); void output_result(SAPI_Info& sapi_info); private: Request_charsets& fcharsets; Request_info& frequest_info; private: Charset* filled_source; Charset* filled_client; bool should_refill(); void refill(); }; #endif parser-3.4.3/src/types/pa_wcontext.h000644 000000 000000 00000006326 12226061567 017571 0ustar00rootwheel000000 000000 /** @file Parser: write context class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_WCONTEXT_H #define PA_WCONTEXT_H #define IDENT_PA_WCONTEXT_H "$Id: pa_wcontext.h,v 1.59 2013/10/11 20:45:43 moko Exp $" #include "pa_value.h" #include "pa_vstring.h" #include "pa_vhash.h" class Request; class StringOrValue { public: StringOrValue() : fstring(0), fvalue(0) {} /// anticipating either String or Value [must not be 0&0] StringOrValue(const String& astring) : fstring(&astring), fvalue(0) {} StringOrValue(Value& avalue) : fstring(0), fvalue(&avalue) {} void set_string(const String& astring) { fstring=&astring; } void set_value(Value& avalue) { fvalue=&avalue; } const String* get_string() { return fstring; } Value* get_value() { return fvalue; } Value& as_value() const { Value* result=fvalue?fvalue:new VString(*fstring); return *result; } const String& as_string() const { return fstring?*fstring:fvalue->as_string(); } private: const String* fstring; Value* fvalue; }; /** Write context they do different write()s here, later picking up the result @see Request::wcontext */ class WContext: public Value { friend class Request; public: // Value override const char* type() const { return "wcontext"; } /// WContext: accumulated fstring override const String* get_string() { static String empty; return fstring?fstring:∅ }; /// WContext: none yet | transparent override VStateless_class *get_class() { return fvalue?fvalue->get_class():0; } public: // WContext /// appends a fstring to result virtual void write(const String& astring, String::Language alang) { if(!fstring) fstring=new String; astring.append_to(*fstring, alang); } /// writes Value; raises an error if already, providing origin virtual void write(Value& avalue); /** if value is VString writes fstring, else writes Value; raises an error if already, providing origin */ virtual void write(Value& avalue, String::Language alang) { if(const String* fstring=avalue.get_string()) write(*fstring, alang); else write(avalue); } /** retrives the resulting value that can be String if value==0 or the Value object wmethod_frame first checks for $result and if there is one, returns it instead */ virtual StringOrValue result() { static String empty; return fvalue?StringOrValue(*fvalue):StringOrValue(fstring?*fstring:empty); } void attach_junction(VJunction* ajunction) { junctions+=ajunction; } public: // usage WContext(WContext *aparent): fparent(aparent), fstring(0), fvalue(0), in_expression(false), entered_class(false){} virtual ~WContext() { detach_junctions(); } void set_in_expression(bool ain_expression) { in_expression=ain_expression; } bool get_in_expression() { return in_expression; } void set_somebody_entered_some_class() { entered_class=true; } bool get_somebody_entered_some_class() { bool result=entered_class; entered_class=0; return result; } private: void detach_junctions(); protected: WContext *fparent; String* fstring; Value* fvalue; private: // status bool in_expression; bool entered_class; private: Array junctions; }; #endif parser-3.4.3/src/types/pa_vhashfile.C000644 000000 000000 00000020634 11730603301 017603 0ustar00rootwheel000000 000000 /** @file Parser: @b table class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_globals.h" #include "pa_common.h" #include "pa_threads.h" #include "pa_vtable.h" #include "pa_vstring.h" #include "pa_vhashfile.h" #include "pa_vdate.h" volatile const char * IDENT_PA_VHASHFILE_C="$Id: pa_vhashfile.C,v 1.64 2012/03/16 09:24:17 moko Exp $" IDENT_PA_VHASHFILE_H; // consts const uint HASHFILE_VALUE_SERIALIZED_VERSION=0x0001; // methods void check(const char *step, pa_status_t status) { if(status==PA_SUCCESS) return; const char* str=strerror(status); throw Exception("file.access", 0, "%s error: %s (%d)", step, str?str:"", status); } void check_dir(const char* file_name){ String& sfile_name = *new String(file_name); if(!entry_exists(sfile_name)) create_dir_for_file(sfile_name); } void VHashfile::open(const String& afile_name) { file_name=afile_name.taint_cstr(String::L_FILE_SPEC); } void VHashfile::close() { if(!is_open()) return; check("pa_sdbm_close", pa_sdbm_close(m_db)); m_db=0; } bool VHashfile::is_open() { return m_db != 0; } pa_sdbm_t *VHashfile::get_db_for_reading() { if(is_open()){ return m_db; } if(file_name){ check_dir(file_name); check("pa_sdbm_open(shared)", pa_sdbm_open(&m_db, file_name, PA_CREATE|PA_READ|PA_SHARELOCK, 0664, 0)); } if(!is_open()) throw Exception("file.read", 0, "can't open %s for reading", type()); return m_db; } pa_sdbm_t *VHashfile::get_db_for_writing() { if(is_open()){ if(pa_sdbm_rdonly(m_db)) { close(); // close if was opened for reading } else { return m_db; } } if(file_name) { check_dir(file_name); // reopen in write mode & exclusive lock check("pa_sdbm_open(exclusive)", pa_sdbm_open(&m_db, file_name, PA_CREATE|PA_WRITE, 0664, 0)); } if(!is_open()) throw Exception("file.access", 0, "can't open %s for writing", type()); return m_db; } VHashfile::~VHashfile() { if(is_open()) close(); } struct Hashfile_value_serialized_prolog { uint version; time_t time_to_die; }; pa_sdbm_datum_t VHashfile::serialize_value(const String& string, time_t time_to_die) const { pa_sdbm_datum_t result; size_t length=string.length(); result.dsize=sizeof(Hashfile_value_serialized_prolog)+length; result.dptr=new(PointerFreeGC) char[result.dsize]; Hashfile_value_serialized_prolog& prolog=*reinterpret_cast(result.dptr); char *output_cstr=result.dptr+sizeof(Hashfile_value_serialized_prolog); prolog.version=HASHFILE_VALUE_SERIALIZED_VERSION; prolog.time_to_die=time_to_die; if(length) // reported errors on storing empty values to hashfiles, but without details. maybe here [win32, intel:solaris, freebsd were OK...] memcpy(output_cstr, string.cstr(), length); return result; } const String* VHashfile::deserialize_value(pa_sdbm_datum_t key, const pa_sdbm_datum_t value) { // key not found || it's surely not in our format if(!value.dptr || (size_t)value.dsizeget_hash()) { if(Value *value_value=hash->get(value_name)) { if(value_value->get_junction()) throw Exception(PARSER_RUNTIME, 0, VALUE_NAME" must not be code"); value_string=&value_value->as_string(); if(Value *expires=hash->get(expires_name)) { if(Value* vdate=expires->as(VDATE_TYPE)) time_to_die=static_cast(vdate)->get_time(); // $expires[DATE] else if(double days_till_expire=expires->as_double()) time_to_die=time(NULL)+(time_t)(60*60*24*days_till_expire); // $expires(days) } } else throw Exception(PARSER_RUNTIME, &aname, "put hash value must contain ."VALUE_NAME); } else value_string=&avalue->as_string(); pa_sdbm_datum_t key; key.dptr=const_cast(aname.cstr()); key.dsize=aname.length(); pa_sdbm_datum_t value=serialize_value(*value_string, time_to_die); #ifndef PAIRMAX // !see PAIRMAX definition in sdbm_private.h. values should be the same #define PAIRMAX 8008 #endif if(key.dsize+value.dsize > PAIRMAX) throw Exception(PARSER_RUNTIME, 0, "hashfile record length (key+value) exceeds limit (%d bytes)", PAIRMAX); check("pa_sdbm_store", pa_sdbm_store(db, key, value, PA_SDBM_REPLACE)); } Value *VHashfile::get_field(const String& aname) { pa_sdbm_t *db=get_db_for_reading(); pa_sdbm_datum_t key; key.dptr=const_cast(aname.cstr()); key.dsize=aname.length(); pa_sdbm_datum_t value; check("pa_sdbm_fetch", pa_sdbm_fetch(db, &value, key)); const String *sresult=deserialize_value(key, value); return sresult? new VString(*sresult): 0; } void VHashfile::remove(const pa_sdbm_datum_t key) { pa_sdbm_t *db=get_db_for_writing(); check("pa_sdbm_delete", pa_sdbm_delete(db, key)); } void VHashfile::remove(const String& aname) { pa_sdbm_datum_t key; key.dptr=const_cast(aname.cstr()); key.dsize=aname.length(); remove(key); } void VHashfile::for_each(bool callback(pa_sdbm_datum_t, void*), void* info) { pa_sdbm_t *db=get_db_for_reading(); // collect keys Array* keys=0; check("pa_sdbm_lock", pa_sdbm_lock(db, PA_FLOCK_SHARED)); try { pa_sdbm_datum_t key; if(pa_sdbm_firstkey(db, &key)==PA_SUCCESS) { size_t count=0; do { // must cound beforehead, becase doing reallocs later would be VERY slow and cause HUGE fragmentation count++; } while(pa_sdbm_nextkey(db, &key)==PA_SUCCESS); keys=new Array(count); if(pa_sdbm_firstkey(db, &key)==PA_SUCCESS) do { // must clone because it points to page which may go away // [if they modify hashfile inside foreach] key.dptr = pa_strdup(key.dptr, key.dsize); *keys+=key; } while(pa_sdbm_nextkey(db, &key)==PA_SUCCESS); } } catch(...) { check("pa_sdbm_unlock", pa_sdbm_unlock(db)); rethrow; } check("pa_sdbm_unlock", pa_sdbm_unlock(db)); // iterate them if(keys) keys->for_each(callback, info); } #ifndef DOXYGEN struct For_each_string_callback_info { VHashfile* self; void* nested_info; bool (*nested_callback)(const String::Body, const String&, void*); }; #endif static bool for_each_string_callback(pa_sdbm_datum_t apkey, void* ainfo) { For_each_string_callback_info& info=*static_cast(ainfo); pa_sdbm_t *db=info.self->get_db_for_reading(); pa_sdbm_datum_t apvalue; check("pa_sdbm_fetch", pa_sdbm_fetch(db, &apvalue, apkey)); if(const String* svalue=info.self->deserialize_value(apkey, apvalue)) { const char *clkey=pa_strdup(apkey.dptr, apkey.dsize); return info.nested_callback(clkey, *svalue, info.nested_info); } return false; } void VHashfile::for_each(bool callback(const String::Body, const String&, void*), void* ainfo) { For_each_string_callback_info info; info.self=this; info.nested_info=ainfo; info.nested_callback=callback; for_each(for_each_string_callback, &info); } static bool get_hash__put(const String::Body key, const String& value, void* aresult) { static_cast(aresult)->put(key, new VString(value)); return false; } HashStringValue *VHashfile::get_hash() { HashStringValue& result=*new HashStringValue(); for_each(get_hash__put, &result); return &result; } static void delete_file(const char* base_name, const char* ext) { String sfile_name(base_name); sfile_name< (http://paf.design.ru) */ #include "pa_venv.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_version.h" volatile const char * IDENT_PA_PA_VENV_C="$Id: pa_venv.C,v 1.13 2013/03/09 05:39:41 misha Exp $" IDENT_PA_VENV_H; #define PARSER_VERSION_ELEMENT_NAME "PARSER_VERSION" #define ENV_FIELDS_ELEMENT_NAME "fields" static const String parser_version(PARSER_VERSION); Value* VEnv::get_element(const String& aname) { // $env:CLASS if(aname==CLASS_NAME) return this; // $env:CLASS_NAME if(aname==CLASS_NAMETEXT) return new VString(env_class_name); // $env:PARSER_VERSION if(aname==PARSER_VERSION_ELEMENT_NAME) return new VString(parser_version); // $fields if(aname==ENV_FIELDS_ELEMENT_NAME){ HashStringValue *result=new HashStringValue(); if(const char *const *pairs=SAPI::environment(finfo)) { while(const char* pair=*pairs++) if(const char* eq_at=strchr(pair, '=')) if(eq_at[1]) // has value result->put( pa_strdup(pair, eq_at-pair), new VString(*new String(pa_strdup(eq_at+1), String::L_TAINTED))); } return new VHash(*result); } // $env:field if(const char* value=SAPI::get_env(finfo, aname.cstr())){ return new VString(*new String(strdup(value, strlen(value)), String::L_TAINTED)); } return 0; } parser-3.4.3/src/types/pa_vclass.C000644 000000 000000 00000011321 12225074132 017122 0ustar00rootwheel000000 000000 /** @file Parser: @b class parser class impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_vclass.h" #include "pa_vobject.h" volatile const char * IDENT_PA_VCLASS_C="$Id: pa_vclass.C,v 1.49 2013/10/08 21:25:46 moko Exp $" IDENT_PA_VCLASS_H; Property& VClass::get_property(const String& aname) { Property* result=ffields.get(aname); if (result) { if (!result->getter && !result->setter) { // can occur in ^process Value *v=result->value; throw Exception("parser.compile", &aname, "property can not be created, already exists field (%s) with that name", v ? v->get_class()->name_cstr() : "unknown"); } // cloning existing property result=new Property(*result); } else { result=new Property(); } ffields.put(aname, result); return *result; } void VClass::real_set_method(const String& aname, Method* amethod) { if(aname.starts_with("GET_")){ if(aname=="GET_DEFAULT") set_default_getter(amethod); else get_property(aname.mid(4, aname.length())).getter=amethod; } else if(aname.starts_with("SET_")){ if(aname=="SET_DEFAULT") set_default_setter(amethod); else get_property(aname.mid(4, aname.length())).setter=amethod; } else if(aname=="GET"){ set_scalar(amethod); } // NOT under 'else' for backward compatiblilty: // if someone used get_xxx names to name regular methods // still register method: VStateless_class::real_set_method(aname, amethod); } void VClass::set_base(VStateless_class* abase){ VStateless_class::set_base(abase); if(abase) if(HashStringProperty *props=abase->get_properties()) ffields.merge_dont_replace(*props); else throw Exception("parser.compile", 0, "Class %s base class (%s) is not user-defined", name_cstr(), abase->name_cstr()); } Value* VClass::as(const char* atype) { Value* result=Value::as(atype); return result!=0 ? result : fbase ? fbase->as(atype) : 0; } /// VClass: $CLASS, (field/property)=STATIC value;(method)=method_ref with self=object_class Value* VClass::get_element(Value& aself, const String& aname) { // simple things first: $field=static field/property if(Property* prop=ffields.get(aname)) { if(prop->getter) return new VJunction(aself, prop->getter, true /*is_getter*/); if(prop->setter){ if(Value *result=get_default_getter(aself, aname)) return result; throw Exception(PARSER_RUNTIME, 0, "this property has no getter method (@GET_%s[])", aname.cstr()); } // just field, can be 0 as we don't remove return prop->value; } // $CLASS, $method, or other base element if(Value* result=VStateless_class::get_element(aself, aname)) return result; // no field or method found: looking for default getter return get_default_getter(aself, aname); } static void add_field( HashStringProperty::key_type key, HashStringProperty::value_type prop, HashStringValue* result ){ if(prop->value) result->put(key, prop->value); } HashStringValue* VClass::get_hash() { HashStringValue* result=new HashStringValue(); ffields.for_each(add_field, result); return result; } /// VClass: (field/property)=value - static values only const VJunction* VClass::put_element(Value& aself, const String& aname, Value* avalue) { if(Property* prop=ffields.get(aname)) { if (prop->setter) return new VJunction(aself, prop->setter); if(prop->getter){ if(VJunction *result=get_default_setter(aself, aname)) return result; throw Exception(PARSER_RUNTIME, 0, "this property has no setter method (@SET_%s[value])", aname.cstr()); } // just field, value can be 0 and unlike usual we don't remove it prop->value=avalue; return PUT_ELEMENT_REPLACED_ELEMENT; } else { if(VJunction *result=get_default_setter(aself, aname)) return result; prop=new Property(); prop->value=avalue; ffields.put(aname, prop); Array_iterator i(fderived); while(i.has_next()) { HashStringProperty *props=i.next()->get_properties(); if(props) props->put_dont_replace(aname, prop); } } return 0; } /// part of put_element const VJunction* VClass::put_element_replace_only(Value& aself, const String& aname, Value* avalue) { if(Property* prop=ffields.get(aname)) { if (prop->setter) return new VJunction(aself, prop->setter); if(prop->getter){ if(VJunction *result=get_default_setter(aself, aname)) return result; throw Exception(PARSER_RUNTIME, 0, "this property has no setter method (@SET_%s[value])", aname.cstr()); } // just field, value can be 0 and unlike usual we don't remove it prop->value=avalue; return PUT_ELEMENT_REPLACED_ELEMENT; } return 0; } /// @returns object of this class Value* VClass::create_new_value(Pool&) { return new VObject(*this); } parser-3.4.3/src/types/pa_wcontext.C000644 000000 000000 00000001501 11730603304 017500 0ustar00rootwheel000000 000000 /** @file Parser: write context class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_wcontext.h" volatile const char * IDENT_PA_WCONTEXT_C="$Id: pa_wcontext.C,v 1.36 2012/03/16 09:24:20 moko Exp $" IDENT_PA_WCONTEXT_H; // appends a fstring to result void WContext::write(Value& avalue) { if(fvalue) { // already have value? // must not construct twice throw Exception(PARSER_RUNTIME, fvalue->get_class()?&fvalue->get_class()->name():0, "%s may not be overwritten with %s, store it to variable instead", fvalue->type(), avalue.type()); } else fvalue=&avalue; } void WContext::detach_junctions() { Array_iterator i(junctions); while(i.has_next()) i.next()->reattach(fparent); } parser-3.4.3/src/types/pa_property.h000644 000000 000000 00000001442 11730603300 017556 0ustar00rootwheel000000 000000 /** @file Parser: Property class decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_PROPERTY_H #define PA_PROPERTY_H #define IDENT_PA_PROPERTY_H "$Id: pa_property.h,v 1.5 2012/03/16 09:24:16 moko Exp $" class Method; class Value; /** \b junction is getter and setter methods. it is used to cache our knowledge that some element is in fact property and to save us one hash lookup and one name construction (element--get_element/set_leement) */ class Property: public PA_Object { public: Method* getter; Method* setter; Value *value; Property() : getter(0), setter(0), value(0){} Property(Property &prop) : getter(prop.getter), setter(prop.setter), value(prop.value){} }; #endif parser-3.4.3/src/lib/gd/000755 000000 000000 00000000000 12234223575 015050 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/curl/000755 000000 000000 00000000000 12234223575 015423 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/json/000755 000000 000000 00000000000 12234223575 015427 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/Makefile.in000644 000000 000000 00000042730 11766635215 016540 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = gd smtp cord ltdl pcre md5 gc sdbm json memcached curl all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/lib/md5/000755 000000 000000 00000000000 12234223575 015143 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/memcached/000755 000000 000000 00000000000 12234223575 016364 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/Makefile.am000644 000000 000000 00000000101 11744235622 016503 0ustar00rootwheel000000 000000 SUBDIRS = gd smtp cord ltdl pcre md5 gc sdbm json memcached curl parser-3.4.3/src/lib/gc/000755 000000 000000 00000000000 12234223575 015047 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/pcre/000755 000000 000000 00000000000 12234223575 015407 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/cord/000755 000000 000000 00000000000 12234223575 015405 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/sdbm/000755 000000 000000 00000000000 12234223575 015403 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/smtp/000755 000000 000000 00000000000 12234223575 015441 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/ltdl/000755 000000 000000 00000000000 12234223575 015415 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/ltdl/COPYING.LIB000644 000000 000000 00000063656 11764645175 017110 0ustar00rootwheel000000 000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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. ^L 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. ^L 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. ^L 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. ^L 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. ^L 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. ^L 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. ^L 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 ^L 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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! parser-3.4.3/src/lib/ltdl/configure000755 000000 000000 00001530565 11764646175 017357 0ustar00rootwheel000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for libltdl 2.4.2. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: bug-libtool@gnu.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libltdl' PACKAGE_TARNAME='libltdl' PACKAGE_VERSION='2.4.2' PACKAGE_STRING='libltdl 2.4.2' PACKAGE_BUGREPORT='bug-libtool@gnu.org' PACKAGE_URL='' ac_unique_file="ltdl.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LTDLOPEN LT_CONFIG_H CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H LIBOBJS sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_ltdl_install ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libltdl 2.4.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libltdl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libltdl 2.4.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libltdl configure 2.4.2 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libltdl $as_me 2.4.2, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h:config-h.in" ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libltdl' VERSION='2.4.2' 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"} # 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 -' ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='${datadir}'"/${PACKAGE}" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #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 -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= 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 LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ARGZ_H=argz.h; case " $LIBOBJS " in *" argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS argz.$ac_objext" ;; esac fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h case " $LIBOBJS " in *" argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS argz.$ac_objext" ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" lt__dirent.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__dirent.$ac_objext" ;; esac fi done for ac_func in strlcat strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" lt__strl.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__strl.$ac_objext" ;; esac fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" ## -------- ## ## Outputs. ## ## -------- ## ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libltdl $as_me 2.4.2, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libltdl config.status 2.4.2 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_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=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi parser-3.4.3/src/lib/ltdl/lt__dirent.c000644 000000 000000 00000005732 11764645176 017727 0ustar00rootwheel000000 000000 /* lt__dirent.c -- internal directory entry scanning interface Copyright (C) 2001, 2004 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include #include "lt__dirent.h" #if defined(__WINDOWS__) void closedir (DIR *entry) { assert (entry != (DIR *) NULL); FindClose (entry->hSearch); free ((void *) entry); } DIR * opendir (const char *path) { char file_spec[LT_FILENAME_MAX]; DIR *entry; assert (path != (char *) 0); if (lt_strlcpy (file_spec, path, sizeof file_spec) >= sizeof file_spec || lt_strlcat (file_spec, "\\", sizeof file_spec) >= sizeof file_spec) return (DIR *) 0; entry = (DIR *) malloc (sizeof(DIR)); if (entry != (DIR *) 0) { entry->firsttime = TRUE; entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); if (entry->hSearch == INVALID_HANDLE_VALUE) { if (lt_strlcat (file_spec, "\\*.*", sizeof file_spec) < sizeof file_spec) { entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); } if (entry->hSearch == INVALID_HANDLE_VALUE) { entry = (free (entry), (DIR *) 0); } } } return entry; } struct dirent * readdir (DIR *entry) { int status; if (entry == (DIR *) 0) return (struct dirent *) 0; if (!entry->firsttime) { status = FindNextFile (entry->hSearch, &entry->Win32FindData); if (status == 0) return (struct dirent *) 0; } entry->firsttime = FALSE; if (lt_strlcpy (entry->file_info.d_name, entry->Win32FindData.cFileName, sizeof entry->file_info.d_name) >= sizeof entry->file_info.d_name) return (struct dirent *) 0; entry->file_info.d_namlen = strlen (entry->file_info.d_name); return &entry->file_info; } #endif /*defined(__WINDOWS__)*/ parser-3.4.3/src/lib/ltdl/config/000755 000000 000000 00000000000 12234223575 016662 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/ltdl/slist.c000644 000000 000000 00000023164 11764645177 016742 0ustar00rootwheel000000 000000 /* slist.c -- generalised singly linked lists Copyright (C) 2000, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "slist.h" #include #include static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata); /* Call DELETE repeatedly on each element of HEAD. CAVEAT: If you call this when HEAD is the start of a list of boxed items, you must remember that each item passed back to your DELETE function will be a boxed item that must be slist_unbox()ed before operating on its contents. e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); } ... slist = slist_delete (slist, boxed_delete); ... */ SList * slist_delete (SList *head, void (*delete_fct) (void *item)) { assert (delete_fct); while (head) { SList *next = head->next; (*delete_fct) (head); head = next; } return 0; } /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until FIND returns non-NULL, or the list is exhausted. If a match is found the matching item is destructively removed from *PHEAD, and the value returned by the matching call to FIND is returned. CAVEAT: To avoid memory leaks, unless you already have the address of the stale item, you should probably return that from FIND if it makes a successful match. Don't forget to slist_unbox() every item in a boxed list before operating on its contents. */ SList * slist_remove (SList **phead, SListCallback *find, void *matchdata) { SList *stale = 0; void *result = 0; assert (find); if (!phead || !*phead) return 0; /* Does the head of the passed list match? */ result = (*find) (*phead, matchdata); if (result) { stale = *phead; *phead = stale->next; } /* what about the rest of the elements? */ else { SList *head; for (head = *phead; head->next; head = head->next) { result = (*find) (head->next, matchdata); if (result) { stale = head->next; head->next = stale->next; break; } } } return (SList *) result; } /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until FIND returns non-NULL, or the list is exhausted. If a match is found the value returned by the matching call to FIND is returned. */ void * slist_find (SList *slist, SListCallback *find, void *matchdata) { void *result = 0; assert (find); for (; slist; slist = slist->next) { result = (*find) (slist, matchdata); if (result) break; } return result; } /* Return a single list, composed by destructively concatenating the items in HEAD and TAIL. The values of HEAD and TAIL are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_concat (slist1, slist2); */ SList * slist_concat (SList *head, SList *tail) { SList *last; if (!head) { return tail; } last = head; while (last->next) last = last->next; last->next = tail; return head; } /* Return a single list, composed by destructively appending all of the items in SLIST to ITEM. The values of ITEM and SLIST are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_cons (slist_box (data), slist1); */ SList * slist_cons (SList *item, SList *slist) { if (!item) { return slist; } assert (!item->next); item->next = slist; return item; } /* Return a list starting at the second item of SLIST. */ SList * slist_tail (SList *slist) { return slist ? slist->next : NULL; } /* Return a list starting at the Nth item of SLIST. If SLIST is less than N items long, NULL is returned. Just to be confusing, list items are counted from 1, to get the 2nd element of slist: e.g. shared_list = slist_nth (slist, 2); */ SList * slist_nth (SList *slist, size_t n) { for (;n > 1 && slist; n--) slist = slist->next; return slist; } /* Return the number of items in SLIST. We start counting from 1, so the length of a list with no items is 0, and so on. */ size_t slist_length (SList *slist) { size_t n; for (n = 0; slist; ++n) slist = slist->next; return n; } /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */ SList * slist_reverse (SList *slist) { SList *result = 0; SList *next; while (slist) { next = slist->next; slist->next = result; result = slist; slist = next; } return result; } /* Call FOREACH once for each item in SLIST, passing both the item and USERDATA on each call. */ void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata) { void *result = 0; assert (foreach); while (slist) { SList *next = slist->next; result = (*foreach) (slist, userdata); if (result) break; slist = next; } return result; } /* Destructively merge the items of two ordered lists LEFT and RIGHT, returning a single sorted list containing the items of both -- Part of the quicksort algorithm. The values of LEFT and RIGHT are undefined after calling this function. At each iteration, add another item to the merged list by taking the lowest valued item from the head of either LEFT or RIGHT, determined by passing those items and USERDATA to COMPARE. COMPARE should return less than 0 if the head of LEFT has the lower value, greater than 0 if the head of RIGHT has the lower value, otherwise 0. */ static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata) { SList merged, *insert; insert = &merged; while (left && right) { if ((*compare) (left, right, userdata) <= 0) { insert = insert->next = left; left = left->next; } else { insert = insert->next = right; right = right->next; } } insert->next = left ? left : right; return merged.next; } /* Perform a destructive quicksort on the items in SLIST, by repeatedly calling COMPARE with a pair of items from SLIST along with USERDATA at every iteration. COMPARE is a function as defined above for slist_sort_merge(). The value of SLIST is undefined after calling this function. e.g. slist = slist_sort (slist, compare, 0); */ SList * slist_sort (SList *slist, SListCompare *compare, void *userdata) { SList *left, *right; if (!slist) return slist; /* Be sure that LEFT and RIGHT never contain the same item. */ left = slist; right = slist->next; if (!right) return left; /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off the end. SLIST must be about half way along. */ while (right && (right = right->next)) { if (!right || !(right = right->next)) break; slist = slist->next; } right = slist->next; slist->next = 0; /* Sort LEFT and RIGHT, then merge the two. */ return slist_sort_merge (slist_sort (left, compare, userdata), slist_sort (right, compare, userdata), compare, userdata); } /* Aside from using the functions above to manage chained structures of any type that has a NEXT pointer as its first field, SLISTs can be comprised of boxed items. The boxes are chained together in that case, so there is no need for a NEXT field in the item proper. Some care must be taken to slist_box and slist_unbox each item in a boxed list at the appropriate points to avoid leaking the memory used for the boxes. It us usually a very bad idea to mix boxed and non-boxed items in a single list. */ /* Return a `boxed' freshly mallocated 1 element list containing USERDATA. */ SList * slist_box (const void *userdata) { SList *item = (SList *) malloc (sizeof *item); if (item) { item->next = 0; item->userdata = userdata; } return item; } /* Return the contents of a `boxed' ITEM, recycling the box itself. */ void * slist_unbox (SList *item) { void *userdata = 0; if (item) { /* Strip the const, because responsibility for this memory passes to the caller on return. */ userdata = (void *) item->userdata; free (item); } return userdata; } parser-3.4.3/src/lib/ltdl/Makefile.in000644 000000 000000 00000143145 11764743276 017506 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ##### VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_LTDL_TRUE@am__append_1 = ltdl.h @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la subdir = . DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \ $(am__ltdlinclude_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config-h.in \ $(top_srcdir)/configure COPYING.LIB argz.c config/compile \ config/config.guess config/config.sub config/depcomp \ config/install-sh config/ltmain.sh \ config/missing lt__dirent.c lt__strl.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(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 config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(ltdlincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) dld_link_la_DEPENDENCIES = am_dld_link_la_OBJECTS = dld_link.lo dld_link_la_OBJECTS = $(am_dld_link_la_OBJECTS) dld_link_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dld_link_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = dlopen_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dlopen_la_OBJECTS = dlopen.lo dlopen_la_OBJECTS = $(am_dlopen_la_OBJECTS) dlopen_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dlopen_la_LDFLAGS) $(LDFLAGS) -o $@ dyld_la_LIBADD = am_dyld_la_OBJECTS = dyld.lo dyld_la_OBJECTS = $(am_dyld_la_OBJECTS) dyld_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(dyld_la_LDFLAGS) \ $(LDFLAGS) -o $@ am_libltdl_la_OBJECTS = libltdl_la-preopen.lo libltdl_la-lt__alloc.lo \ libltdl_la-lt_dlloader.lo libltdl_la-lt_error.lo \ libltdl_la-ltdl.lo libltdl_la-slist.lo libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) libltdl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdl_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) am__objects_1 = libltdlc_la-preopen.lo libltdlc_la-lt__alloc.lo \ libltdlc_la-lt_dlloader.lo libltdlc_la-lt_error.lo \ libltdlc_la-ltdl.lo libltdlc_la-slist.lo am_libltdlc_la_OBJECTS = $(am__objects_1) libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) libltdlc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdlc_la_LDFLAGS) $(LDFLAGS) -o $@ @CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = load_add_on_la_LIBADD = am_load_add_on_la_OBJECTS = load_add_on.lo load_add_on_la_OBJECTS = $(am_load_add_on_la_OBJECTS) load_add_on_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(load_add_on_la_LDFLAGS) $(LDFLAGS) -o $@ loadlibrary_la_LIBADD = am_loadlibrary_la_OBJECTS = loadlibrary.lo loadlibrary_la_OBJECTS = $(am_loadlibrary_la_OBJECTS) loadlibrary_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(loadlibrary_la_LDFLAGS) $(LDFLAGS) -o $@ shl_load_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_shl_load_la_OBJECTS = shl_load.lo shl_load_la_OBJECTS = $(am_shl_load_la_OBJECTS) shl_load_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(shl_load_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) DIST_SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) am__include_HEADERS_DIST = ltdl.h am__ltdlinclude_HEADERS_DIST = libltdl/lt_system.h libltdl/lt_error.h \ libltdl/lt_dlloader.h HEADERS = $(include_HEADERS) $(ltdlinclude_HEADERS) ETAGS = etags CTAGS = ctags 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 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS = -DLT_CONFIG_H='<$(LT_CONFIG_H)>' -DLTDL -I. -I$(srcdir) \ -Ilibltdl -I$(srcdir)/libltdl -I$(srcdir)/libltdl AM_LDFLAGS = -no-undefined BUILT_SOURCES = $(ARGZ_H) include_HEADERS = $(am__append_1) noinst_LTLIBRARIES = $(LT_DLLOADERS) $(am__append_3) lib_LTLIBRARIES = $(am__append_2) EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ loadlibrary.la shl_load.la EXTRA_DIST = lt__dirent.c lt__strl.c COPYING.LIB configure.ac \ Makefile.am aclocal.m4 Makefile.in configure config-h.in \ README argz_.h argz.c CLEANFILES = libltdl.la libltdlc.la libdlloader.la $(LIBOBJS) \ $(LTLIBOBJS) MOSTLYCLEANFILES = argz.h argz.h-t LTDL_VERSION_INFO = -version-info 10:0:3 @INSTALL_LTDL_TRUE@ltdlincludedir = $(includedir)/libltdl @INSTALL_LTDL_TRUE@ltdlinclude_HEADERS = libltdl/lt_system.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_error.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_dlloader.h libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES = $(libltdl_la_DEPENDENCIES) dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj 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) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .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) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) 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) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done dld_link.la: $(dld_link_la_OBJECTS) $(dld_link_la_DEPENDENCIES) $(dld_link_la_LINK) $(dld_link_la_OBJECTS) $(dld_link_la_LIBADD) $(LIBS) dlopen.la: $(dlopen_la_OBJECTS) $(dlopen_la_DEPENDENCIES) $(dlopen_la_LINK) $(dlopen_la_OBJECTS) $(dlopen_la_LIBADD) $(LIBS) dyld.la: $(dyld_la_OBJECTS) $(dyld_la_DEPENDENCIES) $(dyld_la_LINK) $(dyld_la_OBJECTS) $(dyld_la_LIBADD) $(LIBS) libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(libltdlc_la_LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) load_add_on.la: $(load_add_on_la_OBJECTS) $(load_add_on_la_DEPENDENCIES) $(load_add_on_la_LINK) $(load_add_on_la_OBJECTS) $(load_add_on_la_LIBADD) $(LIBS) loadlibrary.la: $(loadlibrary_la_OBJECTS) $(loadlibrary_la_DEPENDENCIES) $(loadlibrary_la_LINK) $(loadlibrary_la_OBJECTS) $(loadlibrary_la_LIBADD) $(LIBS) shl_load.la: $(shl_load_la_OBJECTS) $(shl_load_la_DEPENDENCIES) $(shl_load_la_LINK) $(shl_load_la_OBJECTS) $(shl_load_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/argz.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__dirent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__strl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dld_link.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyld.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_add_on.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadlibrary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shl_load.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< dld_link.lo: loaders/dld_link.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dld_link.lo -MD -MP -MF $(DEPDIR)/dld_link.Tpo -c -o dld_link.lo `test -f 'loaders/dld_link.c' || echo '$(srcdir)/'`loaders/dld_link.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dld_link.Tpo $(DEPDIR)/dld_link.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dld_link.c' object='dld_link.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dld_link.lo `test -f 'loaders/dld_link.c' || echo '$(srcdir)/'`loaders/dld_link.c dlopen.lo: loaders/dlopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dlopen.lo -MD -MP -MF $(DEPDIR)/dlopen.Tpo -c -o dlopen.lo `test -f 'loaders/dlopen.c' || echo '$(srcdir)/'`loaders/dlopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dlopen.Tpo $(DEPDIR)/dlopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dlopen.c' object='dlopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dlopen.lo `test -f 'loaders/dlopen.c' || echo '$(srcdir)/'`loaders/dlopen.c dyld.lo: loaders/dyld.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dyld.lo -MD -MP -MF $(DEPDIR)/dyld.Tpo -c -o dyld.lo `test -f 'loaders/dyld.c' || echo '$(srcdir)/'`loaders/dyld.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dyld.Tpo $(DEPDIR)/dyld.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dyld.c' object='dyld.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dyld.lo `test -f 'loaders/dyld.c' || echo '$(srcdir)/'`loaders/dyld.c libltdl_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-preopen.lo -MD -MP -MF $(DEPDIR)/libltdl_la-preopen.Tpo -c -o libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-preopen.Tpo $(DEPDIR)/libltdl_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/preopen.c' object='libltdl_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdl_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt__alloc.Tpo -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt__alloc.Tpo $(DEPDIR)/libltdl_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt__alloc.c' object='libltdl_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdl_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_dlloader.Tpo -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt_dlloader.Tpo $(DEPDIR)/libltdl_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_dlloader.c' object='libltdl_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdl_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_error.Tpo -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt_error.Tpo $(DEPDIR)/libltdl_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_error.c' object='libltdl_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdl_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdl_la-ltdl.Tpo -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-ltdl.Tpo $(DEPDIR)/libltdl_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltdl.c' object='libltdl_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdl_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdl_la-slist.Tpo -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-slist.Tpo $(DEPDIR)/libltdl_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slist.c' object='libltdl_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c libltdlc_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-preopen.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-preopen.Tpo -c -o libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-preopen.Tpo $(DEPDIR)/libltdlc_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/preopen.c' object='libltdlc_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdlc_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt__alloc.Tpo -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt__alloc.Tpo $(DEPDIR)/libltdlc_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt__alloc.c' object='libltdlc_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdlc_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo $(DEPDIR)/libltdlc_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_dlloader.c' object='libltdlc_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdlc_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_error.Tpo -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt_error.Tpo $(DEPDIR)/libltdlc_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_error.c' object='libltdlc_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdlc_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-ltdl.Tpo -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-ltdl.Tpo $(DEPDIR)/libltdlc_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltdl.c' object='libltdlc_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdlc_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-slist.Tpo -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-slist.Tpo $(DEPDIR)/libltdlc_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slist.c' object='libltdlc_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c load_add_on.lo: loaders/load_add_on.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT load_add_on.lo -MD -MP -MF $(DEPDIR)/load_add_on.Tpo -c -o load_add_on.lo `test -f 'loaders/load_add_on.c' || echo '$(srcdir)/'`loaders/load_add_on.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/load_add_on.Tpo $(DEPDIR)/load_add_on.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/load_add_on.c' object='load_add_on.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o load_add_on.lo `test -f 'loaders/load_add_on.c' || echo '$(srcdir)/'`loaders/load_add_on.c loadlibrary.lo: loaders/loadlibrary.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loadlibrary.lo -MD -MP -MF $(DEPDIR)/loadlibrary.Tpo -c -o loadlibrary.lo `test -f 'loaders/loadlibrary.c' || echo '$(srcdir)/'`loaders/loadlibrary.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/loadlibrary.Tpo $(DEPDIR)/loadlibrary.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/loadlibrary.c' object='loadlibrary.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loadlibrary.lo `test -f 'loaders/loadlibrary.c' || echo '$(srcdir)/'`loaders/loadlibrary.c shl_load.lo: loaders/shl_load.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shl_load.lo -MD -MP -MF $(DEPDIR)/shl_load.Tpo -c -o shl_load.lo `test -f 'loaders/shl_load.c' || echo '$(srcdir)/'`loaders/shl_load.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/shl_load.Tpo $(DEPDIR)/shl_load.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/shl_load.c' object='shl_load.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shl_load.lo `test -f 'loaders/shl_load.c' || echo '$(srcdir)/'`loaders/shl_load.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files install-ltdlincludeHEADERS: $(ltdlinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(ltdlincludedir)" || $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)" @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ltdlincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ltdlincludedir)" || exit $$?; \ done uninstall-ltdlincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ltdlincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ltdlincludedir)" && rm -f $$files 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | 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-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(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 $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(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) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../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 \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(ltdlincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-ltdlincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-ltdlincludeHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES ctags dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-includeHEADERS \ install-info install-info-am install-libLTLIBRARIES \ install-ltdlincludeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-ltdlincludeHEADERS # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(ARGZ_H) argz.h: argz_.h $(mkinstalldirs) . cp $(srcdir)/argz_.h $@-t mv $@-t $@ # 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: parser-3.4.3/src/lib/ltdl/README000644 000000 000000 00000001260 11764645175 016307 0ustar00rootwheel000000 000000 This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. It supports the following dlopen interfaces: * dlopen (POSIX) * shl_load (HP-UX) * LoadLibrary (Win16 and Win32) * load_add_on (BeOS) * GNU DLD (emulates dynamic linking for static libraries) * dyld (darwin/Mac OS X) * libtool's dlpreopen -- Copyright (C) 1999, 2003, 2011 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 This file is part of GNU Libtool. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. parser-3.4.3/src/lib/ltdl/lt__alloc.c000644 000000 000000 00000004355 11764645176 017534 0ustar00rootwheel000000 000000 /* lt__alloc.c -- internal memory management interface Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__alloc.h" static void alloc_die_default (void); void (*lt__alloc_die) (void) = alloc_die_default; /* Unless overridden, exit on memory failure. */ static void alloc_die_default (void) { fprintf (stderr, "Out of memory.\n"); exit (EXIT_FAILURE); } void * lt__malloc (size_t n) { void *mem; if (! (mem = malloc (n))) (*lt__alloc_die) (); return mem; } void * lt__zalloc (size_t n) { void *mem; if ((mem = lt__malloc (n))) memset (mem, 0, n); return mem; } void * lt__realloc (void *mem, size_t n) { if (! (mem = realloc (mem, n))) (*lt__alloc_die) (); return mem; } void * lt__memdup (void const *mem, size_t n) { void *newmem; if ((newmem = lt__malloc (n))) return memcpy (newmem, mem, n); return 0; } char * lt__strdup (const char *string) { return (char *) lt__memdup (string, strlen (string) +1); } parser-3.4.3/src/lib/ltdl/libltdl/000755 000000 000000 00000000000 12234223575 017043 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/ltdl/Makefile.am000644 000000 000000 00000012100 11764646175 017457 0ustar00rootwheel000000 000000 ## Makefile.am -- Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ## Written by Gary V. Vaughan, 2003 ## ## NOTE: The canonical source of this file is maintained with the ## GNU Libtool package. Report bugs to bug-libtool@gnu.org. ## ## GNU Libltdl 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 of the License, or (at your option) any later version. ## ## As a special exception to the GNU Lesser General Public License, ## if you distribute this file as part of a program or library that ## is built using GNU libtool, you may include this file under the ## same distribution terms that you use for the rest of that program. ## ## GNU Libltdl 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 LesserGeneral Public ## License along with GNU Libltdl; see the file COPYING.LIB. If not, a ## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, ## or obtained by writing to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ##### ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = AM_LDFLAGS = BUILT_SOURCES = include_HEADERS = noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \ -DLTDL -I. -I$(srcdir) -Ilibltdl \ -I$(srcdir)/libltdl -I$(srcdir)/libltdl AM_LDFLAGS += -no-undefined LTDL_VERSION_INFO = -version-info 10:0:3 noinst_LTLIBRARIES += $(LT_DLLOADERS) if INSTALL_LTDL ltdlincludedir = $(includedir)/libltdl ltdlinclude_HEADERS = libltdl/lt_system.h \ libltdl/lt_error.h \ libltdl/lt_dlloader.h include_HEADERS += ltdl.h lib_LTLIBRARIES += libltdl.la endif if CONVENIENCE_LTDL noinst_LTLIBRARIES += libltdlc.la endif libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c EXTRA_DIST += lt__dirent.c \ lt__strl.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES= $(libltdl_la_DEPENDENCIES) ## The loaders are preopened by libltdl, itself always built from ## pic-objects (either as a shared library, or a convenience library), ## so the loaders themselves must be made from pic-objects too. We ## use convenience libraries for that purpose: EXTRA_LTLIBRARIES += dlopen.la \ dld_link.la \ dyld.la \ load_add_on.la \ loadlibrary.la \ shl_load.la dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) ## Make sure these will be cleaned even when they're not built by default: CLEANFILES += libltdl.la \ libltdlc.la \ libdlloader.la ## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects ## automatically: CLEANFILES += $(LIBOBJS) $(LTLIBOBJS) EXTRA_DIST += COPYING.LIB \ configure.ac \ Makefile.am \ aclocal.m4 \ Makefile.in \ configure \ config-h.in \ README ## --------------------------- ## ## Gnulib Makefile.am snippets ## ## --------------------------- ## BUILT_SOURCES += $(ARGZ_H) EXTRA_DIST += argz_.h \ argz.c # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(ARGZ_H) argz.h: argz_.h $(mkinstalldirs) . cp $(srcdir)/argz_.h $@-t mv $@-t $@ MOSTLYCLEANFILES += argz.h \ argz.h-t parser-3.4.3/src/lib/ltdl/lt_dlloader.c000644 000000 000000 00000013674 11764645177 020076 0ustar00rootwheel000000 000000 /* lt_dlloader.c -- dynamic library loader interface Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #define RETURN_SUCCESS 0 #define RETURN_FAILURE 1 static void * loader_callback (SList *item, void *userdata); /* A list of all the dlloaders we know about, each stored as a boxed SList item: */ static SList *loaders = 0; /* Return NULL, unless the loader in this ITEM has a matching name, in which case we return the matching item so that its address is passed back out (for possible freeing) by slist_remove. */ static void * loader_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; const char * name = (const char *) userdata; assert (vtable); return streq (vtable->name, name) ? (void *) item : NULL; } /* Hook VTABLE into our global LOADERS list according to its own PRIORITY field value. */ int lt_dlloader_add (const lt_dlvtable *vtable) { SList *item; if ((vtable == 0) /* diagnose invalid vtable fields */ || (vtable->module_open == 0) || (vtable->module_close == 0) || (vtable->find_sym == 0) || ((vtable->priority != LT_DLLOADER_PREPEND) && (vtable->priority != LT_DLLOADER_APPEND))) { LT__SETERROR (INVALID_LOADER); return RETURN_FAILURE; } item = slist_box (vtable); if (!item) { (*lt__alloc_die) (); /* Let the caller know something went wrong if lt__alloc_die doesn't abort. */ return RETURN_FAILURE; } if (vtable->priority == LT_DLLOADER_PREPEND) { loaders = slist_cons (item, loaders); } else { assert (vtable->priority == LT_DLLOADER_APPEND); loaders = slist_concat (loaders, item); } return RETURN_SUCCESS; } #ifdef LT_DEBUG_LOADERS static void * loader_dump_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; fprintf (stderr, ", %s", (vtable && vtable->name) ? vtable->name : "(null)"); return 0; } void lt_dlloader_dump (void) { fprintf (stderr, "loaders: "); if (!loaders) { fprintf (stderr, "(empty)"); } else { const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata; fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)"); if (slist_tail (loaders)) slist_foreach (slist_tail (loaders), loader_dump_callback, NULL); } fprintf (stderr, "\n"); } #endif /* An iterator for the global loader list: if LOADER is NULL, then return the first element, otherwise the following element. */ lt_dlloader lt_dlloader_next (lt_dlloader loader) { SList *item = (SList *) loader; return (lt_dlloader) (item ? item->next : loaders); } /* Non-destructive unboxing of a loader. */ const lt_dlvtable * lt_dlloader_get (lt_dlloader loader) { return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL); } /* Return the contents of the first item in the global loader list with a matching NAME after removing it from that list. If there was no match, return NULL; if there is an error, return NULL and set an error for lt_dlerror; do not set an error if only resident modules need this loader; in either case, the loader list is not changed if NULL is returned. */ lt_dlvtable * lt_dlloader_remove (const char *name) { const lt_dlvtable * vtable = lt_dlloader_find (name); static const char id_string[] = "lt_dlloader_remove"; lt_dlinterface_id iface; lt_dlhandle handle = 0; int in_use = 0; int in_use_by_resident = 0; if (!vtable) { LT__SETERROR (INVALID_LOADER); return 0; } /* Fail if there are any open modules which use this loader. */ iface = lt_dlinterface_register (id_string, NULL); while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur->vtable == vtable) { in_use = 1; if (lt_dlisresident (handle)) in_use_by_resident = 1; } } lt_dlinterface_free (iface); if (in_use) { if (!in_use_by_resident) LT__SETERROR (REMOVE_LOADER); return 0; } /* Call the loader finalisation function. */ if (vtable && vtable->dlloader_exit) { if ((*vtable->dlloader_exit) (vtable->dlloader_data) != 0) { /* If there is an exit function, and it returns non-zero then it must set an error, and we will not remove it from the list. */ return 0; } } /* If we got this far, remove the loader from our global list. */ return (lt_dlvtable *) slist_unbox ((SList *) slist_remove (&loaders, loader_callback, (void *) name)); } const lt_dlvtable * lt_dlloader_find (const char *name) { return lt_dlloader_get (slist_find (loaders, loader_callback, (void *) name)); } parser-3.4.3/src/lib/ltdl/loaders/000755 000000 000000 00000000000 12234223575 017046 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/ltdl/ltdl.c000644 000000 000000 00000154004 11770443336 016527 0ustar00rootwheel000000 000000 /* ltdl.c -- system independent dlopen wrapper Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_system.h" #include "lt_dlloader.h" /* --- MANIFEST CONSTANTS --- */ #undef HAVE_LIBDLLOADER /* Standard libltdl search path environment variable name */ #undef LTDL_SEARCHPATH_VAR #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" /* Standard libtool archive file extension. */ #undef LT_ARCHIVE_EXT #define LT_ARCHIVE_EXT ".la" /* max. filename length */ #if !defined(LT_FILENAME_MAX) # define LT_FILENAME_MAX 1024 #endif #if !defined(LT_LIBEXT) # define LT_LIBEXT "a" #endif #if !defined(LT_LIBPREFIX) # define LT_LIBPREFIX "lib" #endif /* This is the maximum symbol size that won't require malloc/free */ #undef LT_SYMBOL_LENGTH #define LT_SYMBOL_LENGTH 128 /* This accounts for the _LTX_ separator */ #undef LT_SYMBOL_OVERHEAD #define LT_SYMBOL_OVERHEAD 5 /* Various boolean flags can be stored in the flags field of an lt_dlhandle... */ #define LT_DLIS_RESIDENT(handle) ((handle)->info.is_resident) #define LT_DLIS_SYMGLOBAL(handle) ((handle)->info.is_symglobal) #define LT_DLIS_SYMLOCAL(handle) ((handle)->info.is_symlocal) static const char objdir[] = LT_OBJDIR; static const char archive_ext[] = LT_ARCHIVE_EXT; static const char libext[] = LT_LIBEXT; static const char libprefix[] = LT_LIBPREFIX; #if defined(LT_MODULE_EXT) static const char shlib_ext[] = LT_MODULE_EXT; #endif /* If the loadable module suffix is not the same as the linkable * shared library suffix, this will be defined. */ #if defined(LT_SHARED_EXT) static const char shared_ext[] = LT_SHARED_EXT; #endif #if defined(LT_DLSEARCH_PATH) static const char sys_dlsearch_path[] = LT_DLSEARCH_PATH; #endif /* --- DYNAMIC MODULE LOADING --- */ /* The type of a function used at each iteration of foreach_dirinpath(). */ typedef int foreach_callback_func (char *filename, void *data1, void *data2); /* foreachfile_callback itself calls a function of this type: */ typedef int file_worker_func (const char *filename, void *data); static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2); static int find_file_callback (char *filename, void *data1, void *data2); static int find_handle_callback (char *filename, void *data, void *ignored); static int foreachfile_callback (char *filename, void *data1, void *data2); static int canonicalize_path (const char *path, char **pcanonical); static int argzize_path (const char *path, char **pargz, size_t *pargz_len); static FILE *find_file (const char *search_path, const char *base_name, char **pdir); static lt_dlhandle *find_handle (const char *search_path, const char *base_name, lt_dlhandle *handle, lt_dladvise advise); static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise); static int has_library_ext (const char *filename); static int load_deplibs (lt_dlhandle handle, char *deplibs); static int trim (char **dest, const char *str); static int try_dlopen (lt_dlhandle *handle, const char *filename, const char *ext, lt_dladvise advise); static int tryall_dlopen (lt_dlhandle *handle, const char *filename, lt_dladvise padvise, const lt_dlvtable *vtable); static int unload_deplibs (lt_dlhandle handle); static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry); static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp); static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir); static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len); static int file_not_found (void); #ifdef HAVE_LIBDLLOADER static int loader_init_callback (lt_dlhandle handle); #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data); static char *user_search_path= 0; static lt_dlhandle handles = 0; static int initialized = 0; /* Our memory failure callback sets the error message to be passed back up to the client, so we must be careful to return from mallocation callers if allocation fails (as this callback returns!!). */ void lt__alloc_die_callback (void) { LT__SETERROR (NO_MEMORY); } #ifdef HAVE_LIBDLLOADER /* This function is called to initialise each preloaded module loader, and hook it into the list of loaders to be used when attempting to dlopen an application module. */ static int loader_init_callback (lt_dlhandle handle) { lt_get_vtable *vtable_func = (lt_get_vtable *) lt_dlsym (handle, "get_vtable"); return loader_init (vtable_func, 0); } #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data) { const lt_dlvtable *vtable = 0; int errors = 0; if (vtable_func) { vtable = (*vtable_func) (data); } /* lt_dlloader_add will LT__SETERROR if it fails. */ errors += lt_dlloader_add (vtable); assert (errors || vtable); if ((!errors) && vtable->dlloader_init) { if ((*vtable->dlloader_init) (vtable->dlloader_data)) { LT__SETERROR (INIT_LOADER); ++errors; } } return errors; } /* preopening loader is buggy under FreeBSD and not supported under MSVC, thus using preconfigured loader. */ #if defined(__CYGWIN__) || defined(__WINDOWS__) #define get_vtable loadlibrary_LTX_get_vtable #else #define get_vtable dlopen_LTX_get_vtable #endif LT_BEGIN_C_DECLS LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data); LT_END_C_DECLS #ifdef HAVE_LIBDLLOADER #define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols) extern LT_DLSYM_CONST lt_dlsymlist preloaded_symbols[]; #endif /* Initialize libltdl. */ int lt_dlinit (void) { int errors = 0; /* Initialize only at first call. */ if (++initialized == 1) { lt__alloc_die = lt__alloc_die_callback; handles = 0; user_search_path = 0; /* empty search path */ /* Loading the only supported loader */ errors += loader_init (get_vtable, 0); /* Now open all the preloaded module loaders, so the application can use _them_ to lt_dlopen its own modules. */ #ifdef HAVE_LIBDLLOADER if (!errors) { errors += lt_dlpreload (preloaded_symbols); } if (!errors) { errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback); } #endif /* HAVE_LIBDLLOADER */ } #ifdef LT_DEBUG_LOADERS lt_dlloader_dump(); #endif return errors; } int lt_dlexit (void) { /* shut down libltdl */ lt_dlloader *loader = 0; lt_dlhandle handle = handles; int errors = 0; if (!initialized) { LT__SETERROR (SHUTDOWN); ++errors; goto done; } /* shut down only at last call. */ if (--initialized == 0) { int level; while (handles && LT_DLIS_RESIDENT (handles)) { handles = handles->next; } /* close all modules */ for (level = 1; handle; ++level) { lt_dlhandle cur = handles; int saw_nonresident = 0; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) { saw_nonresident = 1; if (tmp->info.ref_count <= level) { if (lt_dlclose (tmp)) { ++errors; } /* Make sure that the handle pointed to by 'cur' still exists. lt_dlclose recursively closes dependent libraries which removes them from the linked list. One of these might be the one pointed to by 'cur'. */ if (cur) { for (tmp = handles; tmp; tmp = tmp->next) if (tmp == cur) break; if (! tmp) cur = handles; } } } } /* done if only resident modules are left */ if (!saw_nonresident) break; } /* When removing loaders, we can only find out failure by testing the error string, so avoid a spurious one from an earlier failed command. */ if (!errors) LT__SETERRORSTR (0); /* close all loaders */ for (loader = (lt_dlloader *) lt_dlloader_next (NULL); loader;) { lt_dlloader *next = (lt_dlloader *) lt_dlloader_next (loader); lt_dlvtable *vtable = (lt_dlvtable *) lt_dlloader_get (loader); if ((vtable = lt_dlloader_remove ((char *) vtable->name))) { FREE (vtable); } else { /* ignore errors due to resident modules */ const char *err; LT__GETERROR (err); if (err) ++errors; } loader = next; } FREE(user_search_path); } done: return errors; } /* Try VTABLE or, if VTABLE is NULL, all available loaders for FILENAME. If the library is not successfully loaded, return non-zero. Otherwise, the dlhandle is stored at the address given in PHANDLE. */ static int tryall_dlopen (lt_dlhandle *phandle, const char *filename, lt_dladvise advise, const lt_dlvtable *vtable) { lt_dlhandle handle = handles; const char * saved_error = 0; int errors = 0; #ifdef LT_DEBUG_LOADERS fprintf (stderr, "tryall_dlopen (%s, %s)\n", filename ? filename : "(null)", vtable ? vtable->name : "(ALL)"); #endif LT__GETERROR (saved_error); /* check whether the module was already opened */ for (;handle; handle = handle->next) { if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */ || (handle->info.filename && filename && streq (handle->info.filename, filename))) { break; } } if (handle) { ++handle->info.ref_count; *phandle = handle; goto done; } handle = *phandle; if (filename) { /* Comment out the check of file permissions using access. This call seems to always return -1 with error EACCES. */ /* We need to catch missing file errors early so that file_not_found() can detect what happened. if (access (filename, R_OK) != 0) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto done; } */ handle->info.filename = lt__strdup (filename); if (!handle->info.filename) { ++errors; goto done; } } else { handle->info.filename = 0; } { lt_dlloader loader = lt_dlloader_next (0); const lt_dlvtable *loader_vtable; do { if (vtable) loader_vtable = vtable; else loader_vtable = lt_dlloader_get (loader); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "Calling %s->module_open (%s)\n", (loader_vtable && loader_vtable->name) ? loader_vtable->name : "(null)", filename ? filename : "(null)"); #endif handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data, filename, advise); #ifdef LT_DEBUG_LOADERS fprintf (stderr, " Result: %s\n", handle->module ? "Success" : "Failed"); #endif if (handle->module != 0) { if (advise) { handle->info.is_resident = advise->is_resident; handle->info.is_symglobal = advise->is_symglobal; handle->info.is_symlocal = advise->is_symlocal; } break; } } while (!vtable && (loader = lt_dlloader_next (loader))); /* If VTABLE was given but couldn't open the module, or VTABLE wasn't given but we exhausted all loaders without opening the module, bail out! */ if ((vtable && !handle->module) || (!vtable && !loader)) { FREE (handle->info.filename); ++errors; goto done; } handle->vtable = loader_vtable; } LT__SETERRORSTR (saved_error); done: return errors; } static int tryall_dlopen_module (lt_dlhandle *handle, const char *prefix, const char *dirname, const char *dlname, lt_dladvise advise) { int error = 0; char *filename = 0; size_t filename_len = 0; size_t dirname_len = LT_STRLEN (dirname); assert (handle); assert (dirname); assert (dlname); #if defined(LT_DIRSEP_CHAR) /* Only canonicalized names (i.e. with DIRSEP chars already converted) should make it into this function: */ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); #endif if (dirname_len > 0) if (dirname[dirname_len -1] == '/') --dirname_len; filename_len = dirname_len + 1 + LT_STRLEN (dlname); /* Allocate memory, and combine DIRNAME and MODULENAME into it. The PREFIX (if any) is handled below. */ filename = MALLOC (char, filename_len + 1); if (!filename) return 1; sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments shuffled. Otherwise, attempt to open FILENAME as a module. */ if (prefix) { error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename, advise); } else if (tryall_dlopen (handle, filename, advise, 0) != 0) { ++error; } FREE (filename); return error; } static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise) { /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ if (old_name && tryall_dlopen (handle, old_name, advise, lt_dlloader_find ("lt_preopen") ) == 0) { return 0; } /* Try to open the dynamic library. */ if (dlname) { /* try to open the installed module */ if (installed && libdir) { if (tryall_dlopen_module (handle, (const char *) 0, libdir, dlname, advise) == 0) return 0; } /* try to open the not-installed module */ if (!installed) { if (tryall_dlopen_module (handle, dir, objdir, dlname, advise) == 0) return 0; } /* maybe it was moved to another directory */ { if (dir && (tryall_dlopen_module (handle, (const char *) 0, dir, dlname, advise) == 0)) return 0; } } return 1; } static int canonicalize_path (const char *path, char **pcanonical) { char *canonical = 0; assert (path && *path); assert (pcanonical); canonical = MALLOC (char, 1+ LT_STRLEN (path)); if (!canonical) return 1; { size_t dest = 0; size_t src; for (src = 0; path[src] != LT_EOS_CHAR; ++src) { /* Path separators are not copied to the beginning or end of the destination, or if another separator would follow immediately. */ if (path[src] == LT_PATHSEP_CHAR) { if ((dest == 0) || (path[1+ src] == LT_PATHSEP_CHAR) || (path[1+ src] == LT_EOS_CHAR)) continue; } /* Anything other than a directory separator is copied verbatim. */ if ((path[src] != '/') #if defined(LT_DIRSEP_CHAR) && (path[src] != LT_DIRSEP_CHAR) #endif ) { canonical[dest++] = path[src]; } /* Directory separators are converted and copied only if they are not at the end of a path -- i.e. before a path separator or NULL terminator. */ else if ((path[1+ src] != LT_PATHSEP_CHAR) && (path[1+ src] != LT_EOS_CHAR) #if defined(LT_DIRSEP_CHAR) && (path[1+ src] != LT_DIRSEP_CHAR) #endif && (path[1+ src] != '/')) { canonical[dest++] = '/'; } } /* Add an end-of-string marker at the end. */ canonical[dest] = LT_EOS_CHAR; } /* Assign new value. */ *pcanonical = canonical; return 0; } static int argzize_path (const char *path, char **pargz, size_t *pargz_len) { error_t error; assert (path); assert (pargz); assert (pargz_len); if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns non-zero or all elements are exhausted. If BASE_NAME is non-NULL, it is appended to each SEARCH_PATH element before FUNC is called. */ static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2) { int result = 0; size_t filenamesize = 0; size_t lenbase = LT_STRLEN (base_name); size_t argz_len = 0; char *argz = 0; char *filename = 0; char *canonical = 0; if (!search_path || !*search_path) { LT__SETERROR (FILE_NOT_FOUND); goto cleanup; } if (canonicalize_path (search_path, &canonical) != 0) goto cleanup; if (argzize_path (canonical, &argz, &argz_len) != 0) goto cleanup; { char *dir_name = 0; while ((dir_name = argz_next (argz, argz_len, dir_name))) { size_t lendir = LT_STRLEN (dir_name); if (1+ lendir + lenbase >= filenamesize) { FREE (filename); filenamesize = 1+ lendir + 1+ lenbase; /* "/d" + '/' + "f" + '\0' */ filename = MALLOC (char, filenamesize); if (!filename) goto cleanup; } assert (filenamesize > lendir); strcpy (filename, dir_name); if (base_name && *base_name) { if (filename[lendir -1] != '/') filename[lendir++] = '/'; strcpy (filename +lendir, base_name); } if ((result = (*func) (filename, data1, data2))) { break; } } } cleanup: FREE (argz); FREE (canonical); FREE (filename); return result; } /* If FILEPATH can be opened, store the name of the directory component in DATA1, and the opened FILE* structure address in DATA2. Otherwise DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ static int find_file_callback (char *filename, void *data1, void *data2) { char **pdir = (char **) data1; FILE **pfile = (FILE **) data2; int is_done = 0; assert (filename && *filename); assert (pdir); assert (pfile); if ((*pfile = fopen (filename, LT_READTEXT_MODE))) { char *dirend = strrchr (filename, '/'); if (dirend > filename) *dirend = LT_EOS_CHAR; FREE (*pdir); *pdir = lt__strdup (filename); is_done = (*pdir == 0) ? -1 : 1; } return is_done; } static FILE * find_file (const char *search_path, const char *base_name, char **pdir) { FILE *file = 0; foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); return file; } static int find_handle_callback (char *filename, void *data, void *data2) { lt_dlhandle *phandle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); lt_dladvise advise = (lt_dladvise) data2; /* Bail out if file cannot be read... */ if (notfound) return 0; /* Try to dlopen the file, but do not continue searching in any case. */ if (tryall_dlopen (phandle, filename, advise, 0) != 0) *phandle = 0; return 1; } /* If HANDLE was found return it, otherwise return 0. If HANDLE was found but could not be opened, *HANDLE will be set to 0. */ static lt_dlhandle * find_handle (const char *search_path, const char *base_name, lt_dlhandle *phandle, lt_dladvise advise) { if (!search_path) return 0; if (!foreach_dirinpath (search_path, base_name, find_handle_callback, phandle, advise)) return 0; return phandle; } #if !defined(LTDL_DLOPEN_DEPLIBS) static int load_deplibs (lt_dlhandle handle, char * LT__UNUSED deplibs) { handle->depcount = 0; return 0; } #else /* defined(LTDL_DLOPEN_DEPLIBS) */ static int load_deplibs (lt_dlhandle handle, char *deplibs) { char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; int errors = 0; handle->depcount = 0; if (!deplibs) { return errors; } ++errors; if (user_search_path) { save_search_path = lt__strdup (user_search_path); if (!save_search_path) goto cleanup; } /* extract search paths and count deplibs */ p = deplibs; while (*p) { if (!isspace ((unsigned char) *p)) { char *end = p+1; while (*end && !isspace((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) { char save = *end; *end = 0; /* set a temporary string terminator */ if (lt_dladdsearchdir(p+2)) { goto cleanup; } *end = save; } else { ++depcount; } p = end; } else { ++p; } } if (!depcount) { errors = 0; goto cleanup; } names = MALLOC (char *, depcount); if (!names) goto cleanup; /* now only extract the actual deplibs */ depcount = 0; p = deplibs; while (*p) { if (isspace ((unsigned char) *p)) { ++p; } else { char *end = p+1; while (*end && !isspace ((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) { char *name; char save = *end; *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); name = MALLOC (char, 1+ name_len); if (name) sprintf (name, "lib%s", p+2); } else name = lt__strdup(p); if (!name) goto cleanup_names; names[depcount++] = name; *end = save; } p = end; } } /* load the deplibs (in reverse order) At this stage, don't worry if the deplibs do not load correctly, they may already be statically linked into the loading application for instance. There will be a more enlightening error message later on if the loaded module cannot resolve all of its symbols. */ if (depcount) { lt_dlhandle cur = handle; int j = 0; cur->deplibs = MALLOC (lt_dlhandle, depcount); if (!cur->deplibs) goto cleanup_names; for (i = 0; i < depcount; ++i) { cur->deplibs[j] = lt_dlopenext(names[depcount-1-i]); if (cur->deplibs[j]) { ++j; } } cur->depcount = j; /* Number of successfully loaded deplibs */ errors = 0; } cleanup_names: for (i = 0; i < depcount; ++i) { FREE (names[i]); } cleanup: FREE (names); /* restore the old search path */ if (save_search_path) { MEMREASSIGN (user_search_path, save_search_path); } return errors; } #endif /* defined(LTDL_DLOPEN_DEPLIBS) */ static int unload_deplibs (lt_dlhandle handle) { int i; int errors = 0; lt_dlhandle cur = handle; if (cur->depcount) { for (i = 0; i < cur->depcount; ++i) { if (!LT_DLIS_RESIDENT (cur->deplibs[i])) { errors += lt_dlclose (cur->deplibs[i]); } } FREE (cur->deplibs); } return errors; } static int trim (char **dest, const char *str) { /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); size_t len = LT_STRLEN (str); char *tmp; FREE (*dest); if (!end || end == str) return 1; if (len > 3 && str[0] == '\'') { tmp = MALLOC (char, end - str); if (!tmp) return 1; memcpy(tmp, &str[1], (end - str) - 1); tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else { *dest = 0; } return 0; } /* Read the .la file FILE. */ static int parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs, char **old_name, int *installed) { int errors = 0; size_t line_len = LT_FILENAME_MAX; char * line = MALLOC (char, line_len); if (!line) { LT__SETERROR (FILE_NOT_FOUND); return 1; } while (!feof (file)) { line[line_len-2] = '\0'; if (!fgets (line, (int) line_len, file)) { break; } /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. Behave even if the file contains NUL bytes due to corruption. */ while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file)) { line = REALLOC (char, line, line_len *2); if (!line) { ++errors; goto cleanup; } line[line_len * 2 - 2] = '\0'; if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } line_len *= 2; } if (line[0] == '\n' || line[0] == '#') { continue; } #undef STR_DLNAME #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { errors += trim (dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY #define STR_OLD_LIBRARY "old_library=" else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { errors += trim (old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } /* Windows native tools do not understand the POSIX paths we store in libdir. */ #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { errors += trim (libdir, &line[sizeof(STR_LIBDIR) - 1]); #ifdef __WINDOWS__ /* Disallow following unix-style paths on MinGW. */ if (*libdir && (**libdir == '/' || **libdir == '\\')) **libdir = '\0'; #endif } #undef STR_DL_DEPLIBS #define STR_DL_DEPLIBS "dependency_libs=" else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (streq (line, "installed=yes\n")) { *installed = 1; } else if (streq (line, "installed=no\n")) { *installed = 0; } #undef STR_LIBRARY_NAMES #define STR_LIBRARY_NAMES "library_names=" else if (!*dlname && strncmp (line, STR_LIBRARY_NAMES, sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; errors += trim (dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); if (!errors && *dlname && (last_libname = strrchr (*dlname, ' ')) != 0) { last_libname = lt__strdup (last_libname + 1); if (!last_libname) { ++errors; goto cleanup; } MEMREASSIGN (*dlname, last_libname); } } if (errors) break; } cleanup: FREE (line); return errors; } /* Try to open FILENAME as a module. */ static int try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, lt_dladvise advise) { const char * saved_error = 0; char * archive_name = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; char * attempt = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "try_dlopen (%s, %s)\n", filename ? filename : "(null)", ext ? ext : "(null)"); #endif LT__GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) return 1; newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ newhandle->info.is_resident = 1; if (tryall_dlopen (&newhandle, 0, advise, 0) != 0) { FREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); if (ext) { attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1); if (!attempt) return 1; sprintf(attempt, "%s%s", filename, ext); } else { attempt = lt__strdup (filename); if (!attempt) return 1; } /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (attempt, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = MALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strncpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else MEMREASSIGN (base_name, canonical); assert (base_name && *base_name); ext = strrchr (base_name, '.'); if (!ext) { ext = base_name + LT_STRLEN (base_name); } /* extract the module name from the file name */ name = MALLOC (char, ext - base_name + 1); if (!name) { ++errors; goto cleanup; } /* canonicalize the module name */ { int i; for (i = 0; i < ext - base_name; ++i) { if (isalnum ((unsigned char)(base_name[i]))) { name[i] = base_name[i]; } else { name[i] = '_'; } } name[ext - base_name] = LT_EOS_CHAR; } /* Before trawling through the filesystem in search of a module, check whether we are opening a preloaded module. */ if (!dir) { const lt_dlvtable *vtable = lt_dlloader_find ("lt_preopen"); if (vtable) { /* libprefix + name + "." + libext + NULL */ archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if ((*phandle == NULL) || (archive_name == NULL)) { ++errors; goto cleanup; } newhandle = *phandle; /* Preloaded modules are always named according to their old archive name. */ if (strncmp(name, "lib", 3) == 0) { sprintf (archive_name, "%s%s.%s", libprefix, name + 3, libext); } else { sprintf (archive_name, "%s.%s", name, libext); } if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0) { goto register_handle; } /* If we're still here, there was no matching preloaded module, so put things back as we found them, and continue searching. */ FREE (*phandle); newhandle = NULL; } } /* If we are allowing only preloaded modules, and we didn't find anything yet, give up on the search here. */ if (advise && advise->try_preload_only) { goto cleanup; } /* Check whether we are opening a libtool module (.la extension). */ if (ext && streq (ext, archive_ext)) { /* this seems to be a libtool module */ FILE * file = 0; char * dlname = 0; char * old_name = 0; char * libdir = 0; char * deplibs = 0; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version of libtool */ int installed = 1; /* Now try to open the .la file. If there is no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if (!dir) { const char *search_path = user_search_path; if (search_path) file = find_file (user_search_path, base_name, &dir); if (!file) { search_path = getenv (LTDL_SEARCHPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #if defined(LT_MODULE_PATH_VAR) if (!file) { search_path = getenv (LT_MODULE_PATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #endif #if defined(LT_DLSEARCH_PATH) if (!file && *sys_dlsearch_path) { file = find_file (sys_dlsearch_path, base_name, &dir); } #endif } else { file = fopen (attempt, LT_READTEXT_MODE); } /* If we didn't find the file by now, it really isn't there. Set the status flag, and bail out. */ if (!file) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto cleanup; } /* read the .la file */ if (parse_dotla_file(file, &dlname, &libdir, &deplibs, &old_name, &installed) != 0) ++errors; fclose (file); /* allocate the handle */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) ++errors; if (errors) { FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); FREE (*phandle); goto cleanup; } assert (*phandle); if (load_deplibs (*phandle, deplibs) == 0) { newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed, advise)) { unload_deplibs (*phandle); ++errors; } } else { ++errors; } FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); if (errors) { FREE (*phandle); goto cleanup; } if (*phandle != newhandle) { unload_deplibs (*phandle); } } else { /* not a libtool module */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) { ++errors; goto cleanup; } newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if ((dir || (!find_handle (user_search_path, base_name, &newhandle, advise) && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, &newhandle, advise) #if defined(LT_MODULE_PATH_VAR) && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name, &newhandle, advise) #endif #if defined(LT_DLSEARCH_PATH) && !find_handle (sys_dlsearch_path, base_name, &newhandle, advise) #endif ))) { if (tryall_dlopen (&newhandle, attempt, advise, 0) != 0) { newhandle = NULL; } } if (!newhandle) { FREE (*phandle); ++errors; goto cleanup; } } register_handle: MEMREASSIGN (*phandle, newhandle); if ((*phandle)->info.ref_count == 0) { (*phandle)->info.ref_count = 1; MEMREASSIGN ((*phandle)->info.name, name); (*phandle)->next = handles; handles = *phandle; } LT__SETERRORSTR (saved_error); cleanup: FREE (dir); FREE (attempt); FREE (name); if (!canonical) /* was MEMREASSIGNed */ FREE (base_name); FREE (canonical); FREE (archive_name); return errors; } /* If the last error message stored was `FILE_NOT_FOUND', then return non-zero. */ static int file_not_found (void) { const char *error = 0; LT__GETERROR (error); if (error == LT__STRERROR (FILE_NOT_FOUND)) return 1; return 0; } /* Unless FILENAME already bears a suitable library extension, then return 0. */ static int has_library_ext (const char *filename) { const char * ext = 0; assert (filename); ext = strrchr (filename, '.'); if (ext && ((streq (ext, archive_ext)) #if defined(LT_MODULE_EXT) || (streq (ext, shlib_ext)) #endif #if defined(LT_SHARED_EXT) || (streq (ext, shared_ext)) #endif )) { return 1; } return 0; } /* Initialise and configure a user lt_dladvise opaque object. */ int lt_dladvise_init (lt_dladvise *padvise) { lt_dladvise advise = (lt_dladvise) lt__zalloc (sizeof (struct lt__advise)); *padvise = advise; return (advise ? 0 : 1); } int lt_dladvise_destroy (lt_dladvise *padvise) { if (padvise) FREE(*padvise); return 0; } int lt_dladvise_ext (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_ext = 1; return 0; } int lt_dladvise_resident (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_resident = 1; return 0; } int lt_dladvise_local (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symlocal = 1; return 0; } int lt_dladvise_global (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symglobal = 1; return 0; } int lt_dladvise_preload (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_preload_only = 1; return 0; } /* Libtool-1.5.x interface for loading a new module named FILENAME. */ lt_dlhandle lt_dlopen (const char *filename) { return lt_dlopenadvise (filename, NULL); } /* If FILENAME has an ARCHIVE_EXT or MODULE_EXT extension, try to open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, and if a file is still not found try again with MODULE_EXT appended instead. */ lt_dlhandle lt_dlopenext (const char *filename) { lt_dlhandle handle = 0; lt_dladvise advise; if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)) handle = lt_dlopenadvise (filename, advise); lt_dladvise_destroy (&advise); return handle; } lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise) { lt_dlhandle handle = 0; int errors = 0; const char * saved_error = 0; LT__GETERROR (saved_error); /* Can't have symbols hidden and visible at the same time! */ if (advise && advise->is_symlocal && advise->is_symglobal) { LT__SETERROR (CONFLICTING_FLAGS); return 0; } if (!filename || !advise || !advise->try_ext || has_library_ext (filename)) { /* Just incase we missed a code path in try_dlopen() that reports an error, but forgot to reset handle... */ if (try_dlopen (&handle, filename, NULL, advise) != 0) return 0; return handle; } else if (filename && *filename) { /* First try appending ARCHIVE_EXT. */ errors += try_dlopen (&handle, filename, archive_ext, advise); /* If we found FILENAME, stop searching -- whether we were able to load the file as a module or not. If the file exists but loading failed, it is better to return an error message here than to report FILE_NOT_FOUND when the alternatives (foo.so etc) are not in the module search path. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #if defined(LT_MODULE_EXT) /* Try appending SHLIB_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shlib_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif #if defined(LT_SHARED_EXT) /* Try appending SHARED_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shared_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif } /* Still here? Then we really did fail to locate any of the file names we tried. */ LT__SETERROR (FILE_NOT_FOUND); return 0; } static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { error_t error; /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, pargz_len, NULL, entry) failed with EINVAL. */ if (before) error = argz_insert (pargz, pargz_len, before, entry); else error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry)); if (error) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry) { char *before = 0; assert (pargz); assert (pargz_len); assert (entry && *entry); if (*pargz) while ((before = argz_next (*pargz, *pargz_len, before))) { int cmp = strcmp (entry, before); if (cmp < 0) break; if (cmp == 0) return 0; /* No duplicates! */ } return lt_argz_insert (pargz, pargz_len, before, entry); } static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp) { char *buf = 0; size_t buf_len = 0; char *end = 0; size_t end_offset = 0; size_t dir_len = 0; int errors = 0; assert (pargz); assert (pargz_len); assert (dp); dir_len = LT_STRLEN (dirnam); end = dp->d_name + D_NAMLEN(dp); /* Ignore version numbers. */ { char *p; for (p = end; p -1 > dp->d_name; --p) if (strchr (".0123456789", p[-1]) == 0) break; if (*p == '.') end = p; } /* Ignore filename extension. */ { char *p; for (p = end -1; p > dp->d_name; --p) if (*p == '.') { end = p; break; } } /* Prepend the directory name. */ end_offset = end - dp->d_name; buf_len = dir_len + 1+ end_offset; buf = MALLOC (char, 1+ buf_len); if (!buf) return ++errors; assert (buf); strcpy (buf, dirnam); strcat (buf, "/"); strncat (buf, dp->d_name, end_offset); buf[buf_len] = LT_EOS_CHAR; /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) ++errors; FREE (buf); return errors; } static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len) { DIR *dirp = 0; int errors = 0; assert (dirnam && *dirnam); assert (pargz); assert (pargz_len); assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); dirp = opendir (dirnam); if (dirp) { struct dirent *dp = 0; while ((dp = readdir (dirp))) if (dp->d_name[0] != '.') if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) { ++errors; break; } closedir (dirp); } else ++errors; return errors; } /* If there are any files in DIRNAME, call the function passed in DATA1 (with the name of each file and DATA2 as arguments). */ static int foreachfile_callback (char *dirname, void *data1, void *data2) { file_worker_func *func = *(file_worker_func **) data1; int is_done = 0; char *argz = 0; size_t argz_len = 0; if (list_files_by_dir (dirname, &argz, &argz_len) != 0) goto cleanup; if (!argz) goto cleanup; { char *filename = 0; while ((filename = argz_next (argz, argz_len, filename))) if ((is_done = (*func) (filename, data2))) break; } cleanup: FREE (argz); return is_done; } /* Call FUNC for each unique extensionless file in SEARCH_PATH, along with DATA. The filenames passed to FUNC would be suitable for passing to lt_dlopenext. The extensions are stripped so that individual modules do not generate several entries (e.g. libfoo.la, libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, then the same directories that lt_dlopen would search are examined. */ int lt_dlforeachfile (const char *search_path, int (*func) (const char *filename, void *data), void *data) { int is_done = 0; file_worker_func **fpptr = &func; if (search_path) { /* If a specific path was passed, search only the directories listed in it. */ is_done = foreach_dirinpath (search_path, 0, foreachfile_callback, fpptr, data); } else { /* Otherwise search the default paths. */ is_done = foreach_dirinpath (user_search_path, 0, foreachfile_callback, fpptr, data); if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0, foreachfile_callback, fpptr, data); } #if defined(LT_MODULE_PATH_VAR) if (!is_done) { is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0, foreachfile_callback, fpptr, data); } #endif #if defined(LT_DLSEARCH_PATH) if (!is_done && *sys_dlsearch_path) { is_done = foreach_dirinpath (sys_dlsearch_path, 0, foreachfile_callback, fpptr, data); } #endif } return is_done; } int lt_dlclose (lt_dlhandle handle) { lt_dlhandle cur, last; int errors = 0; /* check whether the handle is valid */ last = cur = handles; while (cur && handle != cur) { last = cur; cur = cur->next; } if (!cur) { LT__SETERROR (INVALID_HANDLE); ++errors; goto done; } cur = handle; cur->info.ref_count--; /* Note that even with resident modules, we must track the ref_count correctly incase the user decides to reset the residency flag later (even though the API makes no provision for that at the moment). */ if (cur->info.ref_count <= 0 && !LT_DLIS_RESIDENT (cur)) { lt_user_data data = cur->vtable->dlloader_data; if (cur != handles) { last->next = cur->next; } else { handles = cur->next; } errors += cur->vtable->module_close (data, cur->module); errors += unload_deplibs (handle); /* It is up to the callers to free the data itself. */ FREE (cur->interface_data); FREE (cur->info.filename); FREE (cur->info.name); FREE (cur); goto done; } if (LT_DLIS_RESIDENT (handle)) { LT__SETERROR (CLOSE_RESIDENT_MODULE); ++errors; } done: return errors; } void * lt_dlsym (lt_dlhandle place, const char *symbol) { size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; void *address; lt_user_data data; lt_dlhandle handle; if (!place) { LT__SETERROR (INVALID_HANDLE); return 0; } handle = place; if (!symbol) { LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->vtable->sym_prefix) + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { sym = lsym; } else { sym = MALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); if (!sym) { LT__SETERROR (BUFFER_OVERFLOW); return 0; } } data = handle->vtable->dlloader_data; if (handle->info.name) { const char *saved_error; LT__GETERROR (saved_error); /* this is a libtool module */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, handle->info.name); } else { strcpy(sym, handle->info.name); } strcat(sym, "_LTX_"); strcat(sym, symbol); /* try "modulename_LTX_symbol" */ address = handle->vtable->find_sym (data, handle->module, sym); if (address) { if (sym != lsym) { FREE (sym); } return address; } LT__SETERRORSTR (saved_error); } /* otherwise try "symbol" */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, symbol); } else { strcpy(sym, symbol); } address = handle->vtable->find_sym (data, handle->module, sym); if (sym != lsym) { FREE (sym); } return address; } const char * lt_dlerror (void) { const char *error; LT__GETERROR (error); LT__SETERRORSTR (0); return error; } static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir) { int errors = 0; char *canonical = 0; char *argz = 0; size_t argz_len = 0; assert (ppath); assert (dir && *dir); if (canonicalize_path (dir, &canonical) != 0) { ++errors; goto cleanup; } assert (canonical && *canonical); /* If *PPATH is empty, set it to DIR. */ if (*ppath == 0) { assert (!before); /* BEFORE cannot be set without PPATH. */ assert (dir); /* Without DIR, don't call this function! */ *ppath = lt__strdup (dir); if (*ppath == 0) ++errors; goto cleanup; } assert (ppath && *ppath); if (argzize_path (*ppath, &argz, &argz_len) != 0) { ++errors; goto cleanup; } /* Convert BEFORE into an equivalent offset into ARGZ. This only works if *PPATH is already canonicalized, and hence does not change length with respect to ARGZ. We canonicalize each entry as it is added to the search path, and don't call this function with (uncanonicalized) user paths, so this is a fair assumption. */ if (before) { assert (*ppath <= before); assert ((int) (before - *ppath) <= (int) strlen (*ppath)); before = before - *ppath + argz; } if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) { ++errors; goto cleanup; } argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); MEMREASSIGN(*ppath, argz); cleanup: FREE (argz); FREE (canonical); return errors; } int lt_dladdsearchdir (const char *search_dir) { int errors = 0; if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) ++errors; } return errors; } int lt_dlinsertsearchdir (const char *before, const char *search_dir) { int errors = 0; if (before) { if ((before < user_search_path) || (before >= user_search_path + LT_STRLEN (user_search_path))) { LT__SETERROR (INVALID_POSITION); return 1; } } if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, (char *) before, search_dir) != 0) { ++errors; } } return errors; } int lt_dlsetsearchpath (const char *search_path) { int errors = 0; FREE (user_search_path); if (!search_path || !LT_STRLEN (search_path)) { return errors; } if (canonicalize_path (search_path, &user_search_path) != 0) ++errors; return errors; } const char * lt_dlgetsearchpath (void) { const char *saved_path; saved_path = user_search_path; return saved_path; } int lt_dlmakeresident (lt_dlhandle handle) { int errors = 0; if (!handle) { LT__SETERROR (INVALID_HANDLE); ++errors; } else { handle->info.is_resident = 1; } return errors; } int lt_dlisresident (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return -1; } return LT_DLIS_RESIDENT (handle); } /* --- MODULE INFORMATION --- */ typedef struct { const char *id_string; lt_dlhandle_interface *iface; } lt__interface_id; lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) { lt__interface_id *interface_id = (lt__interface_id *) lt__malloc (sizeof *interface_id); /* If lt__malloc fails, it will LT__SETERROR (NO_MEMORY), which can then be detected with lt_dlerror() if we return 0. */ if (interface_id) { interface_id->id_string = lt__strdup (id_string); if (!interface_id->id_string) FREE (interface_id); else interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; } void lt_dlinterface_free (lt_dlinterface_id key) { lt__interface_id *interface_id = (lt__interface_id *)key; FREE (interface_id->id_string); FREE (interface_id); } void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data) { int n_elements = 0; void *stale = (void *) 0; lt_dlhandle cur = handle; int i; if (cur->interface_data) while (cur->interface_data[n_elements].key) ++n_elements; for (i = 0; i < n_elements; ++i) { if (cur->interface_data[i].key == key) { stale = cur->interface_data[i].data; break; } } /* Ensure that there is enough room in this handle's interface_data array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_interface_data *temp = REALLOC (lt_interface_data, cur->interface_data, 2+ n_elements); if (!temp) { stale = 0; goto done; } cur->interface_data = temp; /* We only need this if we needed to allocate a new interface_data. */ cur->interface_data[i].key = key; cur->interface_data[1+ i].key = 0; } cur->interface_data[i].data = data; done: return stale; } void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle) { void *result = (void *) 0; lt_dlhandle cur = handle; /* Locate the index of the element with a matching KEY. */ if (cur->interface_data) { int i; for (i = 0; cur->interface_data[i].key; ++i) { if (cur->interface_data[i].key == key) { result = cur->interface_data[i].data; break; } } } return result; } const lt_dlinfo * lt_dlgetinfo (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return 0; } return &(handle->info); } lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place) { lt_dlhandle handle = place; lt__interface_id *iterator = (lt__interface_id *) iface; assert (iface); /* iface is a required argument */ if (!handle) handle = handles; else handle = handle->next; /* advance while the interface check fails */ while (handle && iterator->iface && ((*iterator->iface) (handle, iterator->id_string) != 0)) { handle = handle->next; } return handle; } lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name) { lt_dlhandle handle = 0; assert (iface); /* iface is a required argument */ while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur && cur->info.name && streq (cur->info.name, module_name)) break; } return handle; } int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data) { lt__interface_id *iterator = (lt__interface_id *) iface; lt_dlhandle cur = handles; assert (iface); /* iface is a required argument */ while (cur) { int errorcode = 0; /* advance while the interface check fails */ while (cur && iterator->iface && ((*iterator->iface) (cur, iterator->id_string) != 0)) { cur = cur->next; } if ((errorcode = (*func) (cur, data)) != 0) return errorcode; } return 0; } parser-3.4.3/src/lib/ltdl/configure.ac000644 000000 000000 00000005010 11764645176 017713 0ustar00rootwheel000000 000000 # Process this file with autoconf to create configure. -*- autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # NOTE: The canonical source of this file is maintained with the # GNU Libtool package. Report bugs to bug-libtool@gnu.org. # # GNU Libltdl 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 of the License, or (at your option) any later version. # # As a special exception to the GNU Lesser General Public License, # if you distribute this file as part of a program or library that # is built using GNU libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libltdl 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 LesserGeneral Public # License along with GNU Libltdl; see the file COPYING.LIB. If not, a # copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #### # This configure.ac is not used at all by the libtool bootstrap, but # is copied to the ltdl subdirectory if you libtoolize --ltdl your own # project. Adding LT_WITH_LTDL to your project configure.ac will then # configure this directory if your user doesn't want to use the installed # libltdl. AC_PREREQ(2.59)dnl We use AS_HELP_STRING ## ------------------------ ## ## Autoconf initialisation. ## ## ------------------------ ## AC_INIT([libltdl], [2.4.2], [bug-libtool@gnu.org]) AC_CONFIG_HEADERS([config.h:config-h.in]) AC_CONFIG_SRCDIR([ltdl.c]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) LT_CONFIG_LTDL_DIR([.]) # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## AM_INIT_AUTOMAKE([gnu]) ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='${datadir}'"/${PACKAGE}" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## LT_INIT([dlopen win32-dll]) _LTDL_SETUP ## -------- ## ## Outputs. ## ## -------- ## AC_CONFIG_FILES([Makefile]) AC_OUTPUT parser-3.4.3/src/lib/ltdl/ltdl.h000644 000000 000000 00000013125 11764645177 016544 0ustar00rootwheel000000 000000 /* ltdl.h -- generic dlopen functions Copyright (C) 1998-2000, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined(LTDL_H) #define LTDL_H 1 #include #include #include LT_BEGIN_C_DECLS /* LT_STRLEN can be used safely on NULL pointers. */ #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) /* --- DYNAMIC MODULE LOADING API --- */ typedef struct lt__handle *lt_dlhandle; /* A loaded module. */ /* Initialisation and finalisation functions for libltdl. */ LT_SCOPE int lt_dlinit (void); LT_SCOPE int lt_dlexit (void); /* Module search path manipulation. */ LT_SCOPE int lt_dladdsearchdir (const char *search_dir); LT_SCOPE int lt_dlinsertsearchdir (const char *before, const char *search_dir); LT_SCOPE int lt_dlsetsearchpath (const char *search_path); LT_SCOPE const char *lt_dlgetsearchpath (void); LT_SCOPE int lt_dlforeachfile ( const char *search_path, int (*func) (const char *filename, void *data), void *data); /* User module loading advisors. */ LT_SCOPE int lt_dladvise_init (lt_dladvise *advise); LT_SCOPE int lt_dladvise_destroy (lt_dladvise *advise); LT_SCOPE int lt_dladvise_ext (lt_dladvise *advise); LT_SCOPE int lt_dladvise_resident (lt_dladvise *advise); LT_SCOPE int lt_dladvise_local (lt_dladvise *advise); LT_SCOPE int lt_dladvise_global (lt_dladvise *advise); LT_SCOPE int lt_dladvise_preload (lt_dladvise *advise); /* Portable libltdl versions of the system dlopen() API. */ LT_SCOPE lt_dlhandle lt_dlopen (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenext (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise); LT_SCOPE void * lt_dlsym (lt_dlhandle handle, const char *name); LT_SCOPE const char *lt_dlerror (void); LT_SCOPE int lt_dlclose (lt_dlhandle handle); /* --- PRELOADED MODULE SUPPORT --- */ /* A preopened symbol. Arrays of this type comprise the exported symbols for a dlpreopened module. */ typedef struct { const char *name; void *address; } lt_dlsymlist; typedef int lt_dlpreload_callback_func (lt_dlhandle handle); LT_SCOPE int lt_dlpreload (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_default (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func); #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols /* Ensure C linkage. */ extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[]; #define LTDL_SET_PRELOADED_SYMBOLS() \ lt_dlpreload_default(lt_preloaded_symbols) /* --- MODULE INFORMATION --- */ /* Associating user data with loaded modules. */ typedef void * lt_dlinterface_id; typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string); LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface); LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key); LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data); LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle); /* Read only information pertaining to a loaded module. */ typedef struct { char * filename; /* file name */ char * name; /* module name */ int ref_count; /* number of times lt_dlopened minus number of times lt_dlclosed. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ } lt_dlinfo; LT_SCOPE const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle); LT_SCOPE lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place); LT_SCOPE lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name); LT_SCOPE int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data); /* Deprecated module residency management API. */ LT_SCOPE int lt_dlmakeresident (lt_dlhandle handle); LT_SCOPE int lt_dlisresident (lt_dlhandle handle); #define lt_ptr void * LT_END_C_DECLS #endif /*!defined(LTDL_H)*/ parser-3.4.3/src/lib/ltdl/lt__strl.c000644 000000 000000 00000007026 11764645176 017424 0ustar00rootwheel000000 000000 /* lt__strl.c -- size-bounded string copying and concatenation Copyright (C) 2004 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "lt__strl.h" /* lt_strlcat appends the NULL-terminated string src to the end of dst. It will append at most dstsize - strlen(dst) - 1 bytes, NULL-terminating the result. The total length of the string which would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcat() which is available under NetBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcat(dst, src, dstsize) >= dstsize) return -1; */ #if !defined(HAVE_STRLCAT) size_t lt_strlcat(char *dst, const char *src, const size_t dstsize) { size_t length; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); length=strlen(dst); /* Copy remaining characters from src while constraining length to size - 1. */ for ( p = dst + length, q = src; (*q != 0) && (length < dstsize - 1) ; length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined(HAVE_STRLCAT) */ /* lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated string src to dst, NULL-terminating the result. The total length of the string which would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcpy() which is available under OpenBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcpy(dst, src, dstsize) >= dstsize) return -1; */ #if !defined(HAVE_STRLCPY) size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize) { size_t length=0; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); /* Copy src to dst within bounds of size-1. */ for ( p=dst, q=src, length=0 ; (*q != 0) && (length < dstsize-1) ; length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined(HAVE_STRLCPY) */ parser-3.4.3/src/lib/ltdl/m4/000755 000000 000000 00000000000 12234223575 015735 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/ltdl/argz.c000644 000000 000000 00000013510 11770443336 016527 0ustar00rootwheel000000 000000 /* argz.c -- argz implementation for non-glibc systems Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined(LTDL) && defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #ifdef HAVE_WORKING_ARGZ #include #else #include #endif #include #include #include #include #include #include #define EOS_CHAR '\0' error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len) { size_t argz_len; char *argz; assert (pargz); assert (pargz_len); assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); /* If nothing needs to be appended, no more work is required. */ if (buf_len == 0) return 0; /* Ensure there is enough room to append BUF_LEN. */ argz_len = *pargz_len + buf_len; argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Copy characters from BUF after terminating '\0' in ARGZ. */ memcpy (argz + *pargz_len, buf, buf_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len) { size_t argz_len; char *argz = 0; assert (str); assert (pargz); assert (pargz_len); /* Make a copy of STR, but replacing each occurrence of DELIM with '\0'. */ argz_len = 1+ strlen (str); if (argz_len) { const char *p; char *q; argz = (char *) malloc (argz_len); if (!argz) return ENOMEM; for (p = str, q = argz; *p != EOS_CHAR; ++p) { if (*p == delim) { /* Ignore leading delimiters, and fold consecutive delimiters in STR into a single '\0' in ARGZ. */ if ((q > argz) && (q[-1] != EOS_CHAR)) *q++ = EOS_CHAR; else --argz_len; } else *q++ = *p; } /* Copy terminating EOS_CHAR. */ *q = *p; } /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ if (!argz_len) argz = (free (argz), (char *) 0); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { assert (pargz); assert (pargz_len); assert (entry && *entry); /* No BEFORE address indicates ENTRY should be inserted after the current last element. */ if (!before) return argz_append (pargz, pargz_len, entry, 1+ strlen (entry)); /* This probably indicates a programmer error, but to preserve semantics, scan back to the start of an entry if BEFORE points into the middle of it. */ while ((before > *pargz) && (before[-1] != EOS_CHAR)) --before; { size_t entry_len = 1+ strlen (entry); size_t argz_len = *pargz_len + entry_len; size_t offset = before - *pargz; char *argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Make BEFORE point to the equivalent offset in ARGZ that it used to have in *PARGZ incase realloc() moved the block. */ before = argz + offset; /* Move the ARGZ entries starting at BEFORE up into the new space at the end -- making room to copy ENTRY into the resulting gap. */ memmove (before + entry_len, before, *pargz_len - offset); memcpy (before, entry, entry_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; } return 0; } char * argz_next (char *argz, size_t argz_len, const char *entry) { assert ((argz && argz_len) || (!argz && !argz_len)); if (entry) { /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address within the ARGZ vector. */ assert ((!argz && !argz_len) || ((argz <= entry) && (entry < (argz + argz_len)))); /* Move to the char immediately after the terminating '\0' of ENTRY. */ entry = 1+ strchr (entry, EOS_CHAR); /* Return either the new ENTRY, or else NULL if ARGZ is exhausted. */ return (entry >= argz + argz_len) ? 0 : (char *) entry; } else { /* This should probably be flagged as a programmer error, since starting an argz_next loop with the iterator set to ARGZ is safer. To preserve semantics, handle the NULL case by returning the start of ARGZ (if any). */ if (argz_len > 0) return argz; else return 0; } } void argz_stringify (char *argz, size_t argz_len, int sep) { assert ((argz && argz_len) || (!argz && !argz_len)); if (sep) { --argz_len; /* don't stringify the terminating EOS */ while (--argz_len > 0) { if (argz[argz_len] == EOS_CHAR) argz[argz_len] = sep; } } } parser-3.4.3/src/lib/ltdl/lt_error.c000644 000000 000000 00000005621 11764645177 017432 0ustar00rootwheel000000 000000 /* lt_error.c -- error propogation interface Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_error.h" static const char *last_error = 0; static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] = { #define LT_ERROR(name, diagnostic) diagnostic, lt_dlerror_table #undef LT_ERROR }; static const char **user_error_strings = 0; static int errorcount = LT_ERROR_MAX; int lt_dladderror (const char *diagnostic) { int errindex = 0; int result = -1; const char **temp = (const char **) 0; assert (diagnostic); errindex = errorcount - LT_ERROR_MAX; temp = REALLOC (const char *, user_error_strings, 1 + errindex); if (temp) { user_error_strings = temp; user_error_strings[errindex] = diagnostic; result = errorcount++; } return result; } int lt_dlseterror (int errindex) { int errors = 0; if (errindex >= errorcount || errindex < 0) { /* Ack! Error setting the error message! */ LT__SETERROR (INVALID_ERRORCODE); ++errors; } else if (errindex < LT_ERROR_MAX) { /* No error setting the error message! */ LT__SETERRORSTR (error_strings[errindex]); } else { /* No error setting the error message! */ LT__SETERRORSTR (user_error_strings[errindex - LT_ERROR_MAX]); } return errors; } const char * lt__error_string (int errorcode) { assert (errorcode >= 0); assert (errorcode < LT_ERROR_MAX); return error_strings[errorcode]; } const char * lt__get_last_error (void) { return last_error; } const char * lt__set_last_error (const char *errormsg) { return last_error = errormsg; } parser-3.4.3/src/lib/ltdl/config-h.in000644 000000 000000 00000011240 11764646175 017451 0ustar00rootwheel000000 000000 /* config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* 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 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 `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t parser-3.4.3/src/lib/ltdl/aclocal.m4000644 000000 000000 00000103771 11764646175 017302 0ustar00rootwheel000000 000000 # generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [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, 2005, 2006, 2008 # 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. # serial 9 # 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])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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 -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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. # 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.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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. # serial 2 # 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, 2005, 2009 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. # serial 4 # 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 this is the am__doit target .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 # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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 ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( 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)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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. # serial 2 # _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 m4_include([m4/argz.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltdl.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) parser-3.4.3/src/lib/ltdl/argz_.h000644 000000 000000 00000004254 11764645175 016710 0ustar00rootwheel000000 000000 /* lt__argz.h -- internal argz interface for non-glibc systems Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__ARGZ_H) #define LT__ARGZ_H 1 #include #define __need_error_t #include #include #if defined(LTDL) # include "lt__glibc.h" # include "lt_system.h" #else # define LT_SCOPE #endif #if defined(__cplusplus) extern "C" { #endif LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len); LT_SCOPE error_t argz_create_sep(const char *str, int delim, char **pargz, size_t *pargz_len); LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); LT_SCOPE char * argz_next (char *argz, size_t argz_len, const char *entry); LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep); #if defined(__cplusplus) } #endif #if !defined(LTDL) # undef LT_SCOPE #endif #endif /*!defined(LT__ARGZ_H)*/ parser-3.4.3/src/lib/ltdl/m4/ltdl.m4000644 000000 000000 00000064663 11764645202 017157 0ustar00rootwheel000000 000000 # ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # 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. # serial 18 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise # to `${top_builddir}/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [${top_build_prefix}], [${top_builddir}/])], [${top_build_prefix}])], [${top_builddir}/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '${top_build_prefix}' if available, otherwise with '${top_builddir}/', # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if # available, otherwise with '${top_builddir}/', and LTDLINCL will be # prefixed with '${top_srcdir}/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f $prefix/lib/libltdl.la; then lt_save_LDFLAGS="$LDFLAGS" LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS="$lt_save_LDFLAGS" if test x"${lt_lib_ltdl-no}" = xyes; then if test x"$enable_ltdl_install" != xyes; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) enable_ltdl_install=no fi elif test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is `subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([gl_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$lt_cv_sys_dlopen_deplibs" != yes; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld"])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" _LT_TRY_DLOPEN_SELF( [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS="$save_LIBS" ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) parser-3.4.3/src/lib/ltdl/m4/ltsugar.m4000644 000000 000000 00000010424 11764645202 017663 0ustar00rootwheel000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) parser-3.4.3/src/lib/ltdl/m4/lt~obsolete.m4000644 000000 000000 00000013756 11764645202 020567 0ustar00rootwheel000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) parser-3.4.3/src/lib/ltdl/m4/libtool.m4000644 000000 000000 00001057216 11764645201 017660 0ustar00rootwheel000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -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 Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS parser-3.4.3/src/lib/ltdl/m4/ltoptions.m4000644 000000 000000 00000030073 11764645202 020237 0ustar00rootwheel000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # 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. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) parser-3.4.3/src/lib/ltdl/m4/argz.m4000644 000000 000000 00000005071 11764645201 017146 0ustar00rootwheel000000 000000 # Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # 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. # serial 5 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for `error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test "$lt_cv_sys_argz_works" = yes], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) ]) # Prerequisites of lib/argz.c. AC_DEFUN([gl_PREREQ_ARGZ], [:]) parser-3.4.3/src/lib/ltdl/m4/ltversion.m4000644 000000 000000 00000001262 11764645202 020227 0ustar00rootwheel000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) parser-3.4.3/src/lib/ltdl/loaders/dld_link.c000644 000000 000000 00000010741 11764645201 020776 0ustar00rootwheel000000 000000 /* loader-dld_link.c -- dynamic linking with dld Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dld_link_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dld_link"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DLD_H) # include #endif /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = lt__strdup (filename); if (dld_link (filename) != 0) { LT__SETERROR (CANNOT_OPEN); FREE (module); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (dld_unlink_by_file ((char*)(module), 1) != 0) { LT__SETERROR (CANNOT_CLOSE); ++errors; } else { FREE (module); } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module, const char *name) { void *address = dld_get_func (name); if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } return address; } parser-3.4.3/src/lib/ltdl/loaders/shl_load.c000644 000000 000000 00000015076 11764645201 021011 0ustar00rootwheel000000 000000 /* loader-shl_load.c -- dynamic linking with shl_load (HP-UX) Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable shl_load_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_shl_load"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DL_H) # include #endif /* some flags are missing on some systems, so we provide * harmless defaults. * * Mandatory: * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. * BIND_DEFERRED - Delay code symbol resolution until actual reference. * * Optionally: * BIND_FIRST - Place the library at the head of the symbol search * order. * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all * unsatisfied symbols as fatal. This flag allows * binding of unsatisfied code symbols to be deferred * until use. * [Perl: For certain libraries, like DCE, deferred * binding often causes run time problems. Adding * BIND_NONFATAL to BIND_IMMEDIATE still allows * unresolved references in situations like this.] * BIND_NOSTART - Do not call the initializer for the shared library * when the library is loaded, nor on a future call to * shl_unload(). * BIND_VERBOSE - Print verbose messages concerning possible * unsatisfied symbols. * * hp9000s700/hp9000s800: * BIND_RESTRICTED - Restrict symbols visible by the library to those * present at library load time. * DYNAMIC_PATH - Allow the loader to dynamically search for the * library specified by the path argument. */ #if !defined(DYNAMIC_PATH) # define DYNAMIC_PATH 0 #endif #if !defined(BIND_RESTRICTED) # define BIND_RESTRICTED 0 #endif #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); /* Since searching for a symbol against a NULL module handle will also look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) { void *address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } if (!filename) { module = self; } else { module = shl_load (filename, LT_BIND_FLAGS, 0L); if (!module) { LT__SETERROR (CANNOT_OPEN); } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (module && (shl_unload ((shl_t) (module)) != 0)) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = 0; /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { LT__SETERROR (INVALID_HANDLE); } else if (!shl_findsym((shl_t*) &module, name, TYPE_UNDEFINED, &address)) { if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } } return address; } parser-3.4.3/src/lib/ltdl/loaders/dlopen.c000644 000000 000000 00000014341 11764645201 020477 0ustar00rootwheel000000 000000 /* loader-dlopen.c -- dynamic linking with dlopen/dlsym Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dlopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dlopen"; #if defined(DLSYM_USCORE) vtable->sym_prefix = "_"; #endif vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DLFCN_H) # include #endif #if defined(HAVE_SYS_DL_H) # include #endif /* We may have to define LT_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #if !defined(LT_LAZY_OR_NOW) # if defined(RTLD_LAZY) # define LT_LAZY_OR_NOW RTLD_LAZY # else # if defined(DL_LAZY) # define LT_LAZY_OR_NOW DL_LAZY # endif # endif /* !RTLD_LAZY */ #endif #if !defined(LT_LAZY_OR_NOW) # if defined(RTLD_NOW) # define LT_LAZY_OR_NOW RTLD_NOW # else # if defined(DL_NOW) # define LT_LAZY_OR_NOW DL_NOW # endif # endif /* !RTLD_NOW */ #endif #if !defined(LT_LAZY_OR_NOW) # define LT_LAZY_OR_NOW 0 #endif /* !LT_LAZY_OR_NOW */ /* We only support local and global symbols from modules for loaders that provide such a thing, otherwise the system default is used. */ #if !defined(RTLD_GLOBAL) # if defined(DL_GLOBAL) # define RTLD_GLOBAL DL_GLOBAL # endif #endif /* !RTLD_GLOBAL */ #if !defined(RTLD_LOCAL) # if defined(DL_LOCAL) # define RTLD_LOCAL DL_LOCAL # endif #endif /* !RTLD_LOCAL */ #if defined(HAVE_DLERROR) # define DLERROR(arg) dlerror () #else # define DLERROR(arg) LT__STRERROR (arg) #endif #define DL__SETERROR(errorcode) \ LT__SETERRORSTR (DLERROR (errorcode)) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise advise) { int module_flags = LT_LAZY_OR_NOW; lt_module module; if (advise) { #ifdef RTLD_GLOBAL /* If there is some means of asking for global symbol resolution, do so. */ if (advise->is_symglobal) module_flags |= RTLD_GLOBAL; #else /* Otherwise, reset that bit so the caller can tell it wasn't acted on. */ advise->is_symglobal = 0; #endif /* And similarly for local only symbol resolution. */ #ifdef RTLD_LOCAL if (advise->is_symlocal) module_flags |= RTLD_LOCAL; #else advise->is_symlocal = 0; #endif } module = dlopen (filename, module_flags); if (!module) { DL__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (dlclose (module) != 0) { DL__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = dlsym (module, name); if (!address) { DL__SETERROR (SYMBOL_NOT_FOUND); } return address; } parser-3.4.3/src/lib/ltdl/loaders/loadlibrary.c000644 000000 000000 00000025173 11764645201 021527 0ustar00rootwheel000000 000000 /* loader-loadlibrary.c -- dynamic linking for Win32 Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #if defined(__CYGWIN__) # include #endif /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable loadlibrary_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlinterface_id iface_id = 0; static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); iface_id = lt_dlinterface_register ("ltdl loadlibrary", NULL); } if (vtable && !vtable->name) { vtable->name = "lt_loadlibrary"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include #define LOCALFREE(mem) LT_STMT_START { \ if (mem) { LocalFree ((void *)mem); mem = NULL; } } LT_STMT_END #define LOADLIB__SETERROR(errmsg) LT__SETERRORSTR (loadlibraryerror (errmsg)) #define LOADLIB_SETERROR(errcode) LOADLIB__SETERROR (LT__STRERROR (errcode)) static const char *loadlibraryerror (const char *default_errmsg); static DWORD WINAPI wrap_getthreaderrormode (void); static DWORD WINAPI fallback_getthreaderrormode (void); static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode); static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode); typedef DWORD (WINAPI getthreaderrormode_type) (void); typedef BOOL (WINAPI setthreaderrormode_type) (DWORD, DWORD *); static getthreaderrormode_type *getthreaderrormode = wrap_getthreaderrormode; static setthreaderrormode_type *setthreaderrormode = wrap_setthreaderrormode; static char *error_message = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; LOCALFREE (error_message); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = 0; char *ext; char wpath[MAX_PATH]; size_t len; if (!filename) { /* Get the name of main module */ *wpath = 0; GetModuleFileName (NULL, wpath, sizeof (wpath)); filename = wpath; } else { len = LT_STRLEN (filename); if (len >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } #if HAVE_DECL_CYGWIN_CONV_PATH if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH)) { LT__SETERROR (CANNOT_OPEN); return 0; } len = 0; #elif defined(__CYGWIN__) cygwin_conv_to_full_win32_path (filename, wpath); len = 0; #else strcpy(wpath, filename); #endif ext = strrchr (wpath, '.'); if (!ext) { /* Append a `.' to stop Windows from adding an implicit `.dll' extension. */ if (!len) len = strlen (wpath); if (len + 1 >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } wpath[len] = '.'; wpath[len+1] = '\0'; } } { /* Silence dialog from LoadLibrary on some failures. */ DWORD errormode = getthreaderrormode (); DWORD last_error; setthreaderrormode (errormode | SEM_FAILCRITICALERRORS, NULL); module = LoadLibrary (wpath); /* Restore the error mode. */ last_error = GetLastError (); setthreaderrormode (errormode, NULL); SetLastError (last_error); } /* libltdl expects this function to fail if it is unable to physically load the library. Sadly, LoadLibrary will search the loaded libraries for a match and return one of them if the path search load fails. We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ { lt_dlhandle cur = 0; while ((cur = lt_dlhandle_iterate (iface_id, cur))) { if (!cur->module) { cur = 0; break; } if (cur->module == module) { break; } } if (!module) LOADLIB_SETERROR (CANNOT_OPEN); else if (cur) { LT__SETERROR (CANNOT_OPEN); module = 0; } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (FreeLibrary ((HMODULE) module) == 0) { LOADLIB_SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = (void *) GetProcAddress ((HMODULE) module, name); if (!address) { LOADLIB_SETERROR (SYMBOL_NOT_FOUND); } return address; } /* --- HELPER FUNCTIONS --- */ /* Return the windows error message, or the passed in error message on failure. */ static const char * loadlibraryerror (const char *default_errmsg) { size_t len; LOCALFREE (error_message); FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError (), 0, (char *) &error_message, 0, NULL); /* Remove trailing CRNL */ len = LT_STRLEN (error_message); if (len && error_message[len - 1] == '\n') error_message[--len] = LT_EOS_CHAR; if (len && error_message[len - 1] == '\r') error_message[--len] = LT_EOS_CHAR; return len ? error_message : default_errmsg; } /* A function called through the getthreaderrormode variable which checks if the system supports GetThreadErrorMode (or GetErrorMode) and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static DWORD WINAPI wrap_getthreaderrormode (void) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetThreadErrorMode"); if (!getthreaderrormode) getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetErrorMode"); if (!getthreaderrormode) getthreaderrormode = fallback_getthreaderrormode; return getthreaderrormode (); } /* A function called through the getthreaderrormode variable for cases where the system does not support GetThreadErrorMode or GetErrorMode */ static DWORD WINAPI fallback_getthreaderrormode (void) { /* Prior to Windows Vista, the only way to get the current error mode was to set a new one. In our case, we are setting a new error mode right after "getting" it while ignoring the error mode in effect when setting the new error mode, so that's fairly ok. */ return (DWORD) SetErrorMode (SEM_FAILCRITICALERRORS); } /* A function called through the setthreaderrormode variable which checks if the system supports SetThreadErrorMode and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); setthreaderrormode = (setthreaderrormode_type *) GetProcAddress (kernel32, "SetThreadErrorMode"); if (!setthreaderrormode) setthreaderrormode = fallback_setthreaderrormode; return setthreaderrormode (mode, oldmode); } /* A function called through the setthreaderrormode variable for cases where the system does not support SetThreadErrorMode. */ static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode) { /* Prior to Windows 7, there was no way to set the thread local error mode, so set the process global error mode instead. */ DWORD old = (DWORD) SetErrorMode (mode); if (oldmode) *oldmode = old; return TRUE; } parser-3.4.3/src/lib/ltdl/loaders/dyld.c000644 000000 000000 00000032536 11764645201 020160 0ustar00rootwheel000000 000000 /* loader-dyld.c -- dynamic linking on darwin and OS X Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Peter O'Gorman, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dyld_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dyld"; vtable->sym_prefix = "_"; vtable->dlloader_init = vl_init; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_MACH_O_DYLD_H) # if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) /* Is this correct? Does it still function properly? */ # define __private_extern__ extern # endif # include #endif #include /* We have to put some stuff here that isn't in older dyld.h files */ #if !defined(ENUM_DYLD_BOOL) # define ENUM_DYLD_BOOL # undef FALSE # undef TRUE enum DYLD_BOOL { FALSE, TRUE }; #endif #if !defined(LC_REQ_DYLD) # define LC_REQ_DYLD 0x80000000 #endif #if !defined(LC_LOAD_WEAK_DYLIB) # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #endif #if !defined(NSADDIMAGE_OPTION_NONE) # define NSADDIMAGE_OPTION_NONE 0x0 #endif #if !defined(NSADDIMAGE_OPTION_RETURN_ON_ERROR) # define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 #endif #if !defined(NSADDIMAGE_OPTION_WITH_SEARCHING) # define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 #endif #if !defined(NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED) # define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 #endif #if !defined(NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME) # define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) # define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 #endif #define LT__SYMLOOKUP_OPTS (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) #if defined(__BIG_ENDIAN__) # define LT__MAGIC MH_MAGIC #else # define LT__MAGIC MH_CIGAM #endif #define DYLD__SETMYERROR(errmsg) LT__SETERRORSTR (dylderror (errmsg)) #define DYLD__SETERROR(errcode) DYLD__SETMYERROR (LT__STRERROR (errcode)) typedef struct mach_header mach_header; typedef struct dylib_command dylib_command; static const char *dylderror (const char *errmsg); static const mach_header *lt__nsmodule_get_header (NSModule module); static const char *lt__header_get_instnam (const mach_header *mh); static const mach_header *lt__match_loadedlib (const char *name); static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh); static const mach_header *(*lt__addimage) (const char *image_name, unsigned long options) = 0; static NSSymbol (*lt__image_symbol) (const mach_header *image, const char *symbolName, unsigned long options) = 0; static enum DYLD_BOOL (*lt__image_symbol_p) (const mach_header *image, const char *symbolName) = 0; static enum DYLD_BOOL (*lt__module_export) (NSModule module) = 0; static int dyld_cannot_close = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data) { int errors = 0; if (! dyld_cannot_close) { if (!_dyld_present ()) { ++errors; } else { (void) _dyld_func_lookup ("__dyld_NSAddImage", (unsigned long*) <__addimage); (void) _dyld_func_lookup ("__dyld_NSLookupSymbolInImage", (unsigned long*)<__image_symbol); (void) _dyld_func_lookup ("__dyld_NSIsSymbolNameDefinedInImage", (unsigned long*) <__image_symbol_p); (void) _dyld_func_lookup ("__dyld_NSMakePrivateModulePublic", (unsigned long*) <__module_export); dyld_cannot_close = lt_dladderror ("can't close a dylib"); } } return errors; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = 0; NSObjectFileImage ofi = 0; if (!filename) { return (lt_module) -1; } switch (NSCreateObjectFileImageFromFile (filename, &ofi)) { case NSObjectFileImageSuccess: module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); NSDestroyObjectFileImage (ofi); if (module) { lt__module_export (module); } break; case NSObjectFileImageInappropriateFile: if (lt__image_symbol_p && lt__image_symbol) { module = (lt_module) lt__addimage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); } break; case NSObjectFileImageFailure: case NSObjectFileImageArch: case NSObjectFileImageFormat: case NSObjectFileImageAccess: /*NOWORK*/ break; } if (!module) { DYLD__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data, lt_module module) { int errors = 0; if (module != (lt_module) -1) { const mach_header *mh = (const mach_header *) module; int flags = 0; if (mh->magic == LT__MAGIC) { lt_dlseterror (dyld_cannot_close); ++errors; } else { /* Currently, if a module contains c++ static destructors and it is unloaded, we get a segfault in atexit(), due to compiler and dynamic loader differences of opinion, this works around that. */ if ((const struct section *) NULL != getsectbynamefromheader (lt__nsmodule_get_header (module), "__DATA", "__mod_term_func")) { flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; } #if defined(__ppc__) flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; #endif if (!NSUnLinkModule (module, flags)) { DYLD__SETERROR (CANNOT_CLOSE); ++errors; } } } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data, lt_module module, const char *name) { NSSymbol *nssym = 0; const mach_header *mh = (const mach_header *) module; char saveError[256] = "Symbol not found"; if (module == (lt_module) -1) { void *address, *unused; _dyld_lookup_and_bind (name, (unsigned long*) &address, &unused); return address; } if (mh->magic == LT__MAGIC) { if (lt__image_symbol_p && lt__image_symbol) { if (lt__image_symbol_p (mh, name)) { nssym = lt__image_symbol (mh, name, LT__SYMLOOKUP_OPTS); } } } else { nssym = NSLookupSymbolInModule (module, name); } if (!nssym) { strncpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255); saveError[255] = 0; if (!mh) { mh = (mach_header *)lt__nsmodule_get_header (module); } nssym = lt__linkedlib_symbol (name, mh); } if (!nssym) { LT__SETERRORSTR (saveError); } return nssym ? NSAddressOfSymbol (nssym) : 0; } /* --- HELPER FUNCTIONS --- */ /* Return the dyld error string, or the passed in error string if none. */ static const char * dylderror (const char *errmsg) { NSLinkEditErrors ler; int lerno; const char *file; const char *errstr; NSLinkEditError (&ler, &lerno, &file, &errstr); if (! (errstr && *errstr)) { errstr = errmsg; } return errstr; } /* There should probably be an apple dyld api for this. */ static const mach_header * lt__nsmodule_get_header (NSModule module) { int i = _dyld_image_count(); const char *modname = NSNameOfModule (module); const mach_header *mh = 0; if (!modname) return NULL; while (i > 0) { --i; if (strneq (_dyld_get_image_name (i), modname)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* NSAddImage is also used to get the loaded image, but it only works if the lib is installed, for uninstalled libs we need to check the install_names against each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result. */ static const char * lt__header_get_instnam (const mach_header *mh) { unsigned long offset = sizeof(mach_header); const char* result = 0; int j; for (j = 0; j < mh->ncmds; j++) { struct load_command *lc; lc = (struct load_command*) (((unsigned long) mh) + offset); if (LC_ID_DYLIB == lc->cmd) { result=(char*)(((dylib_command*) lc)->dylib.name.offset + (unsigned long) lc); } offset += lc->cmdsize; } return result; } static const mach_header * lt__match_loadedlib (const char *name) { const mach_header *mh = 0; int i = _dyld_image_count(); while (i > 0) { const char *id; --i; id = lt__header_get_instnam (_dyld_get_image_header (i)); if (id && strneq (id, name)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* Safe to assume our mh is good. */ static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh) { NSSymbol symbol = 0; if (lt__image_symbol && NSIsSymbolNameDefined (symname)) { unsigned long offset = sizeof(mach_header); struct load_command *lc; int j; for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*) (((unsigned long) mh) + offset); if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { unsigned long base = ((dylib_command *) lc)->dylib.name.offset; char *name = (char *) (base + (unsigned long) lc); const mach_header *mh1 = lt__match_loadedlib (name); if (!mh1) { /* Maybe NSAddImage can find it */ mh1 = lt__addimage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | NSADDIMAGE_OPTION_WITH_SEARCHING | NSADDIMAGE_OPTION_RETURN_ON_ERROR); } if (mh1) { symbol = lt__image_symbol (mh1, symname, LT__SYMLOOKUP_OPTS); if (symbol) break; } } offset += lc->cmdsize; } } return symbol; } parser-3.4.3/src/lib/ltdl/loaders/preopen.c000644 000000 000000 00000022455 11764645201 020673 0ustar00rootwheel000000 000000 /* loader-preopen.c -- emulate dynamic linking using preloaded_symbols Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable preopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_preopen"; vtable->sym_prefix = 0; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_init = vl_init; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ /* Wrapper type to chain together symbol lists of various origins. */ typedef struct symlist_chain { struct symlist_chain *next; const lt_dlsymlist *symlist; } symlist_chain; static int add_symlist (const lt_dlsymlist *symlist); static int free_symlists (void); /* The start of the symbol lists chain. */ static symlist_chain *preloaded_symlists = 0; /* A symbol list preloaded before lt_init() was called. */ static const lt_dlsymlist *default_preloaded_symbols = 0; /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data LT__UNUSED loader_data) { int errors = 0; preloaded_symlists = 0; if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } return errors; } /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; free_symlists (); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { symlist_chain *lists; lt_module module = 0; if (!preloaded_symlists) { LT__SETERROR (NO_SYMBOLS); goto done; } /* Can't use NULL as the reflective symbol header, as NULL is used to mark the end of the entire symbol list. Self-dlpreopened symbols follow this magic number, chosen to be an unlikely clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; } for (lists = preloaded_symlists; lists; lists = lists->next) { const lt_dlsymlist *symbol; for (symbol= lists->symlist; symbol->name; ++symbol) { if (!symbol->address && streq (symbol->name, filename)) { /* If the next symbol's name and address is 0, it means the module just contains the originator and no symbols. In this case we pretend that we never saw the module and hope that some other loader will be able to load the module and have access to its symbols */ const lt_dlsymlist *next_symbol = symbol +1; if (next_symbol->address && next_symbol->name) { module = (lt_module) lists->symlist; goto done; } } } } LT__SETERROR (FILE_NOT_FOUND); done: return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module) { /* Just to silence gcc -Wall */ module = 0; return 0; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { lt_dlsymlist *symbol = (lt_dlsymlist*) module; symbol +=2; /* Skip header (originator then libname). */ while (symbol->name) { if (streq (symbol->name, name)) { return symbol->address; } ++symbol; } LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } /* --- HELPER FUNCTIONS --- */ /* The symbol lists themselves are not allocated from the heap, but we can unhook them and free up the chain of links between them. */ static int free_symlists (void) { symlist_chain *lists; lists = preloaded_symlists; while (lists) { symlist_chain *next = lists->next; FREE (lists); lists = next; } preloaded_symlists = 0; return 0; } /* Add a new symbol list to the global chain. */ static int add_symlist (const lt_dlsymlist *symlist) { symlist_chain *lists; int errors = 0; /* Search for duplicate entries: */ for (lists = preloaded_symlists; lists && lists->symlist != symlist; lists = lists->next) /*NOWORK*/; /* Don't add the same list twice: */ if (!lists) { symlist_chain *tmp = (symlist_chain *) lt__zalloc (sizeof *tmp); if (tmp) { tmp->symlist = symlist; tmp->next = preloaded_symlists; preloaded_symlists = tmp; } else { ++errors; } } return errors; } /* --- PRELOADING API CALL IMPLEMENTATIONS --- */ /* Save a default symbol list for later. */ int lt_dlpreload_default (const lt_dlsymlist *preloaded) { default_preloaded_symbols = preloaded; return 0; } /* Add a symbol list to the global chain, or with a NULL argument, revert to just the default list. */ int lt_dlpreload (const lt_dlsymlist *preloaded) { int errors = 0; if (preloaded) { errors = add_symlist (preloaded); } else { free_symlists(); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } } return errors; } /* Open all the preloaded modules from the named originator, executing a callback for each one. If ORIGINATOR is NULL, then call FUNC for each preloaded module from the program itself. */ int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) { symlist_chain *list; int errors = 0; int found = 0; /* For each symlist in the chain... */ for (list = preloaded_symlists; list; list = list->next) { /* ...that was preloaded by the requesting ORIGINATOR... */ if ((originator && streq (list->symlist->name, originator)) || (!originator && streq (list->symlist->name, "@PROGRAM@"))) { const lt_dlsymlist *symbol; unsigned int idx = 0; ++found; /* ...load the symbols per source compilation unit: (we preincrement the index to skip over the originator entry) */ while ((symbol = &list->symlist[++idx])->name != 0) { if ((symbol->address == 0) && (strneq (symbol->name, "@PROGRAM@"))) { lt_dlhandle handle = lt_dlopen (symbol->name); if (handle == 0) { ++errors; } else { errors += (*func) (handle); } } } } } if (!found) { LT__SETERROR(CANNOT_OPEN); ++errors; } return errors; } parser-3.4.3/src/lib/ltdl/loaders/load_add_on.c000644 000000 000000 00000011304 11764645201 021435 0ustar00rootwheel000000 000000 /* loader-load_add_on.c -- dynamic linking for BeOS Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable load_add_on_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_load_add_on"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { image_id image = 0; if (filename) { image = load_add_on (filename); } else { image_info info; int32 cookie = 0; if (get_next_image_info (0, &cookie, &info) == B_OK) image = load_add_on (info.name); } if (image <= 0) { LT__SETERROR (CANNOT_OPEN); image = 0; } return (lt_module) image; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (unload_add_on ((image_id) module) != B_OK) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = 0; image_id image = (image_id) module; if (get_image_symbol (image, name, B_SYMBOL_TYPE_ANY, address) != B_OK) { LT__SETERROR (SYMBOL_NOT_FOUND); address = 0; } return address; } parser-3.4.3/src/lib/ltdl/libltdl/lt__alloc.h000644 000000 000000 00000004223 11764645200 021145 0ustar00rootwheel000000 000000 /* lt__alloc.h -- internal memory management interface Copyright (C) 2004 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__ALLOC_H) #define LT__ALLOC_H 1 #include "lt_system.h" LT_BEGIN_C_DECLS #define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp)) #define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp)) #define FREE(mem) LT_STMT_START { \ if (mem) { free ((void *)mem); mem = NULL; } } LT_STMT_END #define MEMREASSIGN(p, q) LT_STMT_START { \ if ((p) != (q)) { if (p) free (p); (p) = (q); (q) = 0; } \ } LT_STMT_END /* If set, this function is called when memory allocation has failed. */ LT_SCOPE void (*lt__alloc_die) (void); LT_SCOPE void *lt__malloc (size_t n); LT_SCOPE void *lt__zalloc (size_t n); LT_SCOPE void *lt__realloc (void *mem, size_t n); LT_SCOPE void *lt__memdup (void const *mem, size_t n); LT_SCOPE char *lt__strdup (const char *string); LT_END_C_DECLS #endif /*!defined(LT__ALLOC_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt__glibc.h000644 000000 000000 00000005335 11770443336 021143 0ustar00rootwheel000000 000000 /* lt__glibc.h -- support for non glibc environments Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__GLIBC_H) #define LT__GLIBC_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #if !defined(HAVE_ARGZ_H) || !defined(HAVE_WORKING_ARGZ) /* Redefine any glibc symbols we reimplement to import the implementations into our lt__ namespace so we don't ever clash with the system library if our clients use argz_* from there in addition to libltdl. */ # undef argz_append # define argz_append lt__argz_append # undef argz_create_sep # define argz_create_sep lt__argz_create_sep # undef argz_insert # define argz_insert lt__argz_insert # undef argz_next # define argz_next lt__argz_next # undef argz_stringify # define argz_stringify lt__argz_stringify #endif #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_WORKING_ARGZ #include #else #include #endif #ifdef __cplusplus } #endif # define slist_concat lt__slist_concat # define slist_cons lt__slist_cons # define slist_delete lt__slist_delete # define slist_remove lt__slist_remove # define slist_reverse lt__slist_reverse # define slist_sort lt__slist_sort # define slist_tail lt__slist_tail # define slist_nth lt__slist_nth # define slist_find lt__slist_find # define slist_length lt__slist_length # define slist_foreach lt__slist_foreach # define slist_box lt__slist_box # define slist_unbox lt__slist_unbox #include #endif /*!defined(LT__GLIBC_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt__private.h000644 000000 000000 00000010650 11764645200 021526 0ustar00rootwheel000000 000000 /* lt__private.h -- internal apis for libltdl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy con be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__PRIVATE_H) #define LT__PRIVATE_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #if defined(HAVE_UNISTD_H) # include #endif /* Import internal interfaces... */ #include "lt__alloc.h" #include "lt__dirent.h" #include "lt__strl.h" #include "lt__glibc.h" /* ...and all exported interfaces. */ #include "ltdl.h" #if defined(WITH_DMALLOC) # include #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #ifndef LT_GLOBAL_DATA # if defined(__WINDOWS__) || defined(__CYGWIN__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ # define LT_GLOBAL_DATA __declspec(dllexport) # endif # endif # ifndef LT_GLOBAL_DATA # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */ # endif #endif #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif #endif #ifndef LT__UNUSED # define LT__UNUSED __attribute__ ((__unused__)) #endif LT_BEGIN_C_DECLS #if !defined(errno) extern int errno; #endif LT_SCOPE void lt__alloc_die_callback (void); /* For readability: */ #define strneq(s1, s2) (strcmp((s1), (s2)) != 0) #define streq(s1, s2) (!strcmp((s1), (s2))) /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ /* This type is used for the array of interface data sets in each handler. */ typedef struct { lt_dlinterface_id key; void * data; } lt_interface_data; struct lt__handle { lt_dlhandle next; const lt_dlvtable * vtable; /* dlopening interface */ lt_dlinfo info; /* user visible fields */ int depcount; /* number of dependencies */ lt_dlhandle * deplibs; /* dependencies */ lt_module module; /* system module handle */ void * system; /* system specific data */ lt_interface_data * interface_data; /* per caller associated data */ int flags; /* various boolean stats */ }; struct lt__advise { unsigned int try_ext:1; /* try system library extensions. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ unsigned int try_preload_only:1;/* only preloaded modules will be tried. */ }; /* --- ERROR HANDLING --- */ /* Extract the diagnostic strings from the error table macro in the same order as the enumerated indices in lt_error.h. */ #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name)) #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error() #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg) #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode)) LT_SCOPE const char *lt__error_string (int errorcode); LT_SCOPE const char *lt__get_last_error (void); LT_SCOPE const char *lt__set_last_error (const char *errormsg); LT_END_C_DECLS #endif /*!defined(LT__PRIVATE_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt__dirent.h000644 000000 000000 00000004724 11764645200 021346 0ustar00rootwheel000000 000000 /* lt__dirent.h -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__DIRENT_H) #define LT__DIRENT_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include "lt_system.h" #ifdef HAVE_DIRENT_H /* We have a fully operational dirent subsystem. */ # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) #elif defined __WINDOWS__ /* Use some wrapper code to emulate dirent on windows.. */ # define WINDOWS_DIRENT_EMULATION 1 # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) # define dirent lt__dirent # define DIR lt__DIR # define opendir lt__opendir # define readdir lt__readdir # define closedir lt__closedir LT_BEGIN_C_DECLS struct dirent { char d_name[LT_FILENAME_MAX]; int d_namlen; }; typedef struct { HANDLE hSearch; WIN32_FIND_DATA Win32FindData; BOOL firsttime; struct dirent file_info; } DIR; LT_SCOPE DIR * opendir (const char *path); LT_SCOPE struct dirent *readdir (DIR *entry); LT_SCOPE void closedir (DIR *entry); LT_END_C_DECLS #else /* !defined(__WINDOWS__)*/ ERROR - cannot find dirent #endif /*!defined(__WINDOWS__)*/ #endif /*!defined(LT__DIRENT_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/slist.h000644 000000 000000 00000006231 11764645200 020354 0ustar00rootwheel000000 000000 /* slist.h -- generalised singly linked lists Copyright (C) 2000, 2004, 2009 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* A generalised list. This is deliberately transparent so that you can make the NEXT field of all your chained data structures first, and then cast them to `(SList *)' so that they can be manipulated by this API. Alternatively, you can generate raw SList elements using slist_new(), and put the element data in the USERDATA field. Either way you get to manage the memory involved by yourself. */ #if !defined(SLIST_H) #define SLIST_H 1 #if defined(LTDL) # include # include #else # define LT_SCOPE #endif #include #if defined(__cplusplus) extern "C" { #endif typedef struct slist { struct slist *next; /* chain forward pointer*/ const void *userdata; /* for boxed `SList' item */ } SList; typedef void * SListCallback (SList *item, void *userdata); typedef int SListCompare (const SList *item1, const SList *item2, void *userdata); LT_SCOPE SList *slist_concat (SList *head, SList *tail); LT_SCOPE SList *slist_cons (SList *item, SList *slist); LT_SCOPE SList *slist_delete (SList *slist, void (*delete_fct) (void *item)); LT_SCOPE SList *slist_remove (SList **phead, SListCallback *find, void *matchdata); LT_SCOPE SList *slist_reverse (SList *slist); LT_SCOPE SList *slist_sort (SList *slist, SListCompare *compare, void *userdata); LT_SCOPE SList *slist_tail (SList *slist); LT_SCOPE SList *slist_nth (SList *slist, size_t n); LT_SCOPE void * slist_find (SList *slist, SListCallback *find, void *matchdata); LT_SCOPE size_t slist_length (SList *slist); LT_SCOPE void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata); LT_SCOPE SList *slist_box (const void *userdata); LT_SCOPE void * slist_unbox (SList *item); #if defined(__cplusplus) } #endif #if !defined(LTDL) # undef LT_SCOPE #endif #endif /*!defined(SLIST_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt__strl.h000644 000000 000000 00000003700 11764645200 021036 0ustar00rootwheel000000 000000 /* lt__strl.h -- size-bounded string copying and concatenation Copyright (C) 2004, 2006 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT__STRL_H) #define LT__STRL_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include #include "lt_system.h" #if !defined(HAVE_STRLCAT) # define strlcat(dst,src,dstsize) lt_strlcat(dst,src,dstsize) LT_SCOPE size_t lt_strlcat(char *dst, const char *src, const size_t dstsize); #endif /* !defined(HAVE_STRLCAT) */ #if !defined(HAVE_STRLCPY) # define strlcpy(dst,src,dstsize) lt_strlcpy(dst,src,dstsize) LT_SCOPE size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize); #endif /* !defined(HAVE_STRLCPY) */ #endif /*!defined(LT__STRL_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt_dlloader.h000644 000000 000000 00000006200 11764645200 021477 0ustar00rootwheel000000 000000 /* lt_dlloader.h -- dynamic library loader interface Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT_DLLOADER_H) #define LT_DLLOADER_H 1 #include LT_BEGIN_C_DECLS typedef void * lt_dlloader; typedef void * lt_module; typedef void * lt_user_data; typedef struct lt__advise * lt_dladvise; /* Function pointer types for module loader vtable entries: */ typedef lt_module lt_module_open (lt_user_data data, const char *filename, lt_dladvise advise); typedef int lt_module_close (lt_user_data data, lt_module module); typedef void * lt_find_sym (lt_user_data data, lt_module module, const char *symbolname); typedef int lt_dlloader_init (lt_user_data data); typedef int lt_dlloader_exit (lt_user_data data); /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */ typedef enum { LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND } lt_dlloader_priority; /* This structure defines a module loader, as populated by the get_vtable entry point of each loader. */ typedef struct { const char * name; const char * sym_prefix; lt_module_open * module_open; lt_module_close * module_close; lt_find_sym * find_sym; lt_dlloader_init * dlloader_init; lt_dlloader_exit * dlloader_exit; lt_user_data dlloader_data; lt_dlloader_priority priority; } lt_dlvtable; LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable); LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader); LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader); /* Type of a function to get a loader's vtable: */ typedef const lt_dlvtable *lt_get_vtable (lt_user_data data); #ifdef LT_DEBUG_LOADERS LT_SCOPE void lt_dlloader_dump (void); #endif LT_END_C_DECLS #endif /*!defined(LT_DLLOADER_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt_system.h000644 000000 000000 00000012373 11764645200 021245 0ustar00rootwheel000000 000000 /* lt_system.h -- system portability abstraction layer Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT_SYSTEM_H) #define LT_SYSTEM_H 1 #include #include #include /* Some systems do not define EXIT_*, even with STDC_HEADERS. */ #if !defined(EXIT_SUCCESS) # define EXIT_SUCCESS 0 #endif #if !defined(EXIT_FAILURE) # define EXIT_FAILURE 1 #endif /* Just pick a big number... */ #define LT_FILENAME_MAX 2048 /* Saves on those hard to debug '\0' typos.... */ #define LT_EOS_CHAR '\0' /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ #if defined(__cplusplus) # define LT_BEGIN_C_DECLS extern "C" { # define LT_END_C_DECLS } #else # define LT_BEGIN_C_DECLS /* empty */ # define LT_END_C_DECLS /* empty */ #endif /* LT_STMT_START/END are used to create macros which expand to a a single compound statement in a portable way. */ #if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) # define LT_STMT_START (void)( # define LT_STMT_END ) #else # if (defined (sun) || defined (__sun__)) # define LT_STMT_START if (1) # define LT_STMT_END else (void)0 # else # define LT_STMT_START do # define LT_STMT_END while (0) # endif #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* Canonicalise Windows and Cygwin recognition macros. To match the values set by recent Cygwin compilers, make sure that if __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */ #if defined(__CYGWIN32__) && !defined(__CYGWIN__) # define __CYGWIN__ __CYGWIN32__ #endif #if defined(__CYGWIN__) # if defined(__WINDOWS__) # undef __WINDOWS__ # endif #elif defined(_WIN32) # define __WINDOWS__ _WIN32 #elif defined(WIN32) # define __WINDOWS__ WIN32 #endif #if defined(__CYGWIN__) && defined(__WINDOWS__) # undef __WINDOWS__ #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #if !defined(LT_SCOPE) # if defined(__WINDOWS__) || defined(__CYGWIN__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ # define LT_SCOPE extern __declspec(dllexport) # endif # if defined(LIBLTDL_DLL_IMPORT) /* define if linking with this dll */ /* note: cygwin/mingw compilers can rely instead on auto-import */ # define LT_SCOPE extern __declspec(dllimport) # endif # endif # if !defined(LT_SCOPE) /* static linking or !__WINDOWS__ */ # define LT_SCOPE extern # endif #endif #if defined(__WINDOWS__) /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory separator when it is set. */ # define LT_DIRSEP_CHAR '\\' # define LT_PATHSEP_CHAR ';' #else # define LT_PATHSEP_CHAR ':' #endif #if defined(_MSC_VER) /* Visual Studio */ # define R_OK 4 #endif /* fopen() mode flags for reading a text file */ #undef LT_READTEXT_MODE #if defined(__WINDOWS__) || defined(__CYGWIN__) # define LT_READTEXT_MODE "rt" #else # define LT_READTEXT_MODE "r" #endif /* The extra indirection to the LT__STR and LT__CONC macros is required so that if the arguments to LT_STR() (or LT_CONC()) are themselves macros, they will be expanded before being quoted. */ #ifndef LT_STR # define LT__STR(arg) #arg # define LT_STR(arg) LT__STR(arg) #endif #ifndef LT_CONC # define LT__CONC(a, b) a##b # define LT_CONC(a, b) LT__CONC(a, b) #endif #ifndef LT_CONC3 # define LT__CONC3(a, b, c) a##b##c # define LT_CONC3(a, b, c) LT__CONC3(a, b, c) #endif #endif /*!defined(LT_SYSTEM_H)*/ parser-3.4.3/src/lib/ltdl/libltdl/lt_error.h000644 000000 000000 00000007072 11764645200 021052 0ustar00rootwheel000000 000000 /* lt_error.h -- error propogation interface Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl 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 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined(LT_ERROR_H) #define LT_ERROR_H 1 #include LT_BEGIN_C_DECLS /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly onto the table of error strings. \0 is appended to the strings to expilicitely initialize the string terminator. */ #define lt_dlerror_table \ LT_ERROR(UNKNOWN, "unknown error\0") \ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \ LT_ERROR(INVALID_LOADER, "invalid loader\0") \ LT_ERROR(INIT_LOADER, "loader initialization failed\0") \ LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \ LT_ERROR(FILE_NOT_FOUND, "file not found\0") \ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \ LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \ LT_ERROR(CANNOT_OPEN, "can't open the module\0") \ LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \ LT_ERROR(NO_MEMORY, "not enough memory\0") \ LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \ LT_ERROR(SHUTDOWN, "library already shutdown\0") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \ LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\ LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\ LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0") /* Enumerate the symbolic error names. */ enum { #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), lt_dlerror_table #undef LT_ERROR LT_ERROR_MAX }; /* Should be max of the error string lengths above (plus one for C++) */ #define LT_ERROR_LEN_MAX (41) /* These functions are only useful from inside custom module loaders. */ LT_SCOPE int lt_dladderror (const char *diagnostic); LT_SCOPE int lt_dlseterror (int errorcode); LT_END_C_DECLS #endif /*!defined(LT_ERROR_H)*/ parser-3.4.3/src/lib/ltdl/config/depcomp000755 000000 000000 00000044267 11764645177 020271 0ustar00rootwheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -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. 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 tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. 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 tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. 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 # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done 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 "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" 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 "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/src/lib/ltdl/config/ltmain.sh000644 000000 000000 00001051522 11764645200 020510 0ustar00rootwheel000000 000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # 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+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 parser-3.4.3/src/lib/ltdl/config/install-sh000755 000000 000000 00000033256 11764645200 020677 0ustar00rootwheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false 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: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/src/lib/ltdl/config/missing000755 000000 000000 00000026233 11764645200 020267 0ustar00rootwheel000000 000000 #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # 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 ;; -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' autom4te touch the output file, or create a stub one 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] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) 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*) 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*) 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*) 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*) 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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 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 test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -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 test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) 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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) 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." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/src/lib/ltdl/config/config.sub000755 000000 000000 00000105052 11764645177 020665 0ustar00rootwheel000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-10-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: parser-3.4.3/src/lib/ltdl/config/compile000755 000000 000000 00000015330 11764645177 020257 0ustar00rootwheel000000 000000 #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2010-11-15.09; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software # Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Win32 hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l*) lib=${1#-l} found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes set x "$@" "$dir/$lib.dll.lib" break fi if test -f "$dir/$lib.lib"; then found=yes set x "$@" "$dir/$lib.lib" break fi done IFS=$save_IFS test "$found" != yes && set x "$@" "$lib.lib" shift ;; -L*) func_file_conv "${1#-L}" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.4.3/src/lib/ltdl/config/config.guess000755 000000 000000 00000126755 11764645177 021237 0ustar00rootwheel000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-10-01' # This file 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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 Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo hexagon-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: parser-3.4.3/src/lib/smtp/smtp.C000644 000000 000000 00000026771 12173246362 016546 0ustar00rootwheel000000 000000 /** @file Parser: SMTP sender. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) Parts of the code here is based upon an early gensock and blat */ #include "pa_exception.h" #include "smtp.h" volatile const char * IDENT_SMTP_C="$Id: smtp.C,v 1.10 2013/07/22 15:17:06 moko Exp $" IDENT_SMTP_H; #undef snprintf // pa_common.C extern int __snprintf(char *, size_t, const char* , ...); #define snprintf __snprintf //#define DEBUG_SHOW SMTP::SMTP() { the_socket = 0; in_index = 0; out_index = 0; in_buffer = 0; in_buffer_total = 0; out_buffer_total = 0; in_buffer = (char *)malloc(SOCKET_BUFFER_SIZE); out_buffer = (char *)malloc(SOCKET_BUFFER_SIZE); last_winsock_error = 0; } SMTP::~SMTP() { free(in_buffer); free(out_buffer); } // --------------------------------------------------------------------------- void SMTP:: ConnectToHost(const char* hostname, const char* service) { struct sockaddr_in sa_in; memset(&sa_in, 0, sizeof(sa_in)); u_short our_port; if( !ResolveService(service, &our_port) ) { if( !ResolveHostname(hostname, &sa_in) ) { sa_in.sin_family = AF_INET; sa_in.sin_port = (unsigned short)our_port; if( !GetAndSetTheSocket(&the_socket) ) { if( !GetConnection(the_socket, &sa_in) ) { MiscSocketSetup(the_socket, &fds, &timeout); return; } } } } CloseConnect(); throw Exception("smtp.connect", 0, "connect to %s:%s failed", hostname, service); } //--------------------------------------------------------------------------- // returns 0 if all is OK int SMTP:: GetBuffer(int wait) { int retval; int bytes_read = 0; // Use select to see if data is waiting... FD_ZERO(&fds); FD_SET(the_socket, &fds); // if wait is set, we are polling, return immediately if( wait ) { timeout.tv_sec = 0; } else { timeout.tv_sec = 30; } if( (retval = select(1+the_socket, &fds, NULL, NULL, &timeout))<0 ) { #ifdef _MSC_VER int error_code = WSAGetLastError(); if( error_code == WSAEINPROGRESS && wait ) { return WAIT_A_BIT; } #else if( errno == EAGAIN && wait ) return WAIT_A_BIT; #endif } // if we don't want to wait if( !retval && wait ) { return WAIT_A_BIT; } // we have data waiting... bytes_read = recv(the_socket, in_buffer, SOCKET_BUFFER_SIZE, 0); // just in case. if( 0 == bytes_read ) { // connection terminated (semi-) gracefully by the other side return WSAENOTCONN; } if( bytes_read <0 ) { //char what_error[256]; int ws_error = WSAGetLastError(); switch( ws_error ) { // all these indicate loss of connection (are there more?) case WSAENOTCONN: case WSAENETDOWN: case WSAENETUNREACH: case WSAENETRESET: case WSAECONNABORTED: case WSAECONNRESET: return WSAENOTCONN; case WSAEWOULDBLOCK: return WAIT_A_BIT; default: /*wsprintf(what_error, "GetBuffer() unexpected error: %d", ws_error); ShowError(what_error); */ break; } } // reset buffer indices. in_buffer_total = bytes_read; in_index = 0; return 0; } //--------------------------------------------------------------------------- // returns 0 if all is OK int SMTP:: GetChar(int wait, char *ch) { int retval = 0; if( in_index >= in_buffer_total ) { if( 0 != (retval = GetBuffer(wait)) ) return retval; } *ch = in_buffer[in_index++]; return 0; } //---------------------------------------------------------------------- int SMTP:: get_line( void ) { char ch = '.'; char in_data[MAXOUTLINE]; char *index; index = in_data; while( ch != '\n' ) { if( 0 != GetChar(0, &ch) ) { return -1; } else { *index = ch; index++; } } if( in_data[3] == '-' ) return get_line(); else { char *error_pos; return strtol(in_data, &error_pos, 0); } } //--------------------------------------------------------------------------- // returns 0 if all is OK void SMTP:: SendLine(const char* data, unsigned long length) { int num_sent; FD_ZERO(&fds); FD_SET(the_socket, &fds); timeout.tv_sec = 30; while( length > 0 ) { if( select(1+the_socket, NULL, &fds, NULL, &timeout)<0 ) throw Exception("smtp.execute", 0, "connection::put_data() unexpected error from select: %d", WSAGetLastError()); num_sent = send(the_socket, data, length > 1024 ? 1024 : (int)length, 0); if( num_sent<0 ) { int ws_error = WSAGetLastError(); switch( ws_error ) { // this is the only error we really expect to see. case WSAENOTCONN: return; // seems that we can still get a block case WSAEWOULDBLOCK: break; default: throw Exception("smtp.execute", 0, "connection::put_data() unexpected error from send(): %d", ws_error); } } else { length -= num_sent; data += num_sent; } } } //--------------------------------------------------------------------------- // returns 0 if all is OK void SMTP:: SendBuffer(const char* data, unsigned long length) { while( length ) { if( (out_index + length) < SOCKET_BUFFER_SIZE ) { // we won't overflow, simply copy into the buffer memcpy(out_buffer + out_index, data, length); out_index += length; length = 0; } else { unsigned int orphaned_chunk = SOCKET_BUFFER_SIZE - out_index; // we will overflow, handle it memcpy(out_buffer + out_index, data, orphaned_chunk); // send this buffer... SendLine(out_buffer, SOCKET_BUFFER_SIZE); length -= orphaned_chunk; out_index = 0; data += orphaned_chunk; } } } //--------------------------------------------------------------------------- // returns 0 if all is OK void SMTP:: FlushBuffer() { SendLine(out_buffer, out_index); out_index = 0; } //--------------------------------------------------------------------------- bool SMTP:: CloseConnect() { if( closesocket(the_socket) <0 ) return false; return true; } //---------------------------------------------------------------------- void SMTP:: SendSmtpError(const char* message) { SendLine("QUIT\r\n", 6); CloseConnect(); throw Exception("smtp.execute", 0, "failed: %s", message); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 20, 21, 22, 23, 24, 25 if SendBuffer() fails // returns 26 if FlushBuffer() fails void SMTP:: transform_and_send_edit_data(const char* editptr ) { const char *index; char previous_char = 'x'; unsigned int send_len; bool done = false; send_len = strlen(editptr); index = editptr; while( !done ) { // room for extra char for double dot on end case while( (unsigned int)(index - editptr) < send_len ) { switch( *index ) { case '.': if( previous_char == '\n' ) SendBuffer(index, 1); // send _two_ dots... SendBuffer(index, 1); break; case '\n': // x\n -> \r\n if( previous_char != '\r' ) { SendBuffer("\r", 1); SendBuffer(index, 1); } break; default: SendBuffer(index, 1); break; } previous_char = *index; index++; } if( (unsigned int)(index - editptr) == send_len ) done = true; } // this handles the case where the user doesn't end the last // line with a if( editptr[send_len-1] != '\n' ) SendBuffer("\r\n.\r\n", 5); else SendBuffer(".\r\n", 3); /* now make sure it's all sent... */ FlushBuffer(); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 16 if any get_line()'s fail // returns 20, 21, 22, 23, 24, 25, 26 if transform_and_send_edit_data() fails void SMTP:: send_data(const char* message) { transform_and_send_edit_data(message); if( 250 != get_line() ) SendSmtpError("Message not accepted by server"); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 50, 51, 52 if fails void SMTP:: open_socket( const char* server, const char* service ) { ConnectToHost(server, service); if( gethostname(my_hostname, sizeof(my_hostname)) ) throw Exception("smtp.connect", 0, "lookup of '%s' failed", my_hostname); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 50, 51, 52 if open_socket() fails // returns 10, 11, 12, 13, 14, 15 if any get_line()'s fail void SMTP:: prepare_message(char *from, char *to, const char* server, const char* service) { char out_data[MAXOUTLINE]; char *ptr; int len; int startLen; open_socket(server, service); if( 220 != get_line() ) SendSmtpError("SMTP server error"); snprintf(out_data, sizeof(out_data), "HELO %s\r\n", my_hostname ); SendLine(out_data, strlen(out_data) ); if( 250 != get_line() ) SendSmtpError("SMTP server error"); snprintf(out_data, sizeof(out_data), "MAIL From: <%s>\r\n", from); SendLine(out_data, strlen(out_data) ); if( 250 != get_line() ) SendSmtpError("The mail server doesn't like the sender name, have you set your mail address correctly?"); // do a series of RCPT lines for each name in address line for( ptr = to; *ptr; ptr += len + 1 ) { // if there's only one token left, then len will = startLen, // and we'll iterate once only startLen = strlen(ptr); if( (len = strcspn(ptr, " ,\n\t\r")) != startLen ) { ptr[len] = '\0'; // replace delim with NULL char while( strchr (" ,\n\t\r", ptr[len+1]) ) // eat white space ptr[len++] = '\0'; } snprintf(out_data, sizeof(out_data), "RCPT To: <%s>\r\n", ptr); SendLine(out_data, strlen(out_data) ); if( 250 != get_line() ) throw Exception("smtp.execute", 0, "The mail server doesn't like the name %s. Have you set the 'To: ' field correctly?", ptr); if( len == startLen ) // last token, we're done break; } snprintf(out_data, sizeof(out_data), "DATA\r\n"); SendLine(out_data, strlen(out_data)); if( 354 != get_line() ) SendSmtpError("Mail server error accepting message data"); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // returns 0 if all is OK // returns 1 if MakeSmtpHeader() fails // returns 10, 11, 12, 13, 14, 15, 50, 51, 52 if prepare_message() fails void SMTP:: Send(const char* server, const char* service, const char* msg, char *from, char *to) { #ifdef DEBUG_SHOW throw Exception("paf.debug",0,"from=%s|to=%s|msg=%s", from,to,msg); #endif prepare_message( from, to, server, service); send_data(msg); SendLine("QUIT\r\n", 6 ); CloseConnect(); } parser-3.4.3/src/lib/smtp/Makefile.in000644 000000 000000 00000036172 11766635216 017527 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/smtp DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsmtp_la_LIBADD = am_libsmtp_la_OBJECTS = comms.lo smtp.lo libsmtp_la_OBJECTS = $(am_libsmtp_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libsmtp_la_SOURCES) DIST_SOURCES = $(libsmtp_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I../gc/include -I../cord/include noinst_HEADERS = smtp.h noinst_LTLIBRARIES = libsmtp.la libsmtp_la_SOURCES = comms.C smtp.C EXTRA_DIST = smtp.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/smtp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/smtp/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libsmtp.la: $(libsmtp_la_OBJECTS) $(libsmtp_la_DEPENDENCIES) $(CXXLINK) $(libsmtp_la_OBJECTS) $(libsmtp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-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: parser-3.4.3/src/lib/smtp/comms.C000644 000000 000000 00000007632 12173246362 016674 0ustar00rootwheel000000 000000 /** @file Parser: SMTP sender impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "smtp.h" volatile const char * IDENT_COMMS_C="$Id: comms.C,v 1.10 2013/07/22 15:17:06 moko Exp $"; // --------------------------------------------------------------------------- int SMTP:: IsAddressARawIpaddress(const char* string) { while( *string ) { if( !isdigit((unsigned char)*string) ) { return 0; } string++; } return 1; } //--------------------------------------------------------------------------- ///@bug getservbyname is not reenterant int SMTP:: ResolveService(const char* service, u_short *our_port) { struct servent *serventry = NULL; if( IsAddressARawIpaddress(service) ) { char * tail; *our_port = (u_short)strtol(service, &tail, 10); if( tail == service ) { return WSAEPROTONOSUPPORT; } else { *our_port = htons(*our_port); } } else { serventry = getservbyname(service, "tcp"); if( serventry ) *our_port = serventry->s_port; else { #ifdef _MSC_VER int retval = WSAGetLastError(); if( (retval == WSANO_DATA) || (retval == WSANO_RECOVERY) ) { return WSAEPROTONOSUPPORT; } else { return (retval - 5000); } #else return WSAEPROTONOSUPPORT; #endif } } return 0; } //--------------------------------------------------------------------------- /// @bug gethostbyname is not reenterant int SMTP:: ResolveHostname(const char* hostname, struct sockaddr_in *sa_in) { struct hostent *hostentry = NULL; unsigned long ip_address; if( (ip_address = inet_addr(hostname)) != INADDR_NONE ) { sa_in->sin_addr.s_addr = ip_address; } else { if( (hostentry = gethostbyname(hostname)) == NULL ) { return WSAHOST_NOT_FOUND; } sa_in->sin_addr.s_addr = *(long *)hostentry->h_addr; } return 0; } //--------------------------------------------------------------------------- int SMTP:: GetAndSetTheSocket(SOCKET *the_socket) { if( INVALID_SOCKET == (*the_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP/*áûë 0, âëîæåííî íå ðàáîòàë*/)) ) { return WSAESOCKTNOSUPPORT; } // To enable SO_DONTLINGER (that is, disable SO_LINGER) // l_onoff should be set to zero and setsockopt should be called linger dont_linger={0,0}; setsockopt(*the_socket, SOL_SOCKET, SO_LINGER, (const char *)&dont_linger, sizeof(dont_linger)); return 0; } //--------------------------------------------------------------------------- int SMTP:: GetConnection(SOCKET the_socket, struct sockaddr_in *sa_in) { if( connect(the_socket, (struct sockaddr *)sa_in, sizeof(struct sockaddr_in))<0 ) { int retval = 0; switch( (retval = WSAGetLastError()) ) { case WSAEWOULDBLOCK: break; case WSAECONNREFUSED: return WSAECONNREFUSED; default: //wsprintf(message, "unexpected error %d from winsock\n", retval); //ShowError(message); return WSAHOST_NOT_FOUND; } } return 0; } //--------------------------------------------------------------------------- void SMTP:: MiscSocketSetup(SOCKET soc, fd_set *fds, struct timeval *timeout) { #ifdef _MSC_VER unsigned long ioctl_blocking = 1; ioctlsocket(soc, FIONBIO, &ioctl_blocking); #endif FD_ZERO(fds); FD_SET(soc, fds); timeout->tv_sec = 30; timeout->tv_usec = 0; } //--------------------------------------------------------------------------- parser-3.4.3/src/lib/smtp/smtp.h000644 000000 000000 00000007450 12173513464 016604 0ustar00rootwheel000000 000000 /** @file Parser: SMTP sender decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #define IDENT_SMTP_H "$Id: smtp.h,v 1.12 2013/07/23 14:46:12 moko Exp $" #include "pa_string.h" #ifdef _MSC_VER #include #else //_MSC_VER typedef char CHAR; typedef u_int SOCKET; #define closesocket close inline int WSAGetLastError() { return errno; } #ifdef EPROTONOSUPPORT # define WSAEPROTONOSUPPORT EPROTONOSUPPORT #else # define WSAEPROTONOSUPPORT (10000) #endif #ifdef ESOCKTNOSUPPORT # define WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT #else # define WSAESOCKTNOSUPPORT (10001) #endif #ifdef ENOTCONN # define WSAENOTCONN ENOTCONN #else # define WSAENOTCONN (10002) #endif #ifdef ESHUTDOWN # define WSAENETDOWN ESHUTDOWN #else # define WSAENETDOWN (10003) #endif #ifdef EHOSTUNREACH # define WSAENETUNREACH EHOSTUNREACH #else # define WSAENETUNREACH (10004) #endif #ifdef ENETRESET # define WSAENETRESET ENETRESET #else # define WSAENETRESET (10005) #endif #ifdef ECONNABORTED # define WSAECONNABORTED ECONNABORTED #else # define WSAECONNABORTED (10006) #endif #ifdef ECONNRESET # define WSAECONNRESET ECONNRESET #else # define WSAECONNRESET (10007) #endif #ifdef EWOULDBLOCK # define WSAEWOULDBLOCK EWOULDBLOCK #else # define WSAEWOULDBLOCK (10008) #endif #ifdef ECONNREFUSED # define WSAECONNREFUSED ECONNREFUSED #else # define WSAECONNREFUSED (10009) #endif #define WSAHOST_NOT_FOUND (10010) #ifndef INADDR_NONE # define INADDR_NONE ((unsigned long) -1) #endif #ifndef INVALID_SOCKET # define INVALID_SOCKET (SOCKET)(~0) #endif #endif //_MSC_VER ////////////////////////////////////////////////////////////////////////////// #define SOCKET_BUFFER_SIZE 512 #define ERR_SENDING_DATA 4002 #define ERR_NOT_A_SOCKET 4010 #define ERR_CLOSING 4012 #define WAIT_A_BIT 4013 /// must be >=SOCKET_BUFFER_SIZE, thanks to Lev Walkin for pointing that out #define MAXOUTLINE (SOCKET_BUFFER_SIZE*2) ////////////////////////////////////////////////////////////////////////////// /// SIMPLE MAIL TRANSPORT PROTOCOL Win32 realization class SMTP: public PA_Object { char *in_buffer; char *out_buffer; unsigned int in_index; unsigned int out_index; unsigned int in_buffer_total; unsigned int out_buffer_total; unsigned int last_winsock_error; fd_set fds; struct timeval timeout; SOCKET the_socket; char my_hostname[1024]; CHAR ServerProtocol[100]; CHAR RemoteAddress[100]; CHAR RemoteHost[100]; CHAR RemoteUser[100]; CHAR HttpAccept[100]; CHAR HttpUserAgent[256]; CHAR FirstName[100]; CHAR LastName[100]; CHAR WebUse[100]; CHAR EMail[100]; CHAR HomePage[100]; CHAR text[500]; public: SMTP(); override ~SMTP(); // smtp.C void Send(const char* , const char* , const char* , char *, char *); bool MakeSmtpHeader(char *, char *, char *, char *); void prepare_message(char *, char *, const char* , const char* ); void open_socket(const char* , const char* ); int get_line(void); void SendSmtpError(const char* ); void transform_and_send_edit_data(const char* ); void send_data(const char* ); void ConnectToHost(const char* , const char* ); int GetBuffer(int); int GetChar(int, char *); void SendLine(const char* , unsigned long); void SendBuffer(const char* , unsigned long); void FlushBuffer(); bool CloseConnect(); // comms.C int IsAddressARawIpaddress(const char* ); int ResolveService(const char* , u_short *); int ResolveHostname(const char* , struct sockaddr_in *); int GetAndSetTheSocket(SOCKET *); int GetConnection(SOCKET, struct sockaddr_in *); void MiscSocketSetup(SOCKET, fd_set *, struct timeval *); }; parser-3.4.3/src/lib/smtp/Makefile.am000644 000000 000000 00000000245 11766065303 017500 0ustar00rootwheel000000 000000 INCLUDES = -I../gc/include -I../cord/include noinst_HEADERS = smtp.h noinst_LTLIBRARIES = libsmtp.la libsmtp_la_SOURCES = comms.C smtp.C EXTRA_DIST = smtp.vcproj parser-3.4.3/src/lib/smtp/smtp.vcproj000644 000000 000000 00000007114 12230131504 017636 0ustar00rootwheel000000 000000 parser-3.4.3/src/lib/sdbm/sdbm.vcproj000644 000000 000000 00000010254 11474465237 017567 0ustar00rootwheel000000 000000 parser-3.4.3/src/lib/sdbm/Makefile.in000644 000000 000000 00000054765 11766635215 017500 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/sdbm DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsdbm_la_LIBADD = am_libsdbm_la_OBJECTS = sdbm.lo sdbm_hash.lo sdbm_lock.lo sdbm_pair.lo \ pa_file_io.lo pa_strings.lo libsdbm_la_OBJECTS = $(am_libsdbm_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libsdbm_la_SOURCES) DIST_SOURCES = $(libsdbm_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = pa-include INCLUDES = -Ipa-include -I../../include -I../gc/include noinst_HEADERS = sdbm_pair.h sdbm_private.h sdbm_tune.h noinst_LTLIBRARIES = libsdbm.la libsdbm_la_SOURCES = sdbm.c sdbm_hash.c sdbm_lock.c sdbm_pair.c pa_file_io.C pa_strings.C EXTRA_DIST = sdbm.vcproj all: all-recursive .SUFFIXES: .SUFFIXES: .C .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/sdbm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/sdbm/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libsdbm.la: $(libsdbm_la_OBJECTS) $(libsdbm_la_DEPENDENCIES) $(CXXLINK) $(libsdbm_la_OBJECTS) $(libsdbm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_file_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_strings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm_hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm_lock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm_pair.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/lib/sdbm/sdbm.c000644 000000 000000 00000044266 12172645446 016516 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * ex-public domain, ported to APR for Apache 2 * core routines */ #include "pa_apr.h" #include "pa_file_io.h" #include "pa_strings.h" #include "pa_errno.h" #include "pa_sdbm.h" #include "sdbm_tune.h" #include "sdbm_pair.h" #include "sdbm_private.h" /* * forward */ static int getdbit (pa_sdbm_t *, long); static pa_status_t setdbit(pa_sdbm_t *, long); static pa_status_t getpage(pa_sdbm_t *db, long); static pa_status_t getnext(pa_sdbm_datum_t *key, pa_sdbm_t *db); static pa_status_t makroom(pa_sdbm_t *, long, int); /* * useful macros */ #define bad(x) ((x).dptr == NULL || (x).dsize <= 0) #define exhash(item) sdbm_hash((item).dptr, (item).dsize) /* ### Does anything need these externally? */ #define sdbm_dirfno(db) ((db)->dirf) #define sdbm_pagfno(db) ((db)->pagf) #define OFF_PAG(off) (pa_off_t) (off) * PBLKSIZ #define OFF_DIR(off) (pa_off_t) (off) * DBLKSIZ static long masks[] = { 000000000000, 000000000001, 000000000003, 000000000007, 000000000017, 000000000037, 000000000077, 000000000177, 000000000377, 000000000777, 000000001777, 000000003777, 000000007777, 000000017777, 000000037777, 000000077777, 000000177777, 000000377777, 000000777777, 000001777777, 000003777777, 000007777777, 000017777777, 000037777777, 000077777777, 000177777777, 000377777777, 000777777777, 001777777777, 003777777777, 007777777777, 017777777777 }; const pa_sdbm_datum_t sdbm_nullitem = { NULL, 0 }; static pa_status_t database_cleanup(void *data) { pa_sdbm_t *db = data; /* * Can't rely on pa_sdbm_unlock, since it will merely * decrement the refcnt if several locks are held. */ if (db->flags & (SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK)) (void) pa_file_unlock(db->dirf); (void) pa_file_close(db->dirf); (void) pa_file_close(db->pagf); // free(db); // libcg will do it return PA_SUCCESS; } static pa_status_t prep(pa_sdbm_t **pdb, const char *dirname, const char *pagname, pa_int32_t flags, pa_fileperms_t perms, pa_pool_t *p) { pa_sdbm_t *db; pa_status_t status; *pdb = NULL; // db = malloc(sizeof(*db)); // memset(db, 0, sizeof(*db)); db = pa_sdbm_malloc(sizeof(*db)); db->pool = p; /* * adjust user flags so that WRONLY becomes RDWR, * as required by this package. Also set our internal * flag for RDONLY if needed. */ if (!(flags & PA_WRITE)) { db->flags |= SDBM_RDONLY; } /* * adjust the file open flags so that we handle locking * on our own (don't rely on any locking behavior within * an pa_file_t, in case it's ever introduced, and set * our own flag. */ if (flags & PA_SHARELOCK) { db->flags |= SDBM_SHARED; flags &= ~PA_SHARELOCK; } flags |= PA_BINARY | PA_READ; /* * open the files in sequence, and stat the dirfile. * If we fail anywhere, undo everything, return NULL. */ if ((status = pa_file_open(&db->dirf, dirname, flags, perms, p)) != PA_SUCCESS) goto error; if ((status = pa_file_open(&db->pagf, pagname, flags, perms, p)) != PA_SUCCESS) goto error; if ((status = pa_sdbm_lock(db, (db->flags & SDBM_RDONLY) ? PA_FLOCK_SHARED : PA_FLOCK_EXCLUSIVE)) != PA_SUCCESS) goto error; /* pa_pcalloc zeroed the buffers * pa_sdbm_lock stated the dirf->size and invalidated the cache */ /* * if we are opened in SHARED mode, unlock ourself */ if (db->flags & SDBM_SHARED) if ((status = pa_sdbm_unlock(db)) != PA_SUCCESS) goto error; /* make sure that we close the database at some point */ //pa_pool_cleanup_register(p, db, database_cleanup, pa_pool_cleanup_null); /* Done! */ *pdb = db; return PA_SUCCESS; error: if (db->dirf && db->pagf) (void) pa_sdbm_unlock(db); if (db->dirf != NULL) (void) pa_file_close(db->dirf); if (db->pagf != NULL) { (void) pa_file_close(db->pagf); } // free(db); // libcg will do it return status; } pa_status_t pa_sdbm_open(pa_sdbm_t **db, const char *file, pa_int32_t flags, pa_fileperms_t perms, pa_pool_t *p) { char *dirname = pa_pstrcat(p, file, PA_SDBM_DIRFEXT, NULL); char *pagname = pa_pstrcat(p, file, PA_SDBM_PAGFEXT, NULL); return prep(db, dirname, pagname, flags, perms, p); } pa_status_t pa_sdbm_close(pa_sdbm_t *db) { database_cleanup(db); return PA_SUCCESS; //return pa_pool_cleanup_run(db->pool, db, database_cleanup); } pa_status_t pa_sdbm_fetch(pa_sdbm_t *db, pa_sdbm_datum_t *val, pa_sdbm_datum_t key) { pa_status_t status; if (db == NULL || bad(key)) return PA_EINVAL; if ((status = pa_sdbm_lock(db, PA_FLOCK_SHARED)) != PA_SUCCESS) return status; if ((status = getpage(db, exhash(key))) == PA_SUCCESS) { *val = getpair(db->pagbuf, key); /* ### do we want a not-found result? */ } (void) pa_sdbm_unlock(db); return status; } static pa_status_t write_page(pa_sdbm_t *db, const char *buf, long pagno) { pa_status_t status; pa_off_t off = OFF_PAG(pagno); if ((status = pa_file_seek(db->pagf, PA_SET, &off)) == PA_SUCCESS) status = pa_file_write_full(db->pagf, buf, PBLKSIZ, NULL); return status; } pa_status_t pa_sdbm_delete(pa_sdbm_t *db, const pa_sdbm_datum_t key) { pa_status_t status; if (db == NULL || bad(key)) return PA_EINVAL; if (pa_sdbm_rdonly(db)) return PA_EINVAL; if ((status = pa_sdbm_lock(db, PA_FLOCK_EXCLUSIVE)) != PA_SUCCESS) return status; if ((status = getpage(db, exhash(key))) == PA_SUCCESS) { if (!delpair(db->pagbuf, key)) /* ### should we define some APRUTIL codes? */ status = PA_SUCCESS; /* PAF: were PA_EGENERAL, contradicting comment in .h file :( */ else status = write_page(db, db->pagbuf, db->pagbno); } (void) pa_sdbm_unlock(db); return status; } pa_status_t pa_sdbm_store(pa_sdbm_t *db, pa_sdbm_datum_t key, pa_sdbm_datum_t val, int flags) { int need; register long hash; pa_status_t status; if (db == NULL || bad(key)) return PA_EINVAL; if (pa_sdbm_rdonly(db)) return PA_EINVAL; need = key.dsize + val.dsize; /* * is the pair too big (or too small) for this database ?? */ if (need < 0 || need > PAIRMAX) return PA_EINVAL; if ((status = pa_sdbm_lock(db, PA_FLOCK_EXCLUSIVE)) != PA_SUCCESS) return status; if ((status = getpage(db, (hash = exhash(key)))) == PA_SUCCESS) { /* * if we need to replace, delete the key/data pair * first. If it is not there, ignore. */ if (flags == PA_SDBM_REPLACE) (void) delpair(db->pagbuf, key); else if (!(flags & PA_SDBM_INSERTDUP) && duppair(db->pagbuf, key)) { status = PA_EEXIST; goto error; } /* * if we do not have enough room, we have to split. */ if (!fitpair(db->pagbuf, need)) if ((status = makroom(db, hash, need)) != PA_SUCCESS) goto error; /* * we have enough room or split is successful. insert the key, * and update the page file. */ (void) putpair(db->pagbuf, key, val); status = write_page(db, db->pagbuf, db->pagbno); } error: (void) pa_sdbm_unlock(db); return status; } /* * makroom - make room by splitting the overfull page * this routine will attempt to make room for SPLTMAX times before * giving up. */ static pa_status_t makroom(pa_sdbm_t *db, long hash, int need) { long newp; char twin[PBLKSIZ]; char *pag = db->pagbuf; char *new = twin; register int smax = SPLTMAX; pa_status_t status; do { /* * split the current page */ (void) splpage(pag, new, db->hmask + 1); /* * address of the new page */ newp = (hash & db->hmask) | (db->hmask + 1); /* * write delay, read avoidence/cache shuffle: * select the page for incoming pair: if key is to go to the new page, * write out the previous one, and copy the new one over, thus making * it the current page. If not, simply write the new page, and we are * still looking at the page of interest. current page is not updated * here, as sdbm_store will do so, after it inserts the incoming pair. */ if (hash & (db->hmask + 1)) { if ((status = write_page(db, db->pagbuf, db->pagbno)) != PA_SUCCESS) return status; db->pagbno = newp; (void) memcpy(pag, new, PBLKSIZ); } else { if ((status = write_page(db, new, newp)) != PA_SUCCESS) return status; } if ((status = setdbit(db, db->curbit)) != PA_SUCCESS) return status; /* * see if we have enough room now */ if (fitpair(pag, need)) return PA_SUCCESS; /* * try again... update curbit and hmask as getpage would have * done. because of our update of the current page, we do not * need to read in anything. BUT we have to write the current * [deferred] page out, as the window of failure is too great. */ db->curbit = 2 * db->curbit + ((hash & (db->hmask + 1)) ? 2 : 1); db->hmask |= db->hmask + 1; if ((status = write_page(db, db->pagbuf, db->pagbno)) != PA_SUCCESS) return status; } while (--smax); /* * if we are here, this is real bad news. After SPLTMAX splits, * we still cannot fit the key. say goodnight. */ #if 0 (void) write(2, "sdbm: cannot insert after SPLTMAX attempts.\n", 44); #endif /* ### ENOSPC not really appropriate but better than nothing */ return PA_ENOSPC; } /* Reads 'len' bytes from file 'f' at offset 'off' into buf. * 'off' is given relative to the start of the file. * If EOF is returned while reading, this is taken as success. */ static pa_status_t read_from(pa_file_t *f, void *buf, pa_off_t off, pa_size_t len) { pa_status_t status; if ((status = pa_file_seek(f, PA_SET, &off)) != PA_SUCCESS || ((status = pa_file_read_full(f, buf, len, NULL)) != PA_SUCCESS)) { /* if EOF is reached, pretend we read all zero's */ if (status == PA_EOF) { memset(buf, 0, len); status = PA_SUCCESS; } } return status; } /* * the following two routines will break if * deletions aren't taken into account. (ndbm bug) */ pa_status_t pa_sdbm_firstkey(pa_sdbm_t *db, pa_sdbm_datum_t *key) { pa_status_t status; if ((status = pa_sdbm_lock(db, PA_FLOCK_SHARED)) != PA_SUCCESS) return status; /* * start at page 0 */ if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(0), PBLKSIZ)) == PA_SUCCESS) { db->pagbno = 0; db->blkptr = 0; db->keyptr = 0; status = getnext(key, db); } (void) pa_sdbm_unlock(db); return status; } pa_status_t pa_sdbm_nextkey(pa_sdbm_t *db, pa_sdbm_datum_t *key) { pa_status_t status; if ((status = pa_sdbm_lock(db, PA_FLOCK_SHARED)) != PA_SUCCESS) return status; status = getnext(key, db); (void) pa_sdbm_unlock(db); return status; } /* * all important binary tree traversal */ static pa_status_t getpage(pa_sdbm_t *db, long hash) { register int hbit; register long dbit; register long pagb; pa_status_t status; dbit = 0; hbit = 0; while (dbit < db->maxbno && getdbit(db, dbit)) dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); debug(("dbit: %d...", dbit)); db->curbit = dbit; db->hmask = masks[hbit]; pagb = hash & db->hmask; /* * see if the block we need is already in memory. * note: this lookaside cache has about 10% hit rate. */ if (pagb != db->pagbno) { /* * note: here, we assume a "hole" is read as 0s. * if not, must zero pagbuf first. * ### joe: this assumption was surely never correct? but * ### we make it so in read_from anyway. */ if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(pagb), PBLKSIZ)) != PA_SUCCESS) return status; if (!chkpage(db->pagbuf)) return PA_ENOSPC; /* ### better error? */ db->pagbno = pagb; debug(("pag read: %d\n", pagb)); } return PA_SUCCESS; } static int getdbit(pa_sdbm_t *db, long dbit) { register long c; register long dirb; c = dbit / BYTESIZ; dirb = c / DBLKSIZ; if (dirb != db->dirbno) { if (read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ) != PA_SUCCESS) return 0; db->dirbno = dirb; debug(("dir read: %d\n", dirb)); } return db->dirbuf[c % DBLKSIZ] & (1 << dbit % BYTESIZ); } static pa_status_t setdbit(pa_sdbm_t *db, long dbit) { register long c; register long dirb; pa_status_t status; pa_off_t off; c = dbit / BYTESIZ; dirb = c / DBLKSIZ; if (dirb != db->dirbno) { if ((status = read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ)) != PA_SUCCESS) return status; db->dirbno = dirb; debug(("dir read: %d\n", dirb)); } db->dirbuf[c % DBLKSIZ] |= (1 << dbit % BYTESIZ); if (dbit >= db->maxbno) db->maxbno += DBLKSIZ * BYTESIZ; off = OFF_DIR(dirb); if ((status = pa_file_seek(db->dirf, PA_SET, &off)) == PA_SUCCESS) status = pa_file_write_full(db->dirf, db->dirbuf, DBLKSIZ, NULL); return status; } /* * getnext - get the next key in the page, and if done with * the page, try the next page in sequence */ static pa_status_t getnext(pa_sdbm_datum_t *key, pa_sdbm_t *db) { pa_status_t status; for (;;) { db->keyptr++; *key = getnkey(db->pagbuf, db->keyptr); if (key->dptr != NULL) return PA_SUCCESS; /* * we either run out, or there is nothing on this page.. * try the next one... If we lost our position on the * file, we will have to seek. */ db->keyptr = 0; if (db->pagbno != db->blkptr++) { pa_off_t off = OFF_PAG(db->blkptr); if ((status = pa_file_seek(db->pagf, PA_SET, &off) != PA_SUCCESS)) return status; } db->pagbno = db->blkptr; /* ### EOF acceptable here too? */ if ((status = pa_file_read_full(db->pagf, db->pagbuf, PBLKSIZ, NULL)) != PA_SUCCESS) return status; if (!chkpage(db->pagbuf)) return PA_EGENERAL; /* ### need better error */ } /* NOTREACHED */ } int pa_sdbm_rdonly(pa_sdbm_t *db) { /* ### Should we return true if the first lock is a share lock, * to reflect that pa_sdbm_store and pa_sdbm_delete will fail? */ return (db->flags & SDBM_RDONLY) != 0; } parser-3.4.3/src/lib/sdbm/sdbm_pair.c000644 000000 000000 00000020313 12172645447 017515 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain. * * page-level routines */ #include "pa_sdbm.h" #include "sdbm_tune.h" #include "sdbm_pair.h" #include "sdbm_private.h" #define exhash(item) sdbm_hash((item).dptr, (item).dsize) /* * forward */ static int seepair(char *, int, char *, int); /* * page format: * +------------------------------+ * ino | n | keyoff | datoff | keyoff | * +------------+--------+--------+ * | datoff | - - - ----> | * +--------+---------------------+ * | F R E E A R E A | * +--------------+---------------+ * | <---- - - - | data | * +--------+-----+----+----------+ * | key | data | key | * +--------+----------+----------+ * * calculating the offsets for free area: if the number * of entries (ino[0]) is zero, the offset to the END of * the free area is the block size. Otherwise, it is the * nth (ino[ino[0]]) entry's offset. */ int fitpair(pag, need) char *pag; int need; { register int n; register int off; register int avail; register short *ino = (short *) pag; off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; avail = off - (n + 1) * sizeof(short); need += 2 * sizeof(short); debug(("avail %d need %d\n", avail, need)); return need <= avail; } void putpair(pag, key, val) char *pag; pa_sdbm_datum_t key; pa_sdbm_datum_t val; { register int n; register int off; register short *ino = (short *) pag; off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; /* * enter the key first */ off -= key.dsize; (void) memcpy(pag + off, key.dptr, key.dsize); ino[n + 1] = off; /* * now the data */ off -= val.dsize; (void) memcpy(pag + off, val.dptr, val.dsize); ino[n + 2] = off; /* * adjust item count */ ino[0] += 2; } pa_sdbm_datum_t getpair(pag, key) char *pag; pa_sdbm_datum_t key; { register int i; register int n; pa_sdbm_datum_t val; register short *ino = (short *) pag; if ((n = ino[0]) == 0) return sdbm_nullitem; if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) return sdbm_nullitem; val.dptr = pag + ino[i + 1]; val.dsize = ino[i] - ino[i + 1]; return val; } int duppair(pag, key) char *pag; pa_sdbm_datum_t key; { register short *ino = (short *) pag; return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0; } pa_sdbm_datum_t getnkey(pag, num) char *pag; int num; { pa_sdbm_datum_t key; register int off; register short *ino = (short *) pag; num = num * 2 - 1; if (ino[0] == 0 || num > ino[0]) return sdbm_nullitem; off = (num > 1) ? ino[num - 1] : PBLKSIZ; key.dptr = pag + ino[num]; key.dsize = off - ino[num]; return key; } int delpair(pag, key) char *pag; pa_sdbm_datum_t key; { register int n; register int i; register short *ino = (short *) pag; if ((n = ino[0]) == 0) return 0; if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) return 0; /* * found the key. if it is the last entry * [i.e. i == n - 1] we just adjust the entry count. * hard case: move all data down onto the deleted pair, * shift offsets onto deleted offsets, and adjust them. * [note: 0 < i < n] */ if (i < n - 1) { register int m; register char *dst = pag + (i == 1 ? PBLKSIZ : ino[i - 1]); register char *src = pag + ino[i + 1]; register int zoo = dst - src; debug(("free-up %d ", zoo)); /* * shift data/keys down */ m = ino[i + 1] - ino[n]; #undef DUFF /* just use memmove. it should be plenty fast. */ #ifdef DUFF #define MOVB *--dst = *--src if (m > 0) { register int loop = (m + 8 - 1) >> 3; switch (m & (8 - 1)) { case 0: do { MOVB; case 7: MOVB; case 6: MOVB; case 5: MOVB; case 4: MOVB; case 3: MOVB; case 2: MOVB; case 1: MOVB; } while (--loop); } } #else dst -= m; src -= m; memmove(dst, src, m); #endif /* * adjust offset index up */ while (i < n - 1) { ino[i] = ino[i + 2] + zoo; i++; } } ino[0] -= 2; return 1; } /* * search for the key in the page. * return offset index in the range 0 < i < n. * return 0 if not found. */ static int seepair(pag, n, key, siz) char *pag; register int n; register char *key; register int siz; { register int i; register int off = PBLKSIZ; register short *ino = (short *) pag; for (i = 1; i < n; i += 2) { if (siz == off - ino[i] && memcmp(key, pag + ino[i], siz) == 0) return i; off = ino[i + 1]; } return 0; } void splpage(pag, new, sbit) char *pag; char *new; long sbit; { pa_sdbm_datum_t key; pa_sdbm_datum_t val; register int n; register int off = PBLKSIZ; char cur[PBLKSIZ]; register short *ino = (short *) cur; (void) memcpy(cur, pag, PBLKSIZ); (void) memset(pag, 0, PBLKSIZ); (void) memset(new, 0, PBLKSIZ); n = ino[0]; for (ino++; n > 0; ino += 2) { key.dptr = cur + ino[0]; key.dsize = off - ino[0]; val.dptr = cur + ino[1]; val.dsize = ino[0] - ino[1]; /* * select the page pointer (by looking at sbit) and insert */ (void) putpair((exhash(key) & sbit) ? new : pag, key, val); off = ino[1]; n -= 2; } debug(("%d split %d/%d\n", ((short *) cur)[0] / 2, ((short *) new)[0] / 2, ((short *) pag)[0] / 2)); } /* * check page sanity: * number of entries should be something * reasonable, and all offsets in the index should be in order. * this could be made more rigorous. */ int chkpage(pag) char *pag; { register int n; register int off; register short *ino = (short *) pag; if ((n = ino[0]) < 0 || n > PBLKSIZ / sizeof(short)) return 0; if (n > 0) { off = PBLKSIZ; for (ino++; n > 0; ino += 2) { if (ino[0] > off || ino[1] > off || ino[1] > ino[0]) return 0; off = ino[1]; n -= 2; } } return 1; } parser-3.4.3/src/lib/sdbm/pa_file_io.C000644 000000 000000 00000006733 11730603273 017603 0ustar00rootwheel000000 000000 /** @file Parser: implementation of apr functions. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_file_io.h" #include "pa_memory.h" #include "pa_os.h" volatile const char * IDENT_PA_FILE_IO_C="$Id: pa_file_io.C,v 1.2 2012/03/16 09:24:11 moko Exp $"; struct pa_file_t { int handle; }; pa_status_t pa_file_open(pa_file_t **new_file, const char *fname, pa_int32_t flag, pa_fileperms_t perm, pa_pool_t *) { int oflags = 0; #if PA_HAS_THREADS pa_status_t rv; #endif (*new_file) = (pa_file_t*)pa_malloc_atomic(sizeof(pa_file_t)); // (*new_file)->flags = flag; (*new_file)->handle = -1; if ((flag & PA_READ) && (flag & PA_WRITE)) { oflags = O_RDWR; } else if (flag & PA_READ) { oflags = O_RDONLY; } else if (flag & PA_WRITE) { oflags = O_WRONLY; } else { return PA_EACCES; } if (flag & PA_CREATE) { oflags |= O_CREAT; if (flag & PA_EXCL) { oflags |= O_EXCL; } } if ((flag & PA_EXCL) && !(flag & PA_CREATE)) { return PA_EACCES; } if (flag & PA_APPEND) { oflags |= O_APPEND; } if (flag & PA_TRUNCATE) { oflags |= O_TRUNC; } #ifdef O_BINARY if (flag & PA_BINARY) { oflags |= O_BINARY; } #endif if(((*new_file)->handle = open(fname, oflags, /*pa_unix_perms2mode*/(perm))) <0 ) return errno; return PA_SUCCESS; } pa_status_t pa_file_close(pa_file_t *file) { return close(file->handle); } pa_status_t pa_file_lock(pa_file_t *file, int type) { if(type & PA_FLOCK_NONBLOCK) pa_lock_exclusive_blocking(file->handle); if ((type & PA_FLOCK_TYPEMASK) == PA_FLOCK_SHARED) return pa_lock_shared_blocking(file->handle); return pa_lock_exclusive_blocking(file->handle); } pa_status_t pa_file_unlock(pa_file_t *file) { return pa_unlock(file->handle); } pa_status_t pa_file_info_get(pa_finfo_t *finfo, pa_int32_t /*wanted*/, pa_file_t *file) { struct stat info; if (fstat(file->handle, &info) == 0) { finfo->size=info.st_size; return PA_SUCCESS; } else { return errno; } } pa_status_t pa_file_seek(pa_file_t *file, pa_seek_where_t where, pa_off_t *offset) { pa_off_t rv = lseek(file->handle, *offset, where); *offset = rv; return rv == -1? errno: PA_SUCCESS; } pa_status_t pa_file_read_full(pa_file_t *file, void *buf, pa_size_t nbytes, pa_size_t *p_bytes_read) { int l_bytes_read = read(file->handle, buf, nbytes); if (l_bytes_read == 0) return PA_EOF; else if (l_bytes_read == -1) return errno; if(p_bytes_read) *p_bytes_read=(pa_size_t)l_bytes_read; return PA_SUCCESS; } pa_status_t pa_file_write_full(pa_file_t *file, const void *buf, pa_size_t nbytes, pa_size_t *bytes_written) { pa_size_t rv; do { rv = write(file->handle, buf, nbytes); } while (rv == (pa_size_t)-1 && errno == EINTR); if (rv == (pa_size_t)-1) { if(bytes_written) *bytes_written = 0; return errno; } if(bytes_written) *bytes_written=rv; return PA_SUCCESS; } parser-3.4.3/src/lib/sdbm/Makefile.am000644 000000 000000 00000000434 11766065303 017442 0ustar00rootwheel000000 000000 SUBDIRS = pa-include INCLUDES = -Ipa-include -I../../include -I../gc/include noinst_HEADERS = sdbm_pair.h sdbm_private.h sdbm_tune.h noinst_LTLIBRARIES = libsdbm.la libsdbm_la_SOURCES = sdbm.c sdbm_hash.c sdbm_lock.c sdbm_pair.c pa_file_io.C pa_strings.C EXTRA_DIST = sdbm.vcproj parser-3.4.3/src/lib/sdbm/sdbm_pair.h000644 000000 000000 00000006321 11474457754 017533 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ #ifndef SDBM_PAIR_H #define SDBM_PAIR_H /* Mini EMBED (pair.c) */ #define chkpage sdbm__chkpage #define delpair sdbm__delpair #define duppair sdbm__duppair #define fitpair sdbm__fitpair #define getnkey sdbm__getnkey #define getpair sdbm__getpair #define putpair sdbm__putpair #define splpage sdbm__splpage int fitpair(char *, int); void putpair(char *, pa_sdbm_datum_t, pa_sdbm_datum_t); pa_sdbm_datum_t getpair(char *, pa_sdbm_datum_t); int delpair(char *, pa_sdbm_datum_t); int chkpage (char *); pa_sdbm_datum_t getnkey(char *, int); void splpage(char *, char *, long); int duppair(char *, pa_sdbm_datum_t); #endif /* SDBM_PAIR_H */ parser-3.4.3/src/lib/sdbm/pa-include/000755 000000 000000 00000000000 12234223575 017424 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/sdbm/sdbm_tune.h000644 000000 000000 00000005726 11474457754 017563 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* * sdbm - ndbm work-alike hashed database library * tuning and portability constructs [not nearly enough] * author: oz@nexus.yorku.ca */ #ifndef SDBM_TUNE_H #define SDBM_TUNE_H #include "pa_errno.h" /* ### this might be better off as sizeof(char *) */ #define BYTESIZ 8 /* * misc */ #ifdef DEBUG #define debug(x) printf x #else #define debug(x) #endif #endif /* SDBM_TUNE_H */ parser-3.4.3/src/lib/sdbm/sdbm_hash.c000644 000000 000000 00000007063 11474457753 017521 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain. keep it that way. * * hashing routine */ #include "pa_sdbm.h" #include "sdbm_private.h" /* * polynomial conversion ignoring overflows * [this seems to work remarkably well, in fact better * then the ndbm hash function. Replace at your own risk] * use: 65599 nice. * 65587 even better. */ long sdbm_hash(const char *str, int len) { register unsigned long n = 0; #define DUFF /* go ahead and use the loop-unrolled version */ #ifdef DUFF #define HASHC n = *str++ + 65599 * n if (len > 0) { register int loop = (len + 8 - 1) >> 3; switch(len & (8 - 1)) { case 0: do { HASHC; case 7: HASHC; case 6: HASHC; case 5: HASHC; case 4: HASHC; case 3: HASHC; case 2: HASHC; case 1: HASHC; } while (--loop); } } #else while (len--) n = *str++ + 65599 * n; #endif return n; } parser-3.4.3/src/lib/sdbm/sdbm_lock.c000644 000000 000000 00000010405 11474457753 017520 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ #include "pa_file_info.h" #include "pa_file_io.h" #include "pa_sdbm.h" #include "sdbm_private.h" #include "sdbm_tune.h" /* NOTE: this function blocks until it acquires the lock */ pa_status_t pa_sdbm_lock(pa_sdbm_t *db, int type) { pa_status_t status; if (!(type == PA_FLOCK_SHARED || type == PA_FLOCK_EXCLUSIVE)) return PA_EINVAL; if (db->flags & SDBM_EXCLUSIVE_LOCK) { ++db->lckcnt; return PA_SUCCESS; } else if (db->flags & SDBM_SHARED_LOCK) { /* * Cannot promote a shared lock to an exlusive lock * in a cross-platform compatibile manner. */ if (type == PA_FLOCK_EXCLUSIVE) return PA_EINVAL; ++db->lckcnt; return PA_SUCCESS; } /* * zero size: either a fresh database, or one with a single, * unsplit data page: dirpage is all zeros. */ if ((status = pa_file_lock(db->dirf, type)) == PA_SUCCESS) { pa_finfo_t finfo; if ((status = pa_file_info_get(&finfo, PA_FINFO_SIZE, db->dirf)) != PA_SUCCESS) { (void) pa_file_unlock(db->dirf); return status; } SDBM_INVALIDATE_CACHE(db, finfo); ++db->lckcnt; if (type == PA_FLOCK_SHARED) db->flags |= SDBM_SHARED_LOCK; else if (type == PA_FLOCK_EXCLUSIVE) db->flags |= SDBM_EXCLUSIVE_LOCK; } return status; } pa_status_t pa_sdbm_unlock(pa_sdbm_t *db) { if (!(db->flags & (SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK))) return PA_EINVAL; if (--db->lckcnt > 0) return PA_SUCCESS; db->flags &= ~(SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK); return pa_file_unlock(db->dirf); } parser-3.4.3/src/lib/sdbm/sdbm_private.h000644 000000 000000 00000011352 11474457754 020252 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca */ #ifndef SDBM_PRIVATE_H #define SDBM_PRIVATE_H #include "pa_apr.h" #include "pa_file_io.h" #include "pa_errno.h" /* for pa_status_t */ #if 1 /* if the block/page size is increased, it breaks perl pa_sdbm_t compatibility */ #define DBLKSIZ 16384 #define PBLKSIZ 8192 // !see PAIRMAX definition in pa_vhashfile.C. values should be the same #define PAIRMAX 8008 /* arbitrary on PBLKSIZ-N */ #else #define DBLKSIZ 4096 #define PBLKSIZ 1024 #define PAIRMAX 1008 /* arbitrary on PBLKSIZ-N */ #endif #define SPLTMAX 10 /* maximum allowed splits */ /* for pa_sdbm_t.flags */ #define SDBM_RDONLY 0x1 /* data base open read-only */ #define SDBM_SHARED 0x2 /* data base open for sharing */ #define SDBM_SHARED_LOCK 0x4 /* data base locked for shared read */ #define SDBM_EXCLUSIVE_LOCK 0x8 /* data base locked for write */ struct pa_sdbm_t { pa_pool_t *pool; pa_file_t *dirf; /* directory file descriptor */ pa_file_t *pagf; /* page file descriptor */ pa_int32_t flags; /* status/error flags, see below */ long maxbno; /* size of dirfile in bits */ long curbit; /* current bit number */ long hmask; /* current hash mask */ long blkptr; /* current block for nextkey */ int keyptr; /* current key for nextkey */ long blkno; /* current page to read/write */ long pagbno; /* current page in pagbuf */ char pagbuf[PBLKSIZ]; /* page file block buffer */ long dirbno; /* current block in dirbuf */ char dirbuf[DBLKSIZ]; /* directory file block buffer */ int lckcnt; /* number of calls to sdbm_lock */ }; extern const pa_sdbm_datum_t sdbm_nullitem; long sdbm_hash(const char *str, int len); /* * zero the cache */ #define SDBM_INVALIDATE_CACHE(db, finfo) \ do { db->dirbno = (!finfo.size) ? 0 : -1; \ db->pagbno = -1; \ db->maxbno = (long)(finfo.size * BYTESIZ); \ } while (0); #endif /* SDBM_PRIVATE_H */ parser-3.4.3/src/lib/sdbm/pa_strings.C000644 000000 000000 00000003034 11730603274 017656 0ustar00rootwheel000000 000000 /** @file Parser: implementation of apr functions. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_strings.h" #include "pa_memory.h" volatile const char * IDENT_PA_STRINGS_C="$Id: pa_strings.C,v 1.3 2012/03/16 09:24:12 moko Exp $"; /** this is used to cache lengths in pa_pstrcat */ #define MAX_SAVED_LENGTHS 6 char *pa_pstrcat(pa_pool_t *p, ...) { char *cp, *argp, *res; pa_size_t saved_lengths[MAX_SAVED_LENGTHS]; int nargs = 0; /* Pass one --- find length of required string */ pa_size_t len = 0; va_list adummy; va_start(adummy, p); while ((cp = va_arg(adummy, char *)) != NULL) { pa_size_t cplen = strlen(cp); if (nargs < MAX_SAVED_LENGTHS) { saved_lengths[nargs++] = cplen; } len += cplen; } va_end(adummy); /* Allocate the required string */ res = (char *) pa_malloc_atomic(len + 1); cp = res; /* Pass two --- copy the argument strings into the result space */ va_start(adummy, p); nargs = 0; while ((argp = va_arg(adummy, char *)) != NULL) { if (nargs < MAX_SAVED_LENGTHS) { len = saved_lengths[nargs++]; } else { len = strlen(argp); } memcpy(cp, argp, len); cp += len; } va_end(adummy); /* Return the result string */ *cp = '\0'; return res; } void* pa_sdbm_malloc(unsigned int size){ return pa_malloc(size); } parser-3.4.3/src/lib/sdbm/pa-include/pa_file_io.h000644 000000 000000 00000027056 12172645447 021704 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ #ifndef PA_FILE_IO_H #define PA_FILE_IO_H /** * @file pa_file_io.h * @brief APR File I/O Handling */ /** * @defgroup PA_File_IO_Handle I/O Handling Functions * @ingroup PA_File_Handle * @{ */ #include "pa_apr.h" #include "pa_errno.h" #include "pa_file_info.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup pa_file_open File Open Flags/Routines * @{ */ #define PA_READ 1 /**< Open the file for reading */ #define PA_WRITE 2 /**< Open the file for writing */ #define PA_CREATE 4 /**< Create the file if not there */ #define PA_APPEND 8 /**< Append to the end of the file */ #define PA_TRUNCATE 16 /**< Open the file and truncate to 0 length */ #define PA_BINARY 32 /**< Open the file in binary mode */ #define PA_EXCL 64 /**< Open should fail if PA_CREATE and file exists. */ #define PA_BUFFERED 128 /**< Open the file for buffered I/O */ #define PA_DELONCLOSE 256 /**< Delete the file after close */ #define PA_XTHREAD 512 /**< Platform dependent tag to open the file for use across multiple threads */ #define PA_SHARELOCK 1024 /**< Platform dependent support for higher level locked read/write access to support writes across process/machines */ #define PA_FILE_NOCLEANUP 2048 /**< Do not register a cleanup when the file is opened */ /** @} */ /** * @defgroup PA_file_seek_flags File Seek Flags * @{ */ /* flags for pa_file_seek */ #define PA_SET SEEK_SET #define PA_CUR SEEK_CUR #define PA_END SEEK_END /** @} */ /** should be same as whence type in lseek, POSIX defines this as int */ typedef int pa_seek_where_t; /** * Structure for referencing files. * @defvar pa_file_t */ typedef struct pa_file_t pa_file_t; /* File lock types/flags */ /** * @defgroup PA_file_lock_types File Lock Types * @{ */ #define PA_FLOCK_SHARED 1 /**< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock. */ #define PA_FLOCK_EXCLUSIVE 2 /**< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock". */ #define PA_FLOCK_TYPEMASK 0x000F /**< mask to extract lock type */ #define PA_FLOCK_NONBLOCK 0x0010 /**< do not block while acquiring the file lock */ /** @} */ /** * Open the specified file. * @param new_file The opened file descriptor. * @param fname The full path to the file (using / on all systems) * @param flag Or'ed value of: *
 *           PA_READ             open for reading
 *           PA_WRITE            open for writing
 *           PA_CREATE           create the file if not there
 *           PA_APPEND           file ptr is set to end prior to all writes
 *           PA_TRUNCATE         set length to zero if file exists
 *           PA_BINARY           not a text file (This flag is ignored on 
 *                                UNIX because it has no meaning)
 *           PA_BUFFERED         buffer the data.  Default is non-buffered
 *           PA_EXCL             return error if PA_CREATE and file exists
 *           PA_DELONCLOSE       delete the file after closing.
 *           PA_XTHREAD          Platform dependent tag to open the file
 *                                for use across multiple threads
 *           PA_SHARELOCK        Platform dependent support for higher
 *                                level locked read/write access to support
 *                                writes across process/machines
 *           PA_FILE_NOCLEANUP   Do not register a cleanup with the pool 
 *                                passed in on the cont argument (see below).
 *                                The pa_os_file_t handle in pa_file_t will not
 &                                be closed when the pool is destroyed.
 * 
* @param perm Access permissions for file. * @param cont The pool to use. * @ingroup pa_file_open * @remark If perm is PA_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ pa_status_t pa_file_open(pa_file_t **new_file, const char *fname, pa_int32_t flag, pa_fileperms_t perm, pa_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. */ pa_status_t pa_file_close(pa_file_t *file); /** file (un)locking functions. */ /** * Establish a lock on the specified, open file. The lock may be advisory * or mandatory, at the discretion of the platform. The lock applies to * the file as a whole, rather than a specific range. Locks are established * on a per-thread/process basis; a second lock by the same thread will not * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. */ pa_status_t pa_file_lock(pa_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. */ pa_status_t pa_file_unlock(pa_file_t *thefile); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param wanted The desired pa_finfo_t fields, as a bit flag of PA_FINFO_ values * @param thefile The file to get information about. */ pa_status_t pa_file_info_get(pa_finfo_t *finfo, pa_int32_t wanted, pa_file_t *thefile); /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor * @param where How to move the pointer, one of: *
 *            PA_SET  --  set the offset to offset
 *            PA_CUR  --  add the offset to the current position 
 *            PA_END  --  add the offset to the current file size 
 * 
* @param offset The offset to move the pointer to. * @remark The third argument is modified to be the offset the pointer was actually moved to. */ pa_status_t pa_file_seek(pa_file_t *thefile, pa_seek_where_t where, pa_off_t *offset); /** * Read data from the specified file, ensuring that the buffer is filled * before returning. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * @remark pa_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, * then the process/thread will block until it is available or EOF * is reached. If a char was put back into the stream via ungetc, * it will be the first character returned. * * It is possible for both bytes to be read and an error to be * returned. And if *bytes_read is less than nbytes, an * accompanying error is _always_ returned. * * PA_EINTR is never returned. */ pa_status_t pa_file_read_full(pa_file_t *thefile, void *buf, pa_size_t nbytes, pa_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is * written before returning. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, this will contain the number of bytes written. * @remark pa_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, the process/thread * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. * * It is possible for both bytes to be written and an error to be * returned. And if *bytes_written is less than nbytes, an * accompanying error is _always_ returned. * * PA_EINTR is never returned. */ pa_status_t pa_file_write_full(pa_file_t *thefile, const void *buf, pa_size_t nbytes, pa_size_t *bytes_written); #ifdef __cplusplus } #endif /** @} */ #endif /* ! PA_FILE_IO_H */ parser-3.4.3/src/lib/sdbm/pa-include/pa_strings.h000644 000000 000000 00000010002 12172645447 021746 0ustar00rootwheel000000 000000 /**@TODO paf remove unneeded functions */ /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* Portions of this file are covered by */ /* -*- mode: c; c-file-style: "k&r" -*- strnatcmp.c -- Perform 'natural order' comparisons of strings in C. Copyright (C) 2000 by Martin Pool This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef PA_STRINGS_H #define PA_STRINGS_H #include "pa_apr.h" #include "pa_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ // Concatenate multiple strings, allocating memory out a pool char *pa_pstrcat(pa_pool_t *p, ...); // use libgc void* pa_sdbm_malloc(unsigned int size); #ifdef __cplusplus } #endif #endif /* !PA_STRINGS_H */ parser-3.4.3/src/lib/sdbm/pa-include/pa_file_info.h000644 000000 000000 00000013562 11474457754 022233 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ #ifndef PA_FILE_INFO_H #define PA_FILE_INFO_H #include "pa_apr.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @file pa_file_info.h * @brief APR File handling */ /** * Structure for determining file permissions. * @defvar pa_fileperms_t */ typedef pa_int32_t pa_fileperms_t; /** * @defgroup PA_File_Info Stat Functions * @{ */ #ifdef LATER #define PA_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ #define PA_FINFO_MTIME 0x00000010 /**< Modification Time */ #define PA_FINFO_CTIME 0x00000020 /**< Creation Time */ #define PA_FINFO_ATIME 0x00000040 /**< Access Time */ #endif #define PA_FINFO_SIZE 0x00000100 /**< Size of the file */ #ifdef LATER #define PA_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */ #define PA_FINFO_DEV 0x00001000 #define PA_FINFO_INODE 0x00002000 #define PA_FINFO_NLINK 0x00004000 #define PA_FINFO_TYPE 0x00008000 #define PA_FINFO_USER 0x00010000 #define PA_FINFO_GROUP 0x00020000 #define PA_FINFO_UPROT 0x00100000 #define PA_FINFO_GPROT 0x00200000 #define PA_FINFO_WPROT 0x00400000 #define PA_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */ #define PA_FINFO_NAME 0x02000000 /**< ->name in proper case */ #define PA_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */ #define PA_FINFO_IDENT 0x00003000 /**< dev and inode */ #define PA_FINFO_OWNER 0x00030000 /**< user and group */ #define PA_FINFO_PROT 0x00700000 /**< all protections */ #define PA_FINFO_NORM 0x0073b170 /**< an atomic unix pa_stat() */ #define PA_FINFO_DIRENT 0x02000000 /**< an atomic unix pa_dir_read() */ #endif /** * The file information structure. This is analogous to the POSIX * stat structure. */ typedef struct pa_finfo_t pa_finfo_t; struct pa_finfo_t { #ifdef LATER /** Allocates memory and closes lingering handles in the specified pool */ pa_pool_t *pool; /** The bitmask describing valid fields of this pa_finfo_t structure * including all available 'wanted' fields and potentially more */ pa_int32_t valid; /** The access permissions of the file. Mimics Unix access rights. */ pa_fileperms_t protection; /** The type of file. One of PA_NOFILE, PA_REG, PA_DIR, PA_CHR, * PA_BLK, PA_PIPE, PA_LNK, PA_SOCK */ pa_filetype_e filetype; /** The user id that owns the file */ pa_uid_t user; /** The group id that owns the file */ pa_gid_t group; /** The inode of the file. */ pa_ino_t inode; /** The id of the device the file is on. */ pa_dev_t device; /** The number of hard links to the file. */ pa_int32_t nlink; #endif /** The size of the file */ pa_off_t size; #ifdef LATER /** The storage size consumed by the file */ pa_off_t csize; /** The time the file was last accessed */ pa_time_t atime; /** The time the file was last modified */ pa_time_t mtime; /** The time the file was last changed */ pa_time_t ctime; /** The full pathname of the file */ const char *fname; /** The file's name (no path) in filesystem case */ const char *name; /** The file's handle, if accessed (can be submitted to pa_duphandle) */ struct pa_file_t *filehand; #endif }; /** @} */ #ifdef __cplusplus } #endif #endif /* ! PA_FILE_INFO_H */ parser-3.4.3/src/lib/sdbm/pa-include/Makefile.in000644 000000 000000 00000030411 11766635215 021477 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/sdbm/pa-include DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_apr.h pa_errno.h pa_file_info.h pa_file_io.h pa_sdbm.h pa_strings.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/sdbm/pa-include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/sdbm/pa-include/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-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: parser-3.4.3/src/lib/sdbm/pa-include/Makefile.am000644 000000 000000 00000000130 11474460637 021461 0ustar00rootwheel000000 000000 noinst_HEADERS = pa_apr.h pa_errno.h pa_file_info.h pa_file_io.h pa_sdbm.h pa_strings.h parser-3.4.3/src/lib/sdbm/pa-include/pa_apr.h000644 000000 000000 00000005444 12172645447 021055 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ #ifndef PA_APR_H #define PA_APR_H #include "pa_config_includes.h" // apr.h typedef int pa_int32_t; typedef int pa_off_t; typedef size_t pa_size_t; // apr_pools.h typedef void pa_pool_t; #endif /* PA_APR_H */ parser-3.4.3/src/lib/sdbm/pa-include/pa_sdbm.h000644 000000 000000 00000016726 11474457754 021233 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain */ #ifndef PA_SDBM_H #define PA_SDBM_H #include "pa_apr.h" #include "pa_errno.h" #include "pa_file_io.h" /* for pa_fileperms_t */ #ifdef __cplusplus extern "C" { #endif /** * @file pa_sdbm.h * @brief apr-util SDBM library */ /** * @defgroup PA_Util_DBM_SDBM SDBM library * @ingroup PA_Util_DBM * @{ */ /** * Structure for referencing an sdbm */ typedef struct pa_sdbm_t pa_sdbm_t; /** * Structure for referencing the datum record within an sdbm */ typedef struct { /** pointer to the data stored/retrieved */ char *dptr; /** size of data */ int dsize; } pa_sdbm_datum_t; /* The extensions used for the database files */ #define PA_SDBM_DIRFEXT ".dir" #define PA_SDBM_PAGFEXT ".pag" /* flags to sdbm_store */ #define PA_SDBM_INSERT 0 #define PA_SDBM_REPLACE 1 #define PA_SDBM_INSERTDUP 2 /** * Open an sdbm database by file name * @param db The newly opened database * @param name The sdbm file to open * @param mode The flag values (PA_READ and PA_BINARY flags are implicit) *
 *           PA_WRITE          open for read-write access
 *           PA_CREATE         create the sdbm if it does not exist
 *           PA_TRUNCATE       empty the contents of the sdbm
 *           PA_EXCL           fail for PA_CREATE if the file exists
 *           PA_DELONCLOSE     delete the sdbm when closed
 *           PA_SHARELOCK      support locking across process/machines
 * 
* @param perm Permissions to apply to if created * @param pool The pool to use when creating the sdbm * @remark The sdbm name is not a true file name, as sdbm appends suffixes * for seperate data and index files. */ pa_status_t pa_sdbm_open(pa_sdbm_t **db, const char *name, pa_int32_t mode, pa_fileperms_t perms, pa_pool_t *p); /** * Close an sdbm file previously opened by pa_sdbm_open * @param db The database to close */ pa_status_t pa_sdbm_close(pa_sdbm_t *db); /** * Lock an sdbm database for concurency of multiple operations * @param db The database to lock * @param type The lock type *
 *           PA_FLOCK_SHARED
 *           PA_FLOCK_EXCLUSIVE
 * 
* @remark Calls to pa_sdbm_lock may be nested. All pa_sdbm functions * perform implicit locking. Since an PA_FLOCK_SHARED lock cannot be * portably promoted to an PA_FLOCK_EXCLUSIVE lock, pa_sdbm_store and * pa_sdbm_delete calls will fail if an PA_FLOCK_SHARED lock is held. * The pa_sdbm_lock call requires the database to be opened with the * PA_SHARELOCK mode value. */ pa_status_t pa_sdbm_lock(pa_sdbm_t *db, int type); /** * Release an sdbm lock previously aquired by pa_sdbm_lock * @param db The database to unlock */ pa_status_t pa_sdbm_unlock(pa_sdbm_t *db); /** * Fetch an sdbm record value by key * @param db The database * @param value The value datum retrieved for this record * @param key The key datum to find this record */ pa_status_t pa_sdbm_fetch(pa_sdbm_t *db, pa_sdbm_datum_t *value, pa_sdbm_datum_t key); /** * Store an sdbm record value by key * @param db The database * @param key The key datum to store this record by * @param value The value datum to store in this record * @param opt The method used to store the record *
 *           PA_SDBM_INSERT     return an error if the record exists
 *           PA_SDBM_REPLACE    overwrite any existing record for key
 * 
*/ pa_status_t pa_sdbm_store(pa_sdbm_t *db, pa_sdbm_datum_t key, pa_sdbm_datum_t value, int opt); /** * Delete an sdbm record value by key * @param db The database * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ pa_status_t pa_sdbm_delete(pa_sdbm_t *db, const pa_sdbm_datum_t key); /** * Retrieve the first record key from a dbm * @param dbm The database * @param key The key datum of the first record * @remark The keys returned are not ordered. To traverse the list of keys * for an sdbm opened with PA_SHARELOCK, the caller must use pa_sdbm_lock * prior to retrieving the first record, and hold the lock until after the * last call to pa_sdbm_nextkey. */ pa_status_t pa_sdbm_firstkey(pa_sdbm_t *db, pa_sdbm_datum_t *key); /** * Retrieve the next record key from an sdbm * @param db The database * @param key The key datum of the next record */ pa_status_t pa_sdbm_nextkey(pa_sdbm_t *db, pa_sdbm_datum_t *key); /** * Returns true if the sdbm database opened for read-only access * @param db The database to test */ int pa_sdbm_rdonly(pa_sdbm_t *db); /** @} */ #ifdef __cplusplus } #endif #endif /* PA_SDBM_H */ parser-3.4.3/src/lib/sdbm/pa-include/pa_errno.h000644 000000 000000 00000036302 12172645447 021415 0ustar00rootwheel000000 000000 /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ #ifndef PA_ERRNO_H #define PA_ERRNO_H #include "pa_apr.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @file pa_errno.h * @brief APR Error Codes */ /** * @defgroup PA_Error_Codes Error Codes * @ingroup APR * @{ */ /** * Type for specifying an error or status code. */ typedef int pa_status_t; /** * PA_OS_START_ERROR is where the APR specific error values start. */ #define PA_OS_START_ERROR 20000 /** * PA_OS_ERRSPACE_SIZE is the maximum number of errors you can fit * into one of the error/status ranges below -- except for * PA_OS_START_USERERR, which see. */ #define PA_OS_ERRSPACE_SIZE 50000 /** * PA_OS_START_STATUS is where the APR specific status codes start. */ #define PA_OS_START_STATUS (PA_OS_START_ERROR + PA_OS_ERRSPACE_SIZE) /** * PA_OS_START_USERERR are reserved for applications that use APR that * layer their own error codes along with APR's. Note that the * error immediately following this one is set ten times farther * away than usual, so that users of apr have a lot of room in * which to declare custom error codes. */ #define PA_OS_START_USERERR (PA_OS_START_STATUS + PA_OS_ERRSPACE_SIZE) /** * PA_OS_START_USEERR is obsolete, defined for compatibility only. * Use PA_OS_START_USERERR instead. */ #define PA_OS_START_USEERR PA_OS_START_USERERR /** * PA_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. */ #define PA_OS_START_CANONERR (PA_OS_START_USERERR \ + (PA_OS_ERRSPACE_SIZE * 10)) /** * PA_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into * pa_status_t values. */ #define PA_OS_START_EAIERR (PA_OS_START_CANONERR + PA_OS_ERRSPACE_SIZE) /** * PA_OS_START_SYSERR folds platform-specific system error values into * pa_status_t values. */ #define PA_OS_START_SYSERR (PA_OS_START_EAIERR + PA_OS_ERRSPACE_SIZE) /** no error. @see PA_STATUS_IS_SUCCESS */ #define PA_SUCCESS 0 /* APR ERROR VALUES */ /** * @defgroup APRErrorValues Error Values *
 * APR ERROR VALUES
 * PA_ENOSTAT      APR was unable to perform a stat on the file 
 * PA_ENOPOOL      APR was not provided a pool with which to allocate memory
 * PA_EBADDATE     APR was given an invalid date 
 * PA_EINVALSOCK   APR was given an invalid socket
 * PA_ENOPROC      APR was not given a process structure
 * PA_ENOTIME      APR was not given a time structure
 * PA_ENODIR       APR was not given a directory structure
 * PA_ENOLOCK      APR was not given a lock structure
 * PA_ENOPOLL      APR was not given a poll structure
 * PA_ENOSOCKET    APR was not given a socket
 * PA_ENOTHREAD    APR was not given a thread structure
 * PA_ENOTHDKEY    APR was not given a thread key structure
 * PA_ENOSHMAVAIL  There is no more shared memory available
 * PA_EDSOOPEN     APR was unable to open the dso object.  For more 
 *                  information call pa_dso_error().
 * PA_EGENERAL     General failure (specific information not available)
 * PA_EBADIP       The specified IP address is invalid
 * PA_EBADMASK     The specified netmask is invalid
 * 
* *
 * APR STATUS VALUES
 * PA_INCHILD        Program is currently executing in the child
 * PA_INPARENT       Program is currently executing in the parent
 * PA_DETACH         The thread is detached
 * PA_NOTDETACH      The thread is not detached
 * PA_CHILD_DONE     The child has finished executing
 * PA_CHILD_NOTDONE  The child has not finished executing
 * PA_TIMEUP         The operation did not finish before the timeout
 * PA_INCOMPLETE     The operation was incomplete although some processing
 *                    was performed and the results are partially valid
 * PA_BADCH          Getopt found an option not in the option string
 * PA_BADARG         Getopt found an option that is missing an argument 
 *                    and an argument was specified in the option string
 * PA_EOF            APR has encountered the end of the file
 * PA_NOTFOUND       APR was unable to find the socket in the poll structure
 * PA_ANONYMOUS      APR is using anonymous shared memory
 * PA_FILEBASED      APR is using a file name as the key to the shared memory
 * PA_KEYBASED       APR is using a shared key as the key to the shared memory
 * PA_EINIT          Ininitalizer value.  If no option has been found, but 
 *                    the status variable requires a value, this should be used
 * PA_ENOTIMPL       The APR function has not been implemented on this 
 *                    platform, either because nobody has gotten to it yet, 
 *                    or the function is impossible on this platform.
 * PA_EMISMATCH      Two passwords do not match.
 * PA_EABSOLUTE      The given path was absolute.
 * PA_ERELATIVE      The given path was relative.
 * PA_EINCOMPLETE    The given path was neither relative nor absolute.
 * PA_EABOVEROOT     The given path was above the root path.
 * PA_EBUSY          The given lock was busy.
 * 
* @{ */ /** @see PA_STATUS_IS_ENOSTAT */ #define PA_ENOSTAT (PA_OS_START_ERROR + 1) /** @see PA_STATUS_IS_ENOPOOL */ #define PA_ENOPOOL (PA_OS_START_ERROR + 2) /* empty slot: +3 */ /** @see PA_STATUS_IS_EBADDATE */ #define PA_EBADDATE (PA_OS_START_ERROR + 4) /** @see PA_STATUS_IS_EINVALSOCK */ #define PA_EINVALSOCK (PA_OS_START_ERROR + 5) /** @see PA_STATUS_IS_ENOPROC */ #define PA_ENOPROC (PA_OS_START_ERROR + 6) /** @see PA_STATUS_IS_ENOTIME */ #define PA_ENOTIME (PA_OS_START_ERROR + 7) /** @see PA_STATUS_IS_ENODIR */ #define PA_ENODIR (PA_OS_START_ERROR + 8) /** @see PA_STATUS_IS_ENOLOCK */ #define PA_ENOLOCK (PA_OS_START_ERROR + 9) /** @see PA_STATUS_IS_ENOPOLL */ #define PA_ENOPOLL (PA_OS_START_ERROR + 10) /** @see PA_STATUS_IS_ENOSOCKET */ #define PA_ENOSOCKET (PA_OS_START_ERROR + 11) /** @see PA_STATUS_IS_ENOTHREAD */ #define PA_ENOTHREAD (PA_OS_START_ERROR + 12) /** @see PA_STATUS_IS_ENOTHDKEY */ #define PA_ENOTHDKEY (PA_OS_START_ERROR + 13) /** @see PA_STATUS_IS_EGENERAL */ #define PA_EGENERAL (PA_OS_START_ERROR + 14) /** @see PA_STATUS_IS_ENOSHMAVAIL */ #define PA_ENOSHMAVAIL (PA_OS_START_ERROR + 15) /** @see PA_STATUS_IS_EBADIP */ #define PA_EBADIP (PA_OS_START_ERROR + 16) /** @see PA_STATUS_IS_EBADMASK */ #define PA_EBADMASK (PA_OS_START_ERROR + 17) /* empty slot: +18 */ /** @see PA_STATUS_IS_EDSOPEN */ #define PA_EDSOOPEN (PA_OS_START_ERROR + 19) /** @see PA_STATUS_IS_EABSOLUTE */ #define PA_EABSOLUTE (PA_OS_START_ERROR + 20) /** @see PA_STATUS_IS_ERELATIVE */ #define PA_ERELATIVE (PA_OS_START_ERROR + 21) /** @see PA_STATUS_IS_EINCOMPLETE */ #define PA_EINCOMPLETE (PA_OS_START_ERROR + 22) /** @see PA_STATUS_IS_EABOVEROOT */ #define PA_EABOVEROOT (PA_OS_START_ERROR + 23) /** @see PA_STATUS_IS_EBADPATH */ #define PA_EBADPATH (PA_OS_START_ERROR + 24) /* APR STATUS VALUES */ /** @see PA_STATUS_IS_INCHILD */ #define PA_INCHILD (PA_OS_START_STATUS + 1) /** @see PA_STATUS_IS_INPARENT */ #define PA_INPARENT (PA_OS_START_STATUS + 2) /** @see PA_STATUS_IS_DETACH */ #define PA_DETACH (PA_OS_START_STATUS + 3) /** @see PA_STATUS_IS_NOTDETACH */ #define PA_NOTDETACH (PA_OS_START_STATUS + 4) /** @see PA_STATUS_IS_CHILD_DONE */ #define PA_CHILD_DONE (PA_OS_START_STATUS + 5) /** @see PA_STATUS_IS_CHILD_NOTDONE */ #define PA_CHILD_NOTDONE (PA_OS_START_STATUS + 6) /** @see PA_STATUS_IS_TIMEUP */ #define PA_TIMEUP (PA_OS_START_STATUS + 7) /** @see PA_STATUS_IS_INCOMPLETE */ #define PA_INCOMPLETE (PA_OS_START_STATUS + 8) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ /** @see PA_STATUS_IS_BADCH */ #define PA_BADCH (PA_OS_START_STATUS + 12) /** @see PA_STATUS_IS_BADARG */ #define PA_BADARG (PA_OS_START_STATUS + 13) /** @see PA_STATUS_IS_EOF */ #define PA_EOF (PA_OS_START_STATUS + 14) /** @see PA_STATUS_IS_NOTFOUND */ #define PA_NOTFOUND (PA_OS_START_STATUS + 15) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ /** @see PA_STATUS_IS_ANONYMOUS */ #define PA_ANONYMOUS (PA_OS_START_STATUS + 19) /** @see PA_STATUS_IS_FILEBASED */ #define PA_FILEBASED (PA_OS_START_STATUS + 20) /** @see PA_STATUS_IS_KEYBASED */ #define PA_KEYBASED (PA_OS_START_STATUS + 21) /** @see PA_STATUS_IS_EINIT */ #define PA_EINIT (PA_OS_START_STATUS + 22) /** @see PA_STATUS_IS_ENOTIMPL */ #define PA_ENOTIMPL (PA_OS_START_STATUS + 23) /** @see PA_STATUS_IS_EMISMATCH */ #define PA_EMISMATCH (PA_OS_START_STATUS + 24) /** @see PA_STATUS_IS_EBUSY */ #define PA_EBUSY (PA_OS_START_STATUS + 25) /** * @defgroup aprerrcanonical Canonical Errors * @{ */ /* APR CANONICAL ERROR VALUES */ /** @see PA_STATUS_IS_EACCES */ #ifdef EACCES #define PA_EACCES EACCES #else #define PA_EACCES (PA_OS_START_CANONERR + 1) #endif /** @see PA_STATUS_IS_EXIST */ #ifdef EEXIST #define PA_EEXIST EEXIST #else #define PA_EEXIST (PA_OS_START_CANONERR + 2) #endif /** @see PA_STATUS_IS_ENAMETOOLONG */ #ifdef ENAMETOOLONG #define PA_ENAMETOOLONG ENAMETOOLONG #else #define PA_ENAMETOOLONG (PA_OS_START_CANONERR + 3) #endif /** @see PA_STATUS_IS_ENOENT */ #ifdef ENOENT #define PA_ENOENT ENOENT #else #define PA_ENOENT (PA_OS_START_CANONERR + 4) #endif /** @see PA_STATUS_IS_ENOTDIR */ #ifdef ENOTDIR #define PA_ENOTDIR ENOTDIR #else #define PA_ENOTDIR (PA_OS_START_CANONERR + 5) #endif /** @see PA_STATUS_IS_ENOSPC */ #ifdef ENOSPC #define PA_ENOSPC ENOSPC #else #define PA_ENOSPC (PA_OS_START_CANONERR + 6) #endif /** @see PA_STATUS_IS_ENOMEM */ #ifdef ENOMEM #define PA_ENOMEM ENOMEM #else #define PA_ENOMEM (PA_OS_START_CANONERR + 7) #endif /** @see PA_STATUS_IS_EMFILE */ #ifdef EMFILE #define PA_EMFILE EMFILE #else #define PA_EMFILE (PA_OS_START_CANONERR + 8) #endif /** @see PA_STATUS_IS_ENFILE */ #ifdef ENFILE #define PA_ENFILE ENFILE #else #define PA_ENFILE (PA_OS_START_CANONERR + 9) #endif /** @see PA_STATUS_IS_EBADF */ #ifdef EBADF #define PA_EBADF EBADF #else #define PA_EBADF (PA_OS_START_CANONERR + 10) #endif /** @see PA_STATUS_IS_EINVAL */ #ifdef EINVAL #define PA_EINVAL EINVAL #else #define PA_EINVAL (PA_OS_START_CANONERR + 11) #endif /** @see PA_STATUS_IS_ESPIPE */ #ifdef ESPIPE #define PA_ESPIPE ESPIPE #else #define PA_ESPIPE (PA_OS_START_CANONERR + 12) #endif /** * @see PA_STATUS_IS_EAGAIN * @warning use PA_STATUS_IS_EAGAIN instead of just testing this value */ #ifdef EAGAIN #define PA_EAGAIN EAGAIN #elif defined(EWOULDBLOCK) #define PA_EAGAIN EWOULDBLOCK #else #define PA_EAGAIN (PA_OS_START_CANONERR + 13) #endif /** @see PA_STATUS_IS_EINTR */ #ifdef EINTR #define PA_EINTR EINTR #else #define PA_EINTR (PA_OS_START_CANONERR + 14) #endif /** @see PA_STATUS_IS_ENOTSOCK */ #ifdef ENOTSOCK #define PA_ENOTSOCK ENOTSOCK #else #define PA_ENOTSOCK (PA_OS_START_CANONERR + 15) #endif /** @see PA_STATUS_IS_ECONNREFUSED */ #ifdef ECONNREFUSED #define PA_ECONNREFUSED ECONNREFUSED #else #define PA_ECONNREFUSED (PA_OS_START_CANONERR + 16) #endif /** @see PA_STATUS_IS_EINPROGRESS */ #ifdef EINPROGRESS #define PA_EINPROGRESS EINPROGRESS #else #define PA_EINPROGRESS (PA_OS_START_CANONERR + 17) #endif /** * @see PA_STATUS_IS_ECONNABORTED * @warning use PA_STATUS_IS_ECONNABORTED instead of just testing this value */ #ifdef ECONNABORTED #define PA_ECONNABORTED ECONNABORTED #else #define PA_ECONNABORTED (PA_OS_START_CANONERR + 18) #endif /** @see PA_STATUS_IS_ECONNRESET */ #ifdef ECONNRESET #define PA_ECONNRESET ECONNRESET #else #define PA_ECONNRESET (PA_OS_START_CANONERR + 19) #endif /** @see PA_STATUS_IS_ETIMEDOUT */ #ifdef ETIMEDOUT #define PA_ETIMEDOUT ETIMEDOUT #else #define PA_ETIMEDOUT (PA_OS_START_CANONERR + 20) #endif /** @see PA_STATUS_IS_EHOSTUNREACH */ #ifdef EHOSTUNREACH #define PA_EHOSTUNREACH EHOSTUNREACH #else #define PA_EHOSTUNREACH (PA_OS_START_CANONERR + 21) #endif /** @see PA_STATUS_IS_ENETUNREACH */ #ifdef ENETUNREACH #define PA_ENETUNREACH ENETUNREACH #else #define PA_ENETUNREACH (PA_OS_START_CANONERR + 22) #endif /** @see PA_STATUS_IS_EFTYPE */ #ifdef EFTYPE #define PA_EFTYPE EFTYPE #else #define PA_EFTYPE (PA_OS_START_CANONERR + 23) #endif /** @see PA_STATUS_IS_EPIPE */ #ifdef EPIPE #define PA_EPIPE EPIPE #else #define PA_EPIPE (PA_OS_START_CANONERR + 24) #endif /** @see PA_STATUS_IS_EXDEV */ #ifdef EXDEV #define PA_EXDEV EXDEV #else #define PA_EXDEV (PA_OS_START_CANONERR + 25) #endif /** @see PA_STATUS_IS_ENOTEMPTY */ #ifdef ENOTEMPTY #define PA_ENOTEMPTY ENOTEMPTY #else #define PA_ENOTEMPTY (PA_OS_START_CANONERR + 26) #endif /** @} */ #ifdef __cplusplus } #endif #endif /* ! PA_ERRNO_H */ parser-3.4.3/src/lib/cord/Makefile.in000644 000000 000000 00000050546 12172766161 017470 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/cord DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcord_la_LIBADD = am_libcord_la_OBJECTS = cordbscs.lo cordxtra.lo libcord_la_OBJECTS = $(am_libcord_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcord_la_SOURCES) DIST_SOURCES = $(libcord_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -Iinclude -I../../include -I../gc/include noinst_LTLIBRARIES = libcord.la libcord_la_SOURCES = cordbscs.c cordxtra.c EXTRA_DIST = cord.vcproj source.url SUBDIRS = include all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cord/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/cord/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcord.la: $(libcord_la_OBJECTS) $(libcord_la_DEPENDENCIES) $(LINK) $(libcord_la_OBJECTS) $(libcord_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cordbscs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cordxtra.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/lib/cord/source.url000644 000000 000000 00000000133 07707741612 017434 0ustar00rootwheel000000 000000 [InternetShortcut] URL=http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.1.tar.gz parser-3.4.3/src/lib/cord/cordxtra.c000644 000000 000000 00000042554 12172334275 017412 0ustar00rootwheel000000 000000 /* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * * Author: Hans-J. Boehm (boehm@parc.xerox.com) */ /* * These are functions on cords that do not need to understand their * implementation. They serve also serve as example client code for * cord_basics. */ /* Boehm, December 8, 1995 1:53 pm PST */ #include "pa_config_includes.h" #include "cord.h" #include "ec.h" # define I_HIDE_POINTERS /* So we get access to allocation lock. */ /* We use this for lazy file reading, */ /* so that we remain independent */ /* of the threads primitives. */ # include "gc.h" /* For now we assume that pointer reads and writes are atomic, */ /* i.e. another thread always sees the state before or after */ /* a write. This might be false on a Motorola M68K with */ /* pointers that are not 32-bit aligned. But there probably */ /* aren't too many threads packages running on those. */ # define ATOMIC_WRITE(x,y) (x) = (y) # define ATOMIC_READ(x) (*(x)) /* The standard says these are in stdio.h, but they aren't always: */ # ifndef SEEK_SET # define SEEK_SET 0 # endif # ifndef SEEK_END # define SEEK_END 2 # endif # define BUFSZ 2048 /* Size of stack allocated buffers when */ /* we want large buffers. */ typedef void (* oom_fn)(void); # define OUT_OF_MEMORY { if (CORD_oom_fn != (oom_fn) 0) (*CORD_oom_fn)(); \ ABORT("Out of memory\n"); } # define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); } CORD CORD_cat_char(CORD x, char c) { register char * string; if (c == '\0') return(CORD_cat(x, CORD_nul(1))); string = GC_MALLOC_ATOMIC(2); if (string == 0) OUT_OF_MEMORY; string[0] = c; string[1] = '\0'; return(CORD_cat_char_star(x, string, 1)); } CORD CORD_catn(int nargs, ...) { register CORD result = CORD_EMPTY; va_list args; register int i; va_start(args, nargs); for (i = 0; i < nargs; i++) { register CORD next = va_arg(args, CORD); result = CORD_cat(result, next); } va_end(args); return(result); } typedef struct { size_t len; size_t count; char * buf; } CORD_fill_data; int CORD_fill_proc(char c, void * client_data) { register CORD_fill_data * d = (CORD_fill_data *)client_data; register size_t count = d -> count; (d -> buf)[count] = c; d -> count = ++count; if (count >= d -> len) { return(1); } else { return(0); } } int CORD_batched_fill_proc(const char* s, void * client_data) { register CORD_fill_data * d = (CORD_fill_data *)client_data; register size_t count = d -> count; register size_t max = d -> len; register char * buf = d -> buf; register const char* t = s; while((buf[count] = *t++) != '\0') { count++; if (count >= max) { d -> count = count; return(1); } } d -> count = count; return(0); } /* Fill buf with len characters starting at i. */ /* Assumes len characters are available. */ void CORD_fill_buf(CORD x, size_t i, size_t len, char * buf) { CORD_fill_data fd; fd.len = len; fd.buf = buf; fd.count = 0; (void)CORD_iter5(x, i, CORD_fill_proc, CORD_batched_fill_proc, &fd); } int CORD_cmp(CORD x, CORD y) { CORD_pos xpos; CORD_pos ypos; register size_t avail, yavail; if (y == CORD_EMPTY) return(x != CORD_EMPTY); if (x == CORD_EMPTY) return(-1); if (x == y) return (0); if (CORD_IS_STRING(y) && CORD_IS_STRING(x)) return(strcmp(x,y)); CORD_set_pos(xpos, x, 0); CORD_set_pos(ypos, y, 0); for(;;) { if (!CORD_pos_valid(xpos)) { if (CORD_pos_valid(ypos)) { return(-1); } else { return(0); } } if (!CORD_pos_valid(ypos)) { return(1); } if ((avail = CORD_pos_chars_left(xpos)) <= 0 || (yavail = CORD_pos_chars_left(ypos)) <= 0) { register char xcurrent = CORD_pos_fetch(xpos); register char ycurrent = CORD_pos_fetch(ypos); if (xcurrent != ycurrent) return(xcurrent - ycurrent); CORD_next(xpos); CORD_next(ypos); } else { /* process as many characters as we can */ register int result; if (avail > yavail) avail = yavail; result = strncmp(CORD_pos_cur_char_addr(xpos), CORD_pos_cur_char_addr(ypos), avail); if (result != 0) return(result); CORD_pos_advance(xpos, avail); CORD_pos_advance(ypos, avail); } } } int CORD_ncmp(CORD x, size_t x_start, CORD y, size_t y_start, size_t len) { CORD_pos xpos; CORD_pos ypos; register size_t count; register long avail, yavail; CORD_set_pos(xpos, x, x_start); CORD_set_pos(ypos, y, y_start); for(count = 0; count < len;) { if (!CORD_pos_valid(xpos)) { if (CORD_pos_valid(ypos)) { return(-1); } else { return(0); } } if (!CORD_pos_valid(ypos)) { return(1); } if ((avail = CORD_pos_chars_left(xpos)) <= 0 || (yavail = CORD_pos_chars_left(ypos)) <= 0) { register char xcurrent = CORD_pos_fetch(xpos); register char ycurrent = CORD_pos_fetch(ypos); if (xcurrent != ycurrent) return(xcurrent - ycurrent); CORD_next(xpos); CORD_next(ypos); count++; } else { /* process as many characters as we can */ register int result; if (avail > yavail) avail = yavail; count += avail; if (count > len) avail -= (count - len); result = strncmp(CORD_pos_cur_char_addr(xpos), CORD_pos_cur_char_addr(ypos), (size_t)avail); if (result != 0) return(result); CORD_pos_advance(xpos, (size_t)avail); CORD_pos_advance(ypos, (size_t)avail); } } return(0); } char * CORD_to_char_star(CORD x, size_t len) { char * result; if(0 == len) len = CORD_len(x); result = GC_MALLOC_ATOMIC(len + 1); if (result == 0) OUT_OF_MEMORY; CORD_fill_buf(x, 0, len, result); result[len] = '\0'; return(result); } CORD CORD_from_char_star(const char* s) { char * result; size_t len = strlen(s); if (0 == len) return(CORD_EMPTY); result = GC_MALLOC_ATOMIC(len + 1); if (result == 0) OUT_OF_MEMORY; memcpy(result, s, len+1); return(result); } const char* CORD_to_const_char_star(CORD x, size_t len) { if (x == 0) return(""); if (CORD_IS_STRING(x)) return((const char* )x); return(CORD_to_char_star(x, len)); } char CORD_fetch(CORD x, size_t i) { CORD_pos xpos; CORD_set_pos(xpos, x, i); if (!CORD_pos_valid(xpos)) ABORT("bad index?"); return(CORD_pos_fetch(xpos)); } int CORD_put_proc(char c, void * client_data) { register FILE * f = (FILE *)client_data; return(putc(c, f) == EOF); } int CORD_batched_put_proc(const char* s, void * client_data) { register FILE * f = (FILE *)client_data; return(fputs(s, f) == EOF); } int CORD_put(CORD x, FILE * f) { if (CORD_iter5(x, 0, CORD_put_proc, CORD_batched_put_proc, f)) { return(EOF); } else { return(1); } } typedef struct { size_t pos; /* Current position in the cord */ char target; /* Character we're looking for */ } chr_data; int CORD_chr_proc(char c, void * client_data) { register chr_data * d = (chr_data *)client_data; if (c == d -> target) return(1); (d -> pos) ++; return(0); } int CORD_rchr_proc(char c, void * client_data) { register chr_data * d = (chr_data *)client_data; if (c == d -> target) return(1); (d -> pos) --; return(0); } int CORD_batched_chr_proc(const char* s, void * client_data) { register chr_data * d = (chr_data *)client_data; register char * occ = strchr(s, d -> target); if (occ == 0) { d -> pos += strlen(s); return(0); } else { d -> pos += occ - s; return(1); } } size_t CORD_chr(CORD x, size_t i, int c) { chr_data d; d.pos = i; d.target = c; if (CORD_iter5(x, i, CORD_chr_proc, CORD_batched_chr_proc, &d)) { return(d.pos); } else { return(CORD_NOT_FOUND); } } size_t CORD_rchr(CORD x, size_t i, int c) { chr_data d; d.pos = i; d.target = c; if (CORD_riter4(x, i, CORD_rchr_proc, &d)) { return(d.pos); } else { return(CORD_NOT_FOUND); } } /* Find the first occurrence of s in x at position start or later. */ /* This uses an asymptotically poor algorithm, which should typically */ /* perform acceptably. We compare the first few characters directly, */ /* and call CORD_ncmp whenever there is a partial match. */ /* This has the advantage that we allocate very little, or not at all. */ /* It's very fast if there are few close misses. */ size_t CORD_str(CORD x, size_t start, CORD s, size_t xlen) { CORD_pos xpos; size_t slen; register size_t start_len; const char* s_start; unsigned long s_buf = 0; /* The first few characters of s */ unsigned long x_buf = 0; /* Start of candidate substring. */ /* Initialized only to make compilers */ /* happy. */ unsigned long mask = 0; register size_t i; register size_t match_pos; if (s == CORD_EMPTY) return(start); if (CORD_IS_STRING(s)) { s_start = s; slen = strlen(s); } else { s_start = CORD_to_char_star(CORD_substr(s, 0, sizeof(unsigned long), 0), 0); slen = CORD_len(s); } if (xlen < start || xlen - start < slen) return(CORD_NOT_FOUND); start_len = slen; if (start_len > sizeof(unsigned long)) start_len = sizeof(unsigned long); CORD_set_pos(xpos, x, start); for (i = 0; i < start_len; i++) { mask <<= 8; mask |= 0xff; s_buf <<= 8; s_buf |= (unsigned char)s_start[i]; x_buf <<= 8; x_buf |= (unsigned char)CORD_pos_fetch(xpos); CORD_next(xpos); } for (match_pos = start; ; match_pos++) { if ((x_buf & mask) == s_buf) { if (slen == start_len || CORD_ncmp(x, match_pos + start_len, s, start_len, slen - start_len) == 0) { return(match_pos); } } if ( match_pos == xlen - slen ) { return(CORD_NOT_FOUND); } x_buf <<= 8; x_buf |= (unsigned char)CORD_pos_fetch(xpos); CORD_next(xpos); } } void CORD_ec_flush_buf(CORD_ec x) { register size_t len = x[0].ec_bufptr - x[0].ec_buf; char * s; if (len == 0) return; s = GC_MALLOC_ATOMIC(len+1); if (s == 0) OUT_OF_MEMORY; memcpy(s, x[0].ec_buf, len); s[len] = '\0'; x[0].ec_cord = CORD_cat_char_star(x[0].ec_cord, s, len); x[0].ec_bufptr = x[0].ec_buf; } void CORD_ec_append_cord(CORD_ec x, CORD s) { CORD_ec_flush_buf(x); x[0].ec_cord = CORD_cat(x[0].ec_cord, s); } /*ARGSUSED*/ char CORD_nul_func(size_t i, void * client_data) { return((char)(unsigned long)client_data); } #ifdef CORD_CHARS_CACHE static char* cord_chars_cache[256][15]={0}; #endif CORD CORD_chars(char c, size_t i) { if (i>0 && i<16 /* SHORT_LIMIT */) { register char* result; #ifdef CORD_CHARS_CACHE if(cord_chars_cache[(unsigned char)c][i]) return((CORD) cord_chars_cache[(unsigned char)c][i]); #endif result=GC_MALLOC_ATOMIC(i+1); if(result==0) OUT_OF_MEMORY; memset(result, c, i); result[i] = '\0'; #ifdef CORD_CHARS_CACHE cord_chars_cache[(unsigned char)c][i]=result; #endif return((CORD) result); } else { return(CORD_from_fn(CORD_nul_func, (void *)(unsigned long)c, i)); } } CORD CORD_from_file_eager(FILE * f) { register int c; CORD_ec ecord; CORD_ec_init(ecord); for(;;) { c = getc(f); if (c == 0) { /* Append the right number of NULs */ /* Note that any string of NULs is rpresented in 4 words, */ /* independent of its length. */ register size_t count = 1; CORD_ec_flush_buf(ecord); while ((c = getc(f)) == 0) count++; ecord[0].ec_cord = CORD_cat(ecord[0].ec_cord, CORD_nul(count)); } if (c == EOF) break; CORD_ec_append(ecord, c); } (void) fclose(f); return(CORD_balance(CORD_ec_to_cord(ecord))); } /* The state maintained for a lazily read file consists primarily */ /* of a large direct-mapped cache of previously read values. */ /* We could rely more on stdio buffering. That would have 2 */ /* disadvantages: */ /* 1) Empirically, not all fseek implementations preserve the */ /* buffer whenever they could. */ /* 2) It would fail if 2 different sections of a long cord */ /* were being read alternately. */ /* We do use the stdio buffer for read ahead. */ /* To guarantee thread safety in the presence of atomic pointer */ /* writes, cache lines are always replaced, and never modified in */ /* place. */ # define LOG_CACHE_SZ 14 # define CACHE_SZ (1 << LOG_CACHE_SZ) # define LOG_LINE_SZ 9 # define LINE_SZ (1 << LOG_LINE_SZ) typedef struct { size_t tag; char data[LINE_SZ]; /* data[i%LINE_SZ] = ith char in file if tag = i/LINE_SZ */ } cache_line; typedef struct { FILE * lf_file; size_t lf_current; /* Current file pointer value */ cache_line * volatile lf_cache[CACHE_SZ/LINE_SZ]; } lf_state; # define MOD_CACHE_SZ(n) ((n) & (CACHE_SZ - 1)) # define DIV_CACHE_SZ(n) ((n) >> LOG_CACHE_SZ) # define MOD_LINE_SZ(n) ((n) & (LINE_SZ - 1)) # define DIV_LINE_SZ(n) ((n) >> LOG_LINE_SZ) # define LINE_START(n) ((n) & ~(LINE_SZ - 1)) typedef struct { lf_state * state; size_t file_pos; /* Position of needed character. */ cache_line * new_cache; } refill_data; /* Executed with allocation lock. */ static char refill_cache(client_data) refill_data * client_data; { register lf_state * state = client_data -> state; register size_t file_pos = client_data -> file_pos; FILE *f = state -> lf_file; size_t line_start = LINE_START(file_pos); size_t line_no = DIV_LINE_SZ(MOD_CACHE_SZ(file_pos)); cache_line * new_cache = client_data -> new_cache; if (line_start != state -> lf_current && fseek(f, line_start, SEEK_SET) != 0) { ABORT("fseek failed"); } if (fread(new_cache -> data, sizeof(char), LINE_SZ, f) <= file_pos - line_start) { ABORT("fread failed"); } new_cache -> tag = DIV_LINE_SZ(file_pos); /* Store barrier goes here. */ ATOMIC_WRITE(state -> lf_cache[line_no], new_cache); state -> lf_current = line_start + LINE_SZ; return(new_cache->data[MOD_LINE_SZ(file_pos)]); } char CORD_lf_func(size_t i, void * client_data) { register lf_state * state = (lf_state *)client_data; register cache_line * volatile * cl_addr = &(state -> lf_cache[DIV_LINE_SZ(MOD_CACHE_SZ(i))]); register cache_line * cl = (cache_line *)ATOMIC_READ(cl_addr); if (cl == 0 || cl -> tag != DIV_LINE_SZ(i)) { /* Cache miss */ refill_data rd; rd.state = state; rd.file_pos = i; rd.new_cache = GC_NEW_ATOMIC(cache_line); if (rd.new_cache == 0) OUT_OF_MEMORY; return((char)(GC_word) GC_call_with_alloc_lock((GC_fn_type) refill_cache, &rd)); } return(cl -> data[MOD_LINE_SZ(i)]); } /*ARGSUSED*/ void CORD_lf_close_proc(void * obj, void * client_data) { if (fclose(((lf_state *)obj) -> lf_file) != 0) { ABORT("CORD_lf_close_proc: fclose failed"); } } #ifndef PA_DEBUG_DISABLE_GC CORD CORD_from_file_lazy_inner(FILE * f, size_t len) { register lf_state * state = GC_NEW(lf_state); register int i; if (state == 0) OUT_OF_MEMORY; if (len != 0) { /* Dummy read to force buffer allocation. */ /* This greatly increases the probability */ /* of avoiding deadlock if buffer allocation */ /* is redirected to GC_malloc and the */ /* world is multithreaded. */ char buf[1]; (void) fread(buf, 1, 1, f); rewind(f); } state -> lf_file = f; for (i = 0; i < CACHE_SZ/LINE_SZ; i++) { state -> lf_cache[i] = 0; } state -> lf_current = 0; GC_REGISTER_FINALIZER(state, CORD_lf_close_proc, 0, 0, 0); return(CORD_from_fn(CORD_lf_func, state, len)); } CORD CORD_from_file_lazy(FILE * f) { register long len; if (fseek(f, 0l, SEEK_END) != 0) { ABORT("Bad fd argument - fseek failed"); } if ((len = ftell(f)) < 0) { ABORT("Bad fd argument - ftell failed"); } rewind(f); return(CORD_from_file_lazy_inner(f, (size_t)len)); } # define LAZY_THRESHOLD (128*1024 + 1) CORD CORD_from_file(FILE * f) { register long len; if (fseek(f, 0l, SEEK_END) != 0) { ABORT("Bad fd argument - fseek failed"); } if ((len = ftell(f)) < 0) { ABORT("Bad fd argument - ftell failed"); } rewind(f); if (len < LAZY_THRESHOLD) { return(CORD_from_file_eager(f)); } else { return(CORD_from_file_lazy_inner(f, (size_t)len)); } } #endif parser-3.4.3/src/lib/cord/cordbscs.c000644 000000 000000 00000102206 12172334275 017355 0ustar00rootwheel000000 000000 /* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * * Author: Hans-J. Boehm (boehm@parc.xerox.com) */ /* Boehm, October 3, 1994 5:19 pm PDT */ #include "pa_config_includes.h" #include "gc.h" #include "cord.h" /* An implementation of the cord primitives. These are the only */ /* Functions that understand the representation. We perform only */ /* minimal checks on arguments to these functions. Out of bounds */ /* arguments to the iteration functions may result in client functions */ /* invoked on garbage data. In most cases, client functions should be */ /* programmed defensively enough that this does not result in memory */ /* smashes. */ typedef void (* oom_fn)(void); oom_fn CORD_oom_fn = (oom_fn) 0; # define OUT_OF_MEMORY { if (CORD_oom_fn != (oom_fn) 0) (*CORD_oom_fn)(); \ ABORT("Out of memory\n"); } # define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); } typedef unsigned long word; typedef union { struct Concatenation { char null; char header; char depth; /* concatenation nesting depth. */ unsigned char left_len; /* Length of left child if it is sufficiently */ /* short; 0 otherwise. */ # define MAX_LEFT_LEN 255 word len; CORD left; /* length(left) > 0 */ CORD right; /* length(right) > 0 */ } concatenation; struct Function { char null; char header; char depth; /* always 0 */ char left_len; /* always 0 */ word len; CORD_fn fn; void * client_data; } function; struct Generic { char null; char header; char depth; char left_len; word len; } generic; char string[1]; } CordRep; # define CONCAT_HDR 1 # define FN_HDR 4 # define SUBSTR_HDR 6 /* Substring nodes are a special case of function nodes. */ /* The client_data field is known to point to a substr_args */ /* structure, and the function is either CORD_apply_access_fn */ /* or CORD_index_access_fn. */ #ifdef CORD_CAT_OPTIMIZATION #define CONCAT_HDR_RO 3 #define IS_CONCATENATION(s) ((((CordRep *)s)->generic.header & CONCAT_HDR) != 0) #define IS_RW_CONCATENATION(s) (((CordRep *)s)->generic.header == CONCAT_HDR) #else /* The following may be applied only to function and concatenation nodes: */ #define IS_CONCATENATION(s) (((CordRep *)s)->generic.header == CONCAT_HDR) #endif #define IS_FUNCTION(s) ((((CordRep *)s)->generic.header & FN_HDR) != 0) #define IS_SUBSTR(s) (((CordRep *)s)->generic.header == SUBSTR_HDR) #define LEN(s) (((CordRep *)s) -> generic.len) #define DEPTH(s) (((CordRep *)s) -> generic.depth) #define GEN_LEN(s) (CORD_IS_STRING(s) ? strlen(s) : LEN(s)) #define LEFT_LEN(c) ((c) -> left_len != 0? \ (c) -> left_len \ : (CORD_IS_STRING((c) -> left) ? \ (c) -> len - GEN_LEN((c) -> right) \ : LEN((c) -> left))) #define SHORT_LIMIT (sizeof(CordRep) - 1) /* Cords shorter than this are C strings */ /* paf: using knowledge of interal structure to speedup */ char CORD_nul_func(size_t i, void * client_data); /* Dump the internal representation of x to stdout, with initial */ /* indentation level n. */ void CORD_dump_inner(CORD x, unsigned n) { register size_t i; for (i = 0; i < (size_t)n; i++) { fputs(" ", stdout); } if (x == 0) { fputs("NIL\n", stdout); } else if (CORD_IS_STRING(x)) { for (i = 0; i <= SHORT_LIMIT*1000; i++) { if (x[i] == '\0') { putchar('!'); break; } switch(x[i]){ case '\n': putchar('|'); break; case '\r': putchar('#'); break; case '\t': putchar('@'); break; default: putchar(x[i]); break; } } if (x[i] != '\0') fputs("...", stdout); putchar('\n'); } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); printf("Concatenation: %p (len: %d, depth: %d)\n", x, (int)(conc -> len), (int)(conc -> depth)); CORD_dump_inner(conc -> left, n+1); CORD_dump_inner(conc -> right, n+1); } else /* function */{ register struct Function * func = &(((CordRep *)x) -> function); if (IS_SUBSTR(x)) printf("(Substring) "); printf("Function: %p (len: %d): ", x, (int)(func -> len)); for (i = 0; i < 20*1000 && i < func -> len; i++) { putchar((*(func -> fn))(i, func -> client_data)); } if (i < func -> len) fputs("...", stdout); putchar('\n'); } } /* Dump the internal representation of x to stdout */ void CORD_dump(CORD x) { CORD_dump_inner(x, 0); fflush(stdout); } CORD CORD_cat_char_star(CORD x, const char* y, size_t leny) { register size_t result_len; register size_t lenx; register int depth; if (x == CORD_EMPTY) return(y); //if (leny == 0) leny=strlen(y); // PAF if (y == 0) ABORT("CORD_cat_char_star(,y,) y==0"); // PAF if (*y == 0) ABORT("CORD_cat_char_star(,y,) y==\"\""); // PAF if (leny == 0) ABORT("CORD_cat_char_star(,y,) leny==0"); // PAF if (CORD_IS_STRING(x)) { lenx = strlen(x); result_len = lenx + leny; if (result_len <= SHORT_LIMIT) { register char * result = GC_MALLOC_ATOMIC(result_len+1); if (result == 0) OUT_OF_MEMORY; memcpy(result, x, lenx); memcpy(result + lenx, y, leny); result[result_len] = '\0'; return((CORD) result); } else { depth = 1; } } else { register CORD right; register CORD left; register char * new_right; register size_t right_len; lenx = LEN(x); if (leny <= SHORT_LIMIT/2 && IS_CONCATENATION(x) && CORD_IS_STRING(right = ((CordRep *)x) -> concatenation.right)) { /* Merge y into right part of x. */ if (!CORD_IS_STRING(left = ((CordRep *)x) -> concatenation.left)) { right_len = lenx - LEN(left); } else if (((CordRep *)x) -> concatenation.left_len != 0) { right_len = lenx - ((CordRep *)x) -> concatenation.left_len; } else { right_len = strlen(right); } result_len = right_len + leny; /* length of new_right */ if (result_len <= SHORT_LIMIT) { new_right = GC_MALLOC_ATOMIC(result_len + 1); if (new_right == 0) OUT_OF_MEMORY; memcpy(new_right, right, right_len); memcpy(new_right + right_len, y, leny); new_right[result_len] = '\0'; y = new_right; leny = result_len; x = left; lenx -= right_len; /* Now fall through to concatenate the two pieces: */ } if (CORD_IS_STRING(x)) { depth = 1; } else { depth = DEPTH(x) + 1; } } else { depth = DEPTH(x) + 1; } result_len = lenx + leny; } { /* The general case; lenx, result_len is known: */ register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } CORD CORD_cat(CORD x, CORD y) { register size_t result_len; register int depth; register size_t lenx; if (x == CORD_EMPTY) return(y); if (y == CORD_EMPTY) return(x); if (CORD_IS_STRING(y)) { return(CORD_cat_char_star(x, y, strlen(y))); } else if (CORD_IS_STRING(x)) { lenx = strlen(x); depth = DEPTH(y) + 1; } else { register int depthy = DEPTH(y); lenx = LEN(x); depth = DEPTH(x) + 1; if (depthy >= depth) depth = depthy + 1; } result_len = lenx + LEN(y); { register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; // printf("depth=%d\n", depth); if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; // PAF@design.ru bug fix: if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } #ifdef CORD_CAT_OPTIMIZATION void CORD_concatenation_protect(CORD x){ if(IS_RW_CONCATENATION(x)) ((struct Concatenation*)x)->header = CONCAT_HDR_RO; } /* Optimized version to be called from parser code */ CORD CORD_cat_char_star_optimized(CORD x, const char* y, size_t leny) { register size_t result_len; register size_t lenx; register int depth; if (x == CORD_EMPTY) return(y); //if (leny == 0) leny=strlen(y); // PAF if (y == 0) ABORT("CORD_cat_char_star(,y,) y==0"); // PAF if (*y == 0) ABORT("CORD_cat_char_star(,y,) y==\"\""); // PAF if (leny == 0) ABORT("CORD_cat_char_star(,y,) leny==0"); // PAF if (CORD_IS_STRING(x)) { lenx = strlen(x); result_len = lenx + leny; if (result_len <= SHORT_LIMIT) { register char * result = GC_MALLOC_ATOMIC(result_len+1); if (result == 0) OUT_OF_MEMORY; memcpy(result, x, lenx); memcpy(result + lenx, y, leny); result[result_len] = '\0'; return((CORD) result); } else { depth = 1; } } else { register CORD right; register CORD left; register char * new_right; register size_t right_len; lenx = LEN(x); if ( leny <= SHORT_LIMIT/2 && IS_CONCATENATION(x) && CORD_IS_STRING(right = ((CordRep *)x) -> concatenation.right) ){ /* Merge y into right part of x. */ if (!CORD_IS_STRING(left = ((CordRep *)x) -> concatenation.left)) { right_len = lenx - LEN(left); } else if (((CordRep *)x) -> concatenation.left_len != 0) { right_len = lenx - ((CordRep *)x) -> concatenation.left_len; } else { right_len = strlen(right); } result_len = right_len + leny; /* length of new_right */ if (result_len <= SHORT_LIMIT) { new_right = GC_MALLOC_ATOMIC(result_len + 1); if (new_right == 0) OUT_OF_MEMORY; memcpy(new_right, right, right_len); memcpy(new_right + right_len, y, leny); new_right[result_len] = '\0'; if (IS_RW_CONCATENATION(x)) { // Optimization: instead of new Concatenation current is modified ((CordRep *)x) -> concatenation.right=new_right; ((CordRep *)x) -> concatenation.len += leny; return x; } y = new_right; leny = result_len; x = left; lenx -= right_len; /* Now fall through to concatenate the two pieces: */ } if (CORD_IS_STRING(x)) { depth = 1; } else { depth = DEPTH(x) + 1; } } else { depth = DEPTH(x) + 1; } result_len = lenx + leny; } { /* The general case; lenx, result_len is known: */ register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } /* Optimized version to be called from parser code */ CORD CORD_cat_optimized(CORD x, CORD y) { register size_t result_len; register int depth; register size_t lenx; if (x == CORD_EMPTY){ CORD_concatenation_protect(y); // to guarantee y won't be modified return(y); } if (y == CORD_EMPTY) return(x); if (CORD_IS_STRING(y)) { return(CORD_cat_char_star_optimized(x, y, strlen(y))); // optimized version is called } else if (CORD_IS_STRING(x)) { lenx = strlen(x); depth = DEPTH(y) + 1; } else { register int depthy = DEPTH(y); lenx = LEN(x); depth = DEPTH(x) + 1; if (depthy >= depth) depth = depthy + 1; } result_len = lenx + LEN(y); { register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; // printf("depth=%d\n", depth); if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; // PAF@design.ru bug fix: if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } #endif CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len) { if (len <= 0) return(0); if (len <= SHORT_LIMIT) { register char * result; register size_t i; char buf[SHORT_LIMIT+1]; register char c; for (i = 0; i < len; i++) { c = (*fn)(i, client_data); if (c == '\0') goto gen_case; buf[i] = c; } buf[i] = '\0'; result = GC_MALLOC_ATOMIC(len+1); if (result == 0) OUT_OF_MEMORY; strcpy(result, buf); result[len] = '\0'; return((CORD) result); } gen_case: { register struct Function * result; result = GC_NEW(struct Function); if (result == 0) OUT_OF_MEMORY; result->header = FN_HDR; /* depth is already 0 */ result->len = len; result->fn = fn; result->client_data = client_data; return((CORD) result); } } size_t CORD_len(CORD x) { if (x == 0) { return(0); } else { return(GEN_LEN(x)); } } struct substr_args { CordRep * sa_cord; size_t sa_index; }; char CORD_index_access_fn(size_t i, void * client_data) { register struct substr_args *descr = (struct substr_args *)client_data; return(((char *)(descr->sa_cord))[i + descr->sa_index]); } char CORD_apply_access_fn(size_t i, void * client_data) { register struct substr_args *descr = (struct substr_args *)client_data; register struct Function * fn_cord = &(descr->sa_cord->function); return((*(fn_cord->fn))(i + descr->sa_index, fn_cord->client_data)); } /* A version of CORD_substr that simply returns a function node, thus */ /* postponing its work. The fourth argument is a function that may */ /* be used for efficient access to the ith character. */ /* Assumes i >= 0 and i + n < length(x). */ CORD CORD_substr_closure(CORD x, size_t i, size_t n, CORD_fn f) { register struct substr_args * sa = GC_NEW(struct substr_args); CORD result; if (sa == 0) OUT_OF_MEMORY; sa->sa_cord = (CordRep *)x; sa->sa_index = i; result = CORD_from_fn(f, (void *)sa, n); ((CordRep *)result) -> function.header = SUBSTR_HDR; return (result); } # define SUBSTR_LIMIT (10 * SHORT_LIMIT) /* Substrings of function nodes and flat strings shorter than */ /* this are flat strings. Othewise we use a functional */ /* representation, which is significantly slower to access. */ /* A version of CORD_substr that assumes i >= 0, n > 0, and i + n < length(x).*/ CORD CORD_substr_checked(CORD x, size_t i, size_t n) { if (CORD_IS_STRING(x)) { if (n > SUBSTR_LIMIT) { return(CORD_substr_closure(x, i, n, CORD_index_access_fn)); } else { register char * result = GC_MALLOC_ATOMIC(n+1); if (result == 0) OUT_OF_MEMORY; strncpy(result, x+i, n); result[n] = '\0'; return(result); } } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); register size_t left_len; register size_t right_len; left_len = LEFT_LEN(conc); right_len = conc -> len - left_len; if (i >= left_len) { if (n == right_len) return(conc -> right); return(CORD_substr_checked(conc -> right, i - left_len, n)); } else if (i+n <= left_len) { if (n == left_len) return(conc -> left); return(CORD_substr_checked(conc -> left, i, n)); } else { /* Need at least one character from each side. */ register CORD left_part; register CORD right_part; register size_t left_part_len = left_len - i; if (i == 0) { left_part = conc -> left; } else { left_part = CORD_substr_checked(conc -> left, i, left_part_len); } if (i + n == right_len + left_len) { right_part = conc -> right; } else { right_part = CORD_substr_checked(conc -> right, 0, n - left_part_len); } return(CORD_cat(left_part, right_part)); } } else /* function */ { if (n > SUBSTR_LIMIT) { if (IS_SUBSTR(x)) { /* Avoid nesting substring nodes. */ register struct Function * f = &(((CordRep *)x) -> function); register struct substr_args *descr = (struct substr_args *)(f -> client_data); return(CORD_substr_closure((CORD)descr->sa_cord, i + descr->sa_index, n, f -> fn)); } else { return(CORD_substr_closure(x, i, n, CORD_apply_access_fn)); } } else { char * result; register struct Function * f = &(((CordRep *)x) -> function); char buf[SUBSTR_LIMIT+1]; register char * p = buf; register char c; register int j; register int lim = i + n; for (j = i; j < lim; j++) { c = (*(f -> fn))(j, f -> client_data); if (c == '\0') { return(CORD_substr_closure(x, i, n, CORD_apply_access_fn)); } *p++ = c; } *p = '\0'; result = GC_MALLOC_ATOMIC(n+1); if (result == 0) OUT_OF_MEMORY; strcpy(result, buf); return(result); } } } CORD CORD_substr(CORD x, size_t i, size_t n, size_t len) { if(0 == len) len = CORD_len(x); if (i >= len || n <= 0) return(0); /* n < 0 is impossible in a correct C implementation, but */ /* quite possible under SunOS 4.X. */ if (i + n > len) n = len - i; # ifndef __STDC__ if (i < 0) ABORT("CORD_substr: second arg. negative"); /* Possible only if both client and C implementation are buggy. */ /* But empirically this happens frequently. */ # endif return(CORD_substr_checked(x, i, n)); } /* See cord.h for definition. We assume i is in range. */ int CORD_iter5(CORD x, size_t i, CORD_iter_fn f1, CORD_batched_iter_fn f2, void * client_data) { int result; if (x == 0) return(0); if (CORD_IS_STRING(x)) { register const char* p = x+i; if (*p == '\0') ABORT("2nd arg to CORD_iter5 too big"); if (f2 != CORD_NO_FN) { return((*f2)(p, client_data)); } else { while (*p) { if (result=(*f1)(*p, client_data)) return result; p++; } return(0); } } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); if (i > 0) { register size_t left_len = LEFT_LEN(conc); if (i >= left_len) { return(CORD_iter5(conc -> right, i - left_len, f1, f2, client_data)); } } result=CORD_iter5(conc -> left, i, f1, f2, client_data); if (result) return result; return(CORD_iter5(conc -> right, 0, f1, f2, client_data)); } else /* function */ { register struct Function * f = &(((CordRep *)x) -> function); register size_t j; register size_t lim = f -> len; for (j = i; j < lim; j++) { if (result=(*f1)((*(f -> fn))(j, f -> client_data), client_data)) return result; } return(0); } } /* See cord.h for definition. We assume i is in range. */ int CORD_block_iter(CORD x, size_t i, CORD_block_iter_fn fb, void * client_data) { int result; if (x == 0) return(0); if (CORD_IS_STRING(x)) { register const char* p = x+i; const char *b=p; char bc=*b; int pc; if (bc == '\0') ABORT("2nd arg to CORD_iter5 too big"); do { pc=*++p; if(pc!=bc) { if (result=fb(bc, p-b, client_data)) return result; b=p; bc=pc; } } while (pc); return(0); } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc= &(((CordRep *)x) -> concatenation); if (i > 0) { register size_t left_len = LEFT_LEN(conc); if (i >= left_len) { return(CORD_block_iter(conc -> right, i - left_len, fb, client_data)); } } result=CORD_block_iter(conc -> left, i, fb, client_data); if (result) return result; return(CORD_block_iter(conc -> right, 0, fb, client_data)); } else /* function */ { register struct Function * f = &(((CordRep *)x) -> function); register size_t lim = f -> len; if(f->fn == CORD_nul_func ) { if (result=fb((char)(unsigned long)f -> client_data, f -> len-i, client_data)) return result; } else if(f->fn == CORD_apply_access_fn) { register struct substr_args *descr = (struct substr_args *)f->client_data; register struct Function * fn_cord = &(descr->sa_cord->function); if(fn_cord->fn == CORD_nul_func ) { if (result=fb((char)(unsigned long)fn_cord->client_data, f -> len-i, client_data)) return result; } else ABORT("CORD_block_iter:CORD_apply_access_fn:unknown_fn should not happen"); } else { if(f->fn == CORD_index_access_fn) ABORT("CORD_block_iter:CORD_index_access_fn should not happen"); ABORT("CORD_block_iter:unknown_fn should not happen"); } } return(0); } #undef CORD_iter int CORD_iter(CORD x, CORD_iter_fn f1, void * client_data) { return(CORD_iter5(x, 0, f1, CORD_NO_FN, client_data)); } int CORD_riter4(CORD x, size_t i, CORD_iter_fn f1, void * client_data) { if (x == 0) return(0); if (CORD_IS_STRING(x)) { register const char* p = x + i; register char c; for(;;) { c = *p; if (c == '\0') ABORT("2nd arg to CORD_riter4 too big"); if ((*f1)(c, client_data)) return(1); if (p == x) break; p--; } return(0); } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); register CORD left_part = conc -> left; register size_t left_len; left_len = LEFT_LEN(conc); if (i >= left_len) { if (CORD_riter4(conc -> right, i - left_len, f1, client_data)) { return(1); } return(CORD_riter4(left_part, left_len - 1, f1, client_data)); } else { return(CORD_riter4(left_part, i, f1, client_data)); } } else /* function */ { register struct Function * f = &(((CordRep *)x) -> function); register size_t j; for (j = i; ; j--) { if ((*f1)((*(f -> fn))(j, f -> client_data), client_data)) { return(1); } if (j == 0) return(0); } } } int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data) { return(CORD_riter4(x, CORD_len(x) - 1, f1, client_data)); } /* * The following functions are concerned with balancing cords. * Strategy: * Scan the cord from left to right, keeping the cord scanned so far * as a forest of balanced trees of exponentialy decreasing length. * When a new subtree needs to be added to the forest, we concatenate all * shorter ones to the new tree in the appropriate order, and then insert * the result into the forest. * Crucial invariants: * 1. The concatenation of the forest (in decreasing order) with the * unscanned part of the rope is equal to the rope being balanced. * 2. All trees in the forest are balanced. * 3. forest[i] has depth at most i. */ typedef struct { CORD c; size_t len; /* Actual length of c */ } ForestElement; static size_t min_len [ MAX_DEPTH ]; static int min_len_init = 0; int CORD_max_len; typedef ForestElement Forest [ MAX_DEPTH ]; /* forest[i].len >= fib(i+1) */ /* The string is the concatenation */ /* of the forest in order of DECREASING */ /* indices. */ void CORD_init_min_len() { register int i; register size_t last, previous, current; min_len[0] = previous = 1; min_len[1] = last = 2; for (i = 2; i < MAX_DEPTH; i++) { current = last + previous; if (current < last) /* overflow */ current = last; min_len[i] = current; previous = last; last = current; } CORD_max_len = last - 1; min_len_init = 1; } void CORD_init_forest(ForestElement * forest, size_t max_len) { register int i; for (i = 0; i < MAX_DEPTH; i++) { forest[i].c = 0; if (min_len[i] > max_len) return; } ABORT("Cord too long"); } /* Add a leaf to the appropriate level in the forest, cleaning */ /* out lower levels as necessary. */ /* Also works if x is a balanced tree of concatenations; however */ /* in this case an extra concatenation node may be inserted above x; */ /* This node should not be counted in the statement of the invariants. */ void CORD_add_forest(ForestElement * forest, CORD x, size_t len) { register int i = 0; register CORD sum = CORD_EMPTY; register size_t sum_len = 0; while (len > min_len[i + 1]) { if (forest[i].c != 0) { sum = CORD_cat(forest[i].c, sum); sum_len += forest[i].len; forest[i].c = 0; } i++; } /* Sum has depth at most 1 greter than what would be required */ /* for balance. */ sum = CORD_cat(sum, x); sum_len += len; /* If x was a leaf, then sum is now balanced. To see this */ /* consider the two cases in which forest[i-1] either is or is */ /* not empty. */ while (sum_len >= min_len[i]) { if (forest[i].c != 0) { sum = CORD_cat(forest[i].c, sum); sum_len += forest[i].len; /* This is again balanced, since sum was balanced, and has */ /* allowable depth that differs from i by at most 1. */ forest[i].c = 0; } i++; } i--; forest[i].c = sum; forest[i].len = sum_len; } CORD CORD_concat_forest(ForestElement * forest, size_t expected_len) { register int i = 0; CORD sum = 0; size_t sum_len = 0; while (sum_len != expected_len) { if (forest[i].c != 0) { sum = CORD_cat(forest[i].c, sum); sum_len += forest[i].len; } i++; } return(sum); } /* Insert the frontier of x into forest. Balanced subtrees are */ /* treated as leaves. This potentially adds one to the depth */ /* of the final tree. */ void CORD_balance_insert(CORD x, size_t len, ForestElement * forest) { register int depth; if (CORD_IS_STRING(x)) { CORD_add_forest(forest, x, len); } else if (IS_CONCATENATION(x) && ((depth = DEPTH(x)) >= MAX_DEPTH || len < min_len[depth])) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); size_t left_len = LEFT_LEN(conc); CORD_balance_insert(conc -> left, left_len, forest); CORD_balance_insert(conc -> right, len - left_len, forest); } else /* function or balanced */ { CORD_add_forest(forest, x, len); } } CORD CORD_balance(CORD x) { Forest forest; register size_t len; if (x == 0) return(0); if (CORD_IS_STRING(x)) return(x); if (!min_len_init) CORD_init_min_len(); len = LEN(x); CORD_init_forest(forest, len); CORD_balance_insert(x, len, forest); return(CORD_concat_forest(forest, len)); } /* Position primitives */ /* Private routines to deal with the hard cases only: */ /* P contains a prefix of the path to cur_pos. Extend it to a full */ /* path and set up leaf info. */ /* Return 0 if past the end of cord, 1 o.w. */ void CORD__extend_path(register CORD_pos p) { register struct CORD_pe * current_pe = &(p[0].path[p[0].path_len]); register CORD top = current_pe -> pe_cord; register size_t pos = p[0].cur_pos; register size_t top_pos = current_pe -> pe_start_pos; register size_t top_len = GEN_LEN(top); /* Fill in the rest of the path. */ while(!CORD_IS_STRING(top) && IS_CONCATENATION(top)) { register struct Concatenation * conc = &(((CordRep *)top) -> concatenation); register size_t left_len; left_len = LEFT_LEN(conc); current_pe++; if (pos >= top_pos + left_len) { current_pe -> pe_cord = top = conc -> right; current_pe -> pe_start_pos = top_pos = top_pos + left_len; top_len -= left_len; } else { current_pe -> pe_cord = top = conc -> left; current_pe -> pe_start_pos = top_pos; top_len = left_len; } p[0].path_len++; } /* Fill in leaf description for fast access. */ if (CORD_IS_STRING(top)) { p[0].cur_leaf = top; p[0].cur_start = top_pos; p[0].cur_end = top_pos + top_len; } else { p[0].cur_end = 0; } if (pos >= top_pos + top_len) p[0].path_len = CORD_POS_INVALID; } char CORD__pos_fetch(register CORD_pos p) { /* Leaf is a function node */ struct CORD_pe * pe = &((p)[0].path[(p)[0].path_len]); CORD leaf = pe -> pe_cord; register struct Function * f = &(((CordRep *)leaf) -> function); if (!IS_FUNCTION(leaf)) ABORT("CORD_pos_fetch: bad leaf"); return ((*(f -> fn))(p[0].cur_pos - pe -> pe_start_pos, f -> client_data)); } void CORD__next(register CORD_pos p) { register size_t cur_pos = p[0].cur_pos + 1; register struct CORD_pe * current_pe = &((p)[0].path[(p)[0].path_len]); register CORD leaf = current_pe -> pe_cord; /* Leaf is not a string or we're at end of leaf */ p[0].cur_pos = cur_pos; if (!CORD_IS_STRING(leaf)) { /* Function leaf */ register struct Function * f = &(((CordRep *)leaf) -> function); register size_t start_pos = current_pe -> pe_start_pos; register size_t end_pos = start_pos + f -> len; if (cur_pos < end_pos) { /* Fill cache and return. */ register size_t i; register size_t limit = cur_pos + FUNCTION_BUF_SZ; register CORD_fn fn = f -> fn; register void * client_data = f -> client_data; if (limit > end_pos) { limit = end_pos; } for (i = cur_pos; i < limit; i++) { p[0].function_buf[i - cur_pos] = (*fn)(i - start_pos, client_data); } p[0].cur_start = cur_pos; p[0].cur_leaf = p[0].function_buf; p[0].cur_end = limit; return; } } /* End of leaf */ /* Pop the stack until we find two concatenation nodes with the */ /* same start position: this implies we were in left part. */ { while (p[0].path_len > 0 && current_pe[0].pe_start_pos != current_pe[-1].pe_start_pos) { p[0].path_len--; current_pe--; } if (p[0].path_len == 0) { p[0].path_len = CORD_POS_INVALID; return; } } p[0].path_len--; CORD__extend_path(p); } void CORD__prev(register CORD_pos p) { register struct CORD_pe * pe = &(p[0].path[p[0].path_len]); if (p[0].cur_pos == 0) { p[0].path_len = CORD_POS_INVALID; return; } p[0].cur_pos--; if (p[0].cur_pos >= pe -> pe_start_pos) return; /* Beginning of leaf */ /* Pop the stack until we find two concatenation nodes with the */ /* different start position: this implies we were in right part. */ { register struct CORD_pe * current_pe = &((p)[0].path[(p)[0].path_len]); while (p[0].path_len > 0 && current_pe[0].pe_start_pos == current_pe[-1].pe_start_pos) { p[0].path_len--; current_pe--; } } p[0].path_len--; CORD__extend_path(p); } #undef CORD_pos_fetch #undef CORD_next #undef CORD_prev #undef CORD_pos_to_index #undef CORD_pos_to_cord #undef CORD_pos_valid char CORD_pos_fetch(register CORD_pos p) { if (p[0].cur_start <= p[0].cur_pos && p[0].cur_pos < p[0].cur_end) { return(p[0].cur_leaf[p[0].cur_pos - p[0].cur_start]); } else { return(CORD__pos_fetch(p)); } } void CORD_next(CORD_pos p) { if (p[0].cur_pos < p[0].cur_end - 1) { p[0].cur_pos++; } else { CORD__next(p); } } void CORD_prev(CORD_pos p) { if (p[0].cur_end != 0 && p[0].cur_pos > p[0].cur_start) { p[0].cur_pos--; } else { CORD__prev(p); } } size_t CORD_pos_to_index(CORD_pos p) { return(p[0].cur_pos); } CORD CORD_pos_to_cord(CORD_pos p) { return(p[0].path[0].pe_cord); } int CORD_pos_valid(CORD_pos p) { return(p[0].path_len != CORD_POS_INVALID); } void CORD_set_pos(CORD_pos p, CORD x, size_t i) { if (x == CORD_EMPTY) { p[0].path_len = CORD_POS_INVALID; return; } p[0].path[0].pe_cord = x; p[0].path[0].pe_start_pos = 0; p[0].path_len = 0; p[0].cur_pos = i; CORD__extend_path(p); } parser-3.4.3/src/lib/cord/Makefile.am000644 000000 000000 00000000271 12172762053 017441 0ustar00rootwheel000000 000000 INCLUDES = -Iinclude -I../../include -I../gc/include noinst_LTLIBRARIES = libcord.la libcord_la_SOURCES = cordbscs.c cordxtra.c EXTRA_DIST = cord.vcproj source.url SUBDIRS = include parser-3.4.3/src/lib/cord/include/000755 000000 000000 00000000000 12234223575 017030 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/cord/cord.vcproj000644 000000 000000 00000020365 12173025677 017574 0ustar00rootwheel000000 000000 parser-3.4.3/src/lib/cord/include/ec.h000644 000000 000000 00000003362 07707741612 017602 0ustar00rootwheel000000 000000 # ifndef EC_H # define EC_H # ifndef CORD_H # include "cord.h" # endif /* Extensible cords are strings that may be destructively appended to. */ /* They allow fast construction of cords from characters that are */ /* being read from a stream. */ /* * A client might look like: * * { * CORD_ec x; * CORD result; * char c; * FILE *f; * * ... * CORD_ec_init(x); * while(...) { * c = getc(f); * ... * CORD_ec_append(x, c); * } * result = CORD_balance(CORD_ec_to_cord(x)); * * If a C string is desired as the final result, the call to CORD_balance * may be replaced by a call to CORD_to_char_star. */ # ifndef CORD_BUFSZ # define CORD_BUFSZ 128 # endif typedef struct CORD_ec_struct { CORD ec_cord; char * ec_bufptr; char ec_buf[CORD_BUFSZ+1]; } CORD_ec[1]; /* This structure represents the concatenation of ec_cord with */ /* ec_buf[0 ... (ec_bufptr-ec_buf-1)] */ /* Flush the buffer part of the extended chord into ec_cord. */ /* Note that this is almost the only real function, and it is */ /* implemented in 6 lines in cordxtra.c */ void CORD_ec_flush_buf(CORD_ec x); /* Convert an extensible cord to a cord. */ # define CORD_ec_to_cord(x) (CORD_ec_flush_buf(x), (x)[0].ec_cord) /* Initialize an extensible cord. */ # define CORD_ec_init(x) ((x)[0].ec_cord = 0, (x)[0].ec_bufptr = (x)[0].ec_buf) /* Append a character to an extensible cord. */ # define CORD_ec_append(x, c) \ { \ if ((x)[0].ec_bufptr == (x)[0].ec_buf + CORD_BUFSZ) { \ CORD_ec_flush_buf(x); \ } \ *((x)[0].ec_bufptr)++ = (c); \ } /* Append a cord to an extensible cord. Structure remains shared with */ /* original. */ void CORD_ec_append_cord(CORD_ec x, CORD s); # endif /* EC_H */ parser-3.4.3/src/lib/cord/include/Makefile.in000644 000000 000000 00000043052 11766635215 021110 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/cord/include DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = private noinst_HEADERS = cord.h ec.h all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cord/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/cord/include/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/lib/cord/include/cord.h000644 000000 000000 00000032515 12172762053 020136 0ustar00rootwheel000000 000000 /* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * * Author: Hans-J. Boehm (boehm@parc.xerox.com) */ /* Boehm, October 5, 1995 4:20 pm PDT */ /* * Cords are immutable character strings. A number of operations * on long cords are much more efficient than their strings.h counterpart. * In particular, concatenation takes constant time independent of the length * of the arguments. (Cords are represented as trees, with internal * nodes representing concatenation and leaves consisting of either C * strings or a functional description of the string.) * * The following are reasonable applications of cords. They would perform * unacceptably if C strings were used: * - A compiler that produces assembly language output by repeatedly * concatenating instructions onto a cord representing the output file. * - A text editor that converts the input file to a cord, and then * performs editing operations by producing a new cord representing * the file after echa character change (and keeping the old ones in an * edit history) * * For optimal performance, cords should be built by * concatenating short sections. * This interface is designed for maximum compatibility with C strings. * ASCII NUL characters may be embedded in cords using CORD_from_fn. * This is handled correctly, but CORD_to_char_star will produce a string * with embedded NULs when given such a cord. * * This interface is fairly big, largely for performance reasons. * The most basic constants and functions: * * CORD - the type of a cord; * CORD_EMPTY - empty cord; * CORD_len(cord) - length of a cord; * CORD_cat(cord1,cord2) - concatenation of two cords; * CORD_substr(cord, start, len) - substring (or subcord); * CORD_pos i; CORD_FOR(i, cord) { ... CORD_pos_fetch(i) ... } - * examine each character in a cord. CORD_pos_fetch(i) is the char. * CORD_fetch(int i) - Retrieve i'th character (slowly). * CORD_cmp(cord1, cord2) - compare two cords. * CORD_from_file(FILE * f) - turn a read-only file into a cord. * CORD_to_char_star(cord) - convert to C string. * (Non-NULL C constant strings are cords.) * CORD_printf (etc.) - cord version of printf. Use %r for cords. */ # ifndef CORD_H # define CORD_H # include # include /* Cords have type const char *. This is cheating quite a bit, and not */ /* 100% portable. But it means that nonempty character string */ /* constants may be used as cords directly, provided the string is */ /* never modified in place. The empty cord is represented by, and */ /* can be written as, 0. */ typedef const char * CORD; /* An empty cord is always represented as nil */ # define CORD_EMPTY 0 /* Is a nonempty cord represented as a C string? */ #define CORD_IS_STRING(s) (*(s) != '\0') /* Allows struct Concatenation modification on merge in CORD_cat, thus all source Concatenation structs must be prepared for this */ #define CORD_CAT_OPTIMIZATION /* Caches CORD_chars result to avoide useless allocations */ #define CORD_CHARS_CACHE /* Concatenate two cords. If the arguments are C strings, they may */ /* not be subsequently altered. */ CORD CORD_cat(CORD x, CORD y); /* Concatenate a cord and a C string with known length. Except for the */ /* empty string case, this is a special case of CORD_cat. Since the */ /* length is known, it can be faster. */ /* The string y is shared with the resulting CORD. Hence it should */ /* not be altered by the caller. */ /* PAF@design.ru: but there is a ~bug in case (0, "123", 2), it returns "123", and later appends after '3', not '2'. so BEWARE: NOT USE IT THAT WAY and changing 'leny' convention: now, if it's 0, then function does leny=strlen(y) */ CORD CORD_cat_char_star(CORD x, const char * y, size_t leny); #ifdef CORD_CAT_OPTIMIZATION void CORD_concatenation_protect(CORD x); CORD CORD_cat_optimized(CORD x, CORD y); CORD CORD_cat_char_star_optimized(CORD x, const char * y, size_t leny); #endif /* Compute the length of a cord */ size_t CORD_len(CORD x); /* Cords may be represented by functions defining the ith character */ typedef char (* CORD_fn)(size_t i, void * client_data); /* Turn a functional description into a cord. */ CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len); /* Turn a functional description into a cord, only conjunction&func. */ CORD CORD_from_fn_gen(CORD_fn fn, void * client_data, size_t len); /* Return the substring (subcord really) of x with length at most n, */ /* starting at position i. (The initial character has position 0.) */ CORD CORD_substr(CORD x, size_t i, size_t n, size_t len); /* Return the argument, but rebalanced to allow more efficient */ /* character retrieval, substring operations, and comparisons. */ /* This is useful only for cords that were built using repeated */ /* concatenation. Guarantees log time access to the result, unless */ /* x was obtained through a large number of repeated substring ops */ /* or the embedded functional descriptions take longer to evaluate. */ /* May reallocate significant parts of the cord. The argument is not */ /* modified; only the result is balanced. */ CORD CORD_balance(CORD x); /* The following traverse a cord by applying a function to each */ /* character. This is occasionally appropriate, especially where */ /* speed is crucial. But, since C doesn't have nested functions, */ /* clients of this sort of traversal are clumsy to write. Consider */ /* the functions that operate on cord positions instead. */ /* Function to iteratively apply to individual characters in cord. */ typedef int (* CORD_iter_fn)(char c, void * client_data); /* Function to iteratively apply to individual block in cord. */ typedef int (* CORD_block_iter_fn)(char c, size_t len, void* client_data); /* Function to apply to substrings of a cord. Each substring is a */ /* a C character string, not a general cord. */ typedef int (* CORD_batched_iter_fn)(const char * s, void * client_data); # define CORD_NO_FN ((CORD_batched_iter_fn)0) /* Apply f1 to each character in the cord, in ascending order, */ /* starting at position i. If */ /* f2 is not CORD_NO_FN, then multiple calls to f1 may be replaced by */ /* a single call to f2. The parameter f2 is provided only to allow */ /* some optimization by the client. This terminates when the right */ /* end of this string is reached, or when f1 or f2 return != 0. In the */ /* latter case CORD_iter returns != 0. Otherwise it returns 0. */ /* The specified value of i must be < CORD_len(x). */ int CORD_iter5(CORD x, size_t i, CORD_iter_fn f1, CORD_batched_iter_fn f2, void * client_data); /* iterate over function block in cord */ int CORD_block_iter(CORD x, size_t i, CORD_block_iter_fn f1, void * client_data); /* A simpler version that starts at 0, and without f2: */ int CORD_iter(CORD x, CORD_iter_fn f1, void * client_data); # define CORD_iter(x, f1, cd) CORD_iter5(x, 0, f1, CORD_NO_FN, cd) /* Similar to CORD_iter5, but end-to-beginning. No provisions for */ /* CORD_batched_iter_fn. */ int CORD_riter4(CORD x, size_t i, CORD_iter_fn f1, void * client_data); /* A simpler version that starts at the end: */ int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data); /* Functions that operate on cord positions. The easy way to traverse */ /* cords. A cord position is logically a pair consisting of a cord */ /* and an index into that cord. But it is much faster to retrieve a */ /* charcter based on a position than on an index. Unfortunately, */ /* positions are big (order of a few 100 bytes), so allocate them with */ /* caution. */ /* Things in cord_pos.h should be treated as opaque, except as */ /* described below. Also note that */ /* CORD_pos_fetch, CORD_next and CORD_prev have both macro and function */ /* definitions. The former may evaluate their argument more than once. */ # include "private/cord_pos.h" /* Visible definitions from above: typedef CORD_pos[1]; * Extract the cord from a position: CORD CORD_pos_to_cord(CORD_pos p); * Extract the current index from a position: size_t CORD_pos_to_index(CORD_pos p); * Fetch the character located at the given position: char CORD_pos_fetch(CORD_pos p); * Initialize the position to refer to the given cord and index. * Note that this is the most expensive function on positions: void CORD_set_pos(CORD_pos p, CORD x, size_t i); * Advance the position to the next character. * P must be initialized and valid. * Invalidates p if past end: void CORD_next(CORD_pos p); * Move the position to the preceding character. * P must be initialized and valid. * Invalidates p if past beginning: void CORD_prev(CORD_pos p); * Is the position valid, i.e. inside the cord? int CORD_pos_valid(CORD_pos p); */ # define CORD_FOR(pos, cord) \ for (CORD_set_pos(pos, cord, 0); CORD_pos_valid(pos); CORD_next(pos)) /* An out of memory handler to call. May be supplied by client. */ /* Must not return. */ extern void (* CORD_oom_fn)(void); /* Dump the representation of x to stdout in an implementation defined */ /* manner. Intended for debugging only. */ void CORD_dump(CORD x); /* The following could easily be implemented by the client. They are */ /* provided in cordxtra.c for convenience. */ /* Concatenate a character to the end of a cord. */ CORD CORD_cat_char(CORD x, char c); /* Concatenate n cords. */ CORD CORD_catn(int n, /* CORD */ ...); /* Return the character in CORD_substr(x, i, 1) */ char CORD_fetch(CORD x, size_t i); /* Return < 0, 0, or > 0, depending on whether x < y, x = y, x > y */ int CORD_cmp(CORD x, CORD y); /* A generalization that takes both starting positions for the */ /* comparison, and a limit on the number of characters to be compared. */ int CORD_ncmp(CORD x, size_t x_start, CORD y, size_t y_start, size_t len); /* Find the first occurrence of s in x at position start or later. */ /* Return the position of the first character of s in x, or */ /* CORD_NOT_FOUND if there is none. */ size_t CORD_str(CORD x, size_t start, CORD s, size_t xlen); /* Return a cord consisting of i copies of (possibly NUL) c. Dangerous */ /* in conjunction with CORD_to_char_star. */ /* The resulting representation takes constant space, independent of i. */ CORD CORD_chars(char c, size_t i); # define CORD_nul(i) CORD_chars('\0', (i)) /* Turn a file into cord. The file must be seekable. Its contents */ /* must remain constant. The file may be accessed as an immediate */ /* result of this call and/or as a result of subsequent accesses to */ /* the cord. Short files are likely to be immediately read, but */ /* long files are likely to be read on demand, possibly relying on */ /* stdio for buffering. */ /* We must have exclusive access to the descriptor f, i.e. we may */ /* read it at any time, and expect the file pointer to be */ /* where we left it. Normally this should be invoked as */ /* CORD_from_file(fopen(...)) */ /* CORD_from_file arranges to close the file descriptor when it is no */ /* longer needed (e.g. when the result becomes inaccessible). */ /* The file f must be such that ftell reflects the actual character */ /* position in the file, i.e. the number of characters that can be */ /* or were read with fread. On UNIX systems this is always true. On */ /* MS Windows systems, f must be opened in binary mode. */ CORD CORD_from_file(FILE * f); /* Equivalent to the above, except that the entire file will be read */ /* and the file pointer will be closed immediately. */ /* The binary mode restriction from above does not apply. */ CORD CORD_from_file_eager(FILE * f); /* Equivalent to the above, except that the file will be read on demand.*/ /* The binary mode restriction applies. */ CORD CORD_from_file_lazy(FILE * f); /* Turn a cord into a C string. The result shares no structure with */ /* x, and is thus modifiable. */ char * CORD_to_char_star(CORD x, size_t len); /* Turn a C string into a CORD. The C string is copied, and so may */ /* subsequently be modified. */ CORD CORD_from_char_star(const char *s); /* Identical to the above, but the result may share structure with */ /* the argument and is thus not modifiable. */ const char * CORD_to_const_char_star(CORD x, size_t len); /* Write a cord to a file, starting at the current position. No */ /* trailing NULs are newlines are added. */ /* Returns EOF if a write error occurs, 1 otherwise. */ int CORD_put(CORD x, FILE * f); /* "Not found" result for the following two functions. */ # define CORD_NOT_FOUND ((size_t)(-1)) /* A vague analog of strchr. Returns the position (an integer, not */ /* a pointer) of the first occurrence of (char) c inside x at position */ /* i or later. The value i must be < CORD_len(x). */ size_t CORD_chr(CORD x, size_t i, int c); /* A vague analog of strrchr. Returns index of the last occurrence */ /* of (char) c inside x at position i or earlier. The value i */ /* must be < CORD_len(x). */ size_t CORD_rchr(CORD x, size_t i, int c); # endif /* CORD_H */ parser-3.4.3/src/lib/cord/include/Makefile.am000644 000000 000000 00000000060 07707741612 021066 0ustar00rootwheel000000 000000 SUBDIRS = private noinst_HEADERS = cord.h ec.h parser-3.4.3/src/lib/cord/include/private/000755 000000 000000 00000000000 12234223575 020502 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/cord/include/private/Makefile.in000644 000000 000000 00000030334 11766635215 022561 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/cord/include/private DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = cord_pos.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cord/include/private/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/cord/include/private/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-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: parser-3.4.3/src/lib/cord/include/private/Makefile.am000644 000000 000000 00000000034 07707741612 022541 0ustar00rootwheel000000 000000 noinst_HEADERS = cord_pos.h parser-3.4.3/src/lib/cord/include/private/cord_pos.h000644 000000 000000 00000010053 11275661023 022460 0ustar00rootwheel000000 000000 /* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ /* Boehm, May 19, 1994 2:23 pm PDT */ # ifndef CORD_POSITION_H /* The representation of CORD_position. This is private to the */ /* implementation, but the size is known to clients. Also */ /* the implementation of some exported macros relies on it. */ /* Don't use anything defined here and not in cord.h. */ # define MAX_DEPTH 48 /* The maximum depth of a balanced cord + 1. */ /* We don't let cords get deeper than MAX_DEPTH. */ struct CORD_pe { CORD pe_cord; size_t pe_start_pos; }; /* A structure describing an entry on the path from the root */ /* to current position. */ typedef struct CORD_Pos { size_t cur_pos; int path_len; # define CORD_POS_INVALID (0x55555555) /* path_len == INVALID <==> position invalid */ const char *cur_leaf; /* Current leaf, if it is a string. */ /* If the current leaf is a function, */ /* then this may point to function_buf */ /* containing the next few characters. */ /* Always points to a valid string */ /* containing the current character */ /* unless cur_end is 0. */ size_t cur_start; /* Start position of cur_leaf */ size_t cur_end; /* Ending position of cur_leaf */ /* 0 if cur_leaf is invalid. */ struct CORD_pe path[MAX_DEPTH + 1]; /* path[path_len] is the leaf corresponding to cur_pos */ /* path[0].pe_cord is the cord we point to. */ # define FUNCTION_BUF_SZ 32 char function_buf[FUNCTION_BUF_SZ]; /* Space for next few chars */ /* from function node. */ } CORD_pos[1]; /* Extract the cord from a position: */ CORD CORD_pos_to_cord(CORD_pos p); /* Extract the current index from a position: */ size_t CORD_pos_to_index(CORD_pos p); /* Fetch the character located at the given position: */ char CORD_pos_fetch(CORD_pos p); /* Initialize the position to refer to the give cord and index. */ /* Note that this is the most expensive function on positions: */ void CORD_set_pos(CORD_pos p, CORD x, size_t i); /* Advance the position to the next character. */ /* P must be initialized and valid. */ /* Invalidates p if past end: */ void CORD_next(CORD_pos p); /* Move the position to the preceding character. */ /* P must be initialized and valid. */ /* Invalidates p if past beginning: */ void CORD_prev(CORD_pos p); /* Is the position valid, i.e. inside the cord? */ int CORD_pos_valid(CORD_pos p); char CORD__pos_fetch(CORD_pos); void CORD__next(CORD_pos); void CORD__prev(CORD_pos); #define CORD_pos_fetch(p) \ (((p)[0].cur_end != 0)? \ (p)[0].cur_leaf[(p)[0].cur_pos - (p)[0].cur_start] \ : CORD__pos_fetch(p)) #define CORD_next(p) \ (((p)[0].cur_pos + 1 < (p)[0].cur_end)? \ (p)[0].cur_pos++ \ : (CORD__next(p), 0)) #define CORD_prev(p) \ (((p)[0].cur_end != 0 && (p)[0].cur_pos > (p)[0].cur_start)? \ (p)[0].cur_pos-- \ : (CORD__prev(p), 0)) #define CORD_pos_to_index(p) ((p)[0].cur_pos) #define CORD_pos_to_cord(p) ((p)[0].path[0].pe_cord) #define CORD_pos_valid(p) ((p)[0].path_len != CORD_POS_INVALID) /* Some grubby stuff for performance-critical friends: */ #define CORD_pos_chars_left(p) ((long)((p)[0].cur_end) != 0 ? ((long)((p)[0].cur_end) - (long)((p)[0].cur_pos)) : 0 ) /* Number of characters in cache. <= 0 ==> none */ #define CORD_pos_advance(p,n) ((p)[0].cur_pos += (n) - 1, CORD_next(p)) /* Advance position by n characters */ /* 0 < n < CORD_pos_chars_left(p) */ #define CORD_pos_cur_char_addr(p) \ (p)[0].cur_leaf + ((p)[0].cur_pos - (p)[0].cur_start) /* address of current character in cache. */ #endif parser-3.4.3/src/lib/pcre/Makefile.in000644 000000 000000 00000030264 11767711516 017470 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/pcre DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_pcre_internal.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/pcre/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/pcre/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-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: parser-3.4.3/src/lib/pcre/Makefile.am000644 000000 000000 00000000044 11767711516 017450 0ustar00rootwheel000000 000000 noinst_HEADERS = pa_pcre_internal.h parser-3.4.3/src/lib/pcre/pa_pcre_internal.h000644 000000 000000 00000003614 12227331510 021060 0ustar00rootwheel000000 000000 /* Some internal stuff from PCRE library */ /* Author: Sergey B Kirpichev */ /* Bit definitions for entries in the pcre_ctypes table. */ #define ctype_space 0x01 #define ctype_letter 0x02 #define ctype_digit 0x04 #define ctype_xdigit 0x08 #define ctype_word 0x10 /* alphanumeric or '_' */ #define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set of bits for a class map. Some classes are built by combining these tables. */ #define cbit_space 0 /* [:space:] or \s */ #define cbit_xdigit 32 /* [:xdigit:] */ #define cbit_digit 64 /* [:digit:] or \d */ #define cbit_upper 96 /* [:upper:] */ #define cbit_lower 128 /* [:lower:] */ #define cbit_word 160 /* [:word:] or \w */ #define cbit_graph 192 /* [:graph:] */ #define cbit_print 224 /* [:print:] */ #define cbit_punct 256 /* [:punct:] */ #define cbit_cntrl 288 /* [:cntrl:] */ #define cbit_length 320 /* Length of the cbits table */ /* Offsets of the various tables from the base tables pointer, and total length. */ #define lcc_offset 0 #define fcc_offset 256 #define cbits_offset 512 #define ctypes_offset (cbits_offset + cbit_length) #define tables_length (ctypes_offset + 256) /* Internal shared data tables. The data for these tables is in the pcre_tables.c module. */ #ifdef __cplusplus extern "C" const unsigned char _pcre_default_tables[]; #else extern const const unsigned char _pcre_default_tables[]; #endif /* Internal function for validating UTF-8 character strings. The code for this function is in the pcre_valid_utf8.c module. */ #ifdef __cplusplus extern "C" int _pcre_valid_utf(unsigned char *string, int length, int *erroroffset); #else extern int _pcre_valid_utf(unsigned char *string, int length, int *erroroffset); #endif parser-3.4.3/src/lib/gc/Makefile.in000644 000000 000000 00000042662 11766635215 017135 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/gc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/gc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/gc/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/lib/gc/Makefile.am000644 000000 000000 00000000022 07707741612 017103 0ustar00rootwheel000000 000000 SUBDIRS = include parser-3.4.3/src/lib/gc/include/000755 000000 000000 00000000000 12234223575 016472 5ustar00rootwheel000000 000000 parser-3.4.3/src/lib/gc/include/gc.h000644 000000 000000 00000122000 07707746626 017247 0ustar00rootwheel000000 000000 /* * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. * Copyright 1996-1999 by Silicon Graphics. All rights reserved. * Copyright 1999 by Hewlett-Packard Company. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ /* * Note that this defines a large number of tuning hooks, which can * safely be ignored in nearly all cases. For normal use it suffices * to call only GC_MALLOC and perhaps GC_REALLOC. * For better performance, also look at GC_MALLOC_ATOMIC, and * GC_enable_incremental. If you need an action to be performed * immediately before an object is collected, look at GC_register_finalizer. * If you are using Solaris threads, look at the end of this file. * Everything else is best ignored unless you encounter performance * problems. */ #ifndef _GC_H # define _GC_H /* * Some tests for old macros. These violate our namespace rules and will * disappear shortly. Use the GC_ names. */ #if defined(SOLARIS_THREADS) || defined(_SOLARIS_THREADS) # define GC_SOLARIS_THREADS #endif #if defined(_SOLARIS_PTHREADS) # define GC_SOLARIS_PTHREADS #endif #if defined(IRIX_THREADS) # define GC_IRIX_THREADS #endif #if defined(DGUX_THREADS) # if !defined(GC_DGUX386_THREADS) # define GC_DGUX386_THREADS # endif #endif #if defined(HPUX_THREADS) # define GC_HPUX_THREADS #endif #if defined(OSF1_THREADS) # define GC_OSF1_THREADS #endif #if defined(LINUX_THREADS) # define GC_LINUX_THREADS #endif #if defined(WIN32_THREADS) # define GC_WIN32_THREADS #endif #if defined(USE_LD_WRAP) # define GC_USE_LD_WRAP #endif #if !defined(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \ || defined(GC_SOLARIS_PTHREADS) \ || defined(GC_HPUX_THREADS) \ || defined(GC_LINUX_THREADS)) # define _REENTRANT /* Better late than never. This fails if system headers that */ /* depend on this were previously included. */ #endif #if defined(GC_DGUX386_THREADS) && !defined(_POSIX4A_DRAFT10_SOURCE) # define _POSIX4A_DRAFT10_SOURCE 1 #endif #if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS) # define GC_SOLARIS_THREADS #endif # if defined(GC_SOLARIS_PTHREADS) || defined(GC_FREEBSD_THREADS) || \ defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \ defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \ defined(GC_DGUX386_THREADS) || \ (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__)) # define GC_PTHREADS # endif # define __GC # include # ifdef _WIN32_WCE /* Yet more kluges for WinCE */ # include /* size_t is defined here */ typedef long ptrdiff_t; /* ptrdiff_t is not defined */ # endif #if defined(__MINGW32__) && defined(_DLL) && !defined(GC_NOT_DLL) # ifdef GC_BUILD # define GC_API __declspec(dllexport) # else # define GC_API __declspec(dllimport) # endif #endif #if (defined(__DMC__) || defined(_MSC_VER)) \ && (defined(_DLL) && !defined(GC_NOT_DLL) \ || defined(GC_DLL)) # ifdef GC_BUILD # define GC_API extern __declspec(dllexport) # else # define GC_API __declspec(dllimport) # endif #endif #if defined(__WATCOMC__) && defined(GC_DLL) # ifdef GC_BUILD # define GC_API extern __declspec(dllexport) # else # define GC_API extern __declspec(dllimport) # endif #endif #ifndef GC_API #define GC_API extern #endif # if defined(__STDC__) || defined(__cplusplus) # define GC_PROTO(args) args typedef void * GC_PTR; # define GC_CONST const # else # define GC_PROTO(args) () typedef char * GC_PTR; # define GC_CONST # endif # ifdef __cplusplus extern "C" { # endif /* Define word and signed_word to be unsigned and signed types of the */ /* size as char * or void *. There seems to be no way to do this */ /* even semi-portably. The following is probably no better/worse */ /* than almost anything else. */ /* The ANSI standard suggests that size_t and ptr_diff_t might be */ /* better choices. But those appear to have incorrect definitions */ /* on may systems. Notably "typedef int size_t" seems to be both */ /* frequent and WRONG. */ typedef unsigned long GC_word; typedef long GC_signed_word; /* Public read-only variables */ GC_API GC_word GC_gc_no;/* Counter incremented per collection. */ /* Includes empty GCs at startup. */ GC_API int GC_parallel; /* GC is parallelized for performance on */ /* multiprocessors. Currently set only */ /* implicitly if collector is built with */ /* -DPARALLEL_MARK and if either: */ /* Env variable GC_NPROC is set to > 1, or */ /* GC_NPROC is not set and this is an MP. */ /* If GC_parallel is set, incremental */ /* collection is only partially functional, */ /* and may not be desirable. */ /* Public R/W variables */ GC_API GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested)); /* When there is insufficient memory to satisfy */ /* an allocation request, we return */ /* (*GC_oom_fn)(). By default this just */ /* returns 0. */ /* If it returns, it must return 0 or a valid */ /* pointer to a previously allocated heap */ /* object. */ GC_API int GC_find_leak; /* Do not actually garbage collect, but simply */ /* report inaccessible memory that was not */ /* deallocated with GC_free. Initial value */ /* is determined by FIND_LEAK macro. */ GC_API int GC_all_interior_pointers; /* Arrange for pointers to object interiors to */ /* be recognized as valid. May not be changed */ /* after GC initialization. */ /* Initial value is determined by */ /* -DALL_INTERIOR_POINTERS. */ /* Unless DONT_ADD_BYTE_AT_END is defined, this */ /* also affects whether sizes are increased by */ /* at least a byte to allow "off the end" */ /* pointer recognition. */ /* MUST BE 0 or 1. */ GC_API int GC_quiet; /* Disable statistics output. Only matters if */ /* collector has been compiled with statistics */ /* enabled. This involves a performance cost, */ /* and is thus not the default. */ GC_API int GC_finalize_on_demand; /* If nonzero, finalizers will only be run in */ /* response to an explicit GC_invoke_finalizers */ /* call. The default is determined by whether */ /* the FINALIZE_ON_DEMAND macro is defined */ /* when the collector is built. */ GC_API int GC_java_finalization; /* Mark objects reachable from finalizable */ /* objects in a separate postpass. This makes */ /* it a bit safer to use non-topologically- */ /* ordered finalization. Default value is */ /* determined by JAVA_FINALIZATION macro. */ GC_API void (* GC_finalizer_notifier)(); /* Invoked by the collector when there are */ /* objects to be finalized. Invoked at most */ /* once per GC cycle. Never invoked unless */ /* GC_finalize_on_demand is set. */ /* Typically this will notify a finalization */ /* thread, which will call GC_invoke_finalizers */ /* in response. */ GC_API int GC_dont_gc; /* Dont collect unless explicitly requested, e.g. */ /* because it's not safe. */ GC_API int GC_dont_expand; /* Dont expand heap unless explicitly requested */ /* or forced to. */ GC_API int GC_use_entire_heap; /* Causes the nonincremental collector to use the */ /* entire heap before collecting. This was the only */ /* option for GC versions < 5.0. This sometimes */ /* results in more large block fragmentation, since */ /* very larg blocks will tend to get broken up */ /* during each GC cycle. It is likely to result in a */ /* larger working set, but lower collection */ /* frequencies, and hence fewer instructions executed */ /* in the collector. */ GC_API int GC_full_freq; /* Number of partial collections between */ /* full collections. Matters only if */ /* GC_incremental is set. */ /* Full collections are also triggered if */ /* the collector detects a substantial */ /* increase in the number of in-use heap */ /* blocks. Values in the tens are now */ /* perfectly reasonable, unlike for */ /* earlier GC versions. */ GC_API GC_word GC_non_gc_bytes; /* Bytes not considered candidates for collection. */ /* Used only to control scheduling of collections. */ /* Updated by GC_malloc_uncollectable and GC_free. */ /* Wizards only. */ GC_API int GC_no_dls; /* Don't register dynamic library data segments. */ /* Wizards only. Should be used only if the */ /* application explicitly registers all roots. */ /* In Microsoft Windows environments, this will */ /* usually also prevent registration of the */ /* main data segment as part of the root set. */ GC_API GC_word GC_free_space_divisor; /* We try to make sure that we allocate at */ /* least N/GC_free_space_divisor bytes between */ /* collections, where N is the heap size plus */ /* a rough estimate of the root set size. */ /* Initially, GC_free_space_divisor = 4. */ /* Increasing its value will use less space */ /* but more collection time. Decreasing it */ /* will appreciably decrease collection time */ /* at the expense of space. */ /* GC_free_space_divisor = 1 will effectively */ /* disable collections. */ GC_API GC_word GC_max_retries; /* The maximum number of GCs attempted before */ /* reporting out of memory after heap */ /* expansion fails. Initially 0. */ GC_API char *GC_stackbottom; /* Cool end of user stack. */ /* May be set in the client prior to */ /* calling any GC_ routines. This */ /* avoids some overhead, and */ /* potentially some signals that can */ /* confuse debuggers. Otherwise the */ /* collector attempts to set it */ /* automatically. */ /* For multithreaded code, this is the */ /* cold end of the stack for the */ /* primordial thread. */ GC_API int GC_dont_precollect; /* Don't collect as part of */ /* initialization. Should be set only */ /* if the client wants a chance to */ /* manually initialize the root set */ /* before the first collection. */ /* Interferes with blacklisting. */ /* Wizards only. */ GC_API unsigned long GC_time_limit; /* If incremental collection is enabled, */ /* We try to terminate collections */ /* after this many milliseconds. Not a */ /* hard time bound. Setting this to */ /* GC_TIME_UNLIMITED will essentially */ /* disable incremental collection while */ /* leaving generational collection */ /* enabled. */ # define GC_TIME_UNLIMITED 999999 /* Setting GC_time_limit to this value */ /* will disable the "pause time exceeded"*/ /* tests. */ /* Public procedures */ /* Initialize the collector. This is only required when using thread-local * allocation, since unlike the regular allocation routines, GC_local_malloc * is not self-initializing. If you use GC_local_malloc you should arrange * to call this somehow (e.g. from a constructor) before doing any allocation. */ GC_API void GC_init GC_PROTO((void)); /* * general purpose allocation routines, with roughly malloc calling conv. * The atomic versions promise that no relevant pointers are contained * in the object. The nonatomic versions guarantee that the new object * is cleared. GC_malloc_stubborn promises that no changes to the object * will occur after GC_end_stubborn_change has been called on the * result of GC_malloc_stubborn. GC_malloc_uncollectable allocates an object * that is scanned for pointers to collectable objects, but is not itself * collectable. The object is scanned even if it does not appear to * be reachable. GC_malloc_uncollectable and GC_free called on the resulting * object implicitly update GC_non_gc_bytes appropriately. * * Note that the GC_malloc_stubborn support is stubbed out by default * starting in 6.0. GC_malloc_stubborn is an alias for GC_malloc unless * the collector is built with STUBBORN_ALLOC defined. */ GC_API GC_PTR GC_malloc GC_PROTO((size_t size_in_bytes)); GC_API GC_PTR GC_malloc_atomic GC_PROTO((size_t size_in_bytes)); GC_API GC_PTR GC_malloc_uncollectable GC_PROTO((size_t size_in_bytes)); GC_API GC_PTR GC_malloc_stubborn GC_PROTO((size_t size_in_bytes)); /* The following is only defined if the library has been suitably */ /* compiled: */ GC_API GC_PTR GC_malloc_atomic_uncollectable GC_PROTO((size_t size_in_bytes)); /* Explicitly deallocate an object. Dangerous if used incorrectly. */ /* Requires a pointer to the base of an object. */ /* If the argument is stubborn, it should not be changeable when freed. */ /* An object should not be enable for finalization when it is */ /* explicitly deallocated. */ /* GC_free(0) is a no-op, as required by ANSI C for free. */ GC_API void GC_free GC_PROTO((GC_PTR object_addr)); /* * Stubborn objects may be changed only if the collector is explicitly informed. * The collector is implicitly informed of coming change when such * an object is first allocated. The following routines inform the * collector that an object will no longer be changed, or that it will * once again be changed. Only nonNIL pointer stores into the object * are considered to be changes. The argument to GC_end_stubborn_change * must be exacly the value returned by GC_malloc_stubborn or passed to * GC_change_stubborn. (In the second case it may be an interior pointer * within 512 bytes of the beginning of the objects.) * There is a performance penalty for allowing more than * one stubborn object to be changed at once, but it is acceptable to * do so. The same applies to dropping stubborn objects that are still * changeable. */ GC_API void GC_change_stubborn GC_PROTO((GC_PTR)); GC_API void GC_end_stubborn_change GC_PROTO((GC_PTR)); /* Return a pointer to the base (lowest address) of an object given */ /* a pointer to a location within the object. */ /* I.e. map an interior pointer to the corresponding bas pointer. */ /* Note that with debugging allocation, this returns a pointer to the */ /* actual base of the object, i.e. the debug information, not to */ /* the base of the user object. */ /* Return 0 if displaced_pointer doesn't point to within a valid */ /* object. */ GC_API GC_PTR GC_base GC_PROTO((GC_PTR displaced_pointer)); /* Given a pointer to the base of an object, return its size in bytes. */ /* The returned size may be slightly larger than what was originally */ /* requested. */ GC_API size_t GC_size GC_PROTO((GC_PTR object_addr)); /* For compatibility with C library. This is occasionally faster than */ /* a malloc followed by a bcopy. But if you rely on that, either here */ /* or with the standard C library, your code is broken. In my */ /* opinion, it shouldn't have been invented, but now we're stuck. -HB */ /* The resulting object has the same kind as the original. */ /* If the argument is stubborn, the result will have changes enabled. */ /* It is an error to have changes enabled for the original object. */ /* Follows ANSI comventions for NULL old_object. */ GC_API GC_PTR GC_realloc GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes)); /* Explicitly increase the heap size. */ /* Returns 0 on failure, 1 on success. */ GC_API int GC_expand_hp GC_PROTO((size_t number_of_bytes)); /* Limit the heap size to n bytes. Useful when you're debugging, */ /* especially on systems that don't handle running out of memory well. */ /* n == 0 ==> unbounded. This is the default. */ GC_API void GC_set_max_heap_size GC_PROTO((GC_word n)); /* Inform the collector that a certain section of statically allocated */ /* memory contains no pointers to garbage collected memory. Thus it */ /* need not be scanned. This is sometimes important if the application */ /* maps large read/write files into the address space, which could be */ /* mistaken for dynamic library data segments on some systems. */ GC_API void GC_exclude_static_roots GC_PROTO((GC_PTR start, GC_PTR finish)); /* Clear the set of root segments. Wizards only. */ GC_API void GC_clear_roots GC_PROTO((void)); /* Add a root segment. Wizards only. */ GC_API void GC_add_roots GC_PROTO((char * low_address, char * high_address_plus_1)); /* Add a displacement to the set of those considered valid by the */ /* collector. GC_register_displacement(n) means that if p was returned */ /* by GC_malloc, then (char *)p + n will be considered to be a valid */ /* pointer to n. N must be small and less than the size of p. */ /* (All pointers to the interior of objects from the stack are */ /* considered valid in any case. This applies to heap objects and */ /* static data.) */ /* Preferably, this should be called before any other GC procedures. */ /* Calling it later adds to the probability of excess memory */ /* retention. */ /* This is a no-op if the collector was compiled with recognition of */ /* arbitrary interior pointers enabled, which is now the default. */ GC_API void GC_register_displacement GC_PROTO((GC_word n)); /* The following version should be used if any debugging allocation is */ /* being done. */ GC_API void GC_debug_register_displacement GC_PROTO((GC_word n)); /* Explicitly trigger a full, world-stop collection. */ GC_API void GC_gcollect GC_PROTO((void)); /* Trigger a full world-stopped collection. Abort the collection if */ /* and when stop_func returns a nonzero value. Stop_func will be */ /* called frequently, and should be reasonably fast. This works even */ /* if virtual dirty bits, and hence incremental collection is not */ /* available for this architecture. Collections can be aborted faster */ /* than normal pause times for incremental collection. However, */ /* aborted collections do no useful work; the next collection needs */ /* to start from the beginning. */ /* Return 0 if the collection was aborted, 1 if it succeeded. */ typedef int (* GC_stop_func) GC_PROTO((void)); GC_API int GC_try_to_collect GC_PROTO((GC_stop_func stop_func)); /* Return the number of bytes in the heap. Excludes collector private */ /* data structures. Includes empty blocks and fragmentation loss. */ /* Includes some pages that were allocated but never written. */ GC_API size_t GC_get_heap_size GC_PROTO((void)); /* Return a lower bound on the number of free bytes in the heap. */ GC_API size_t GC_get_free_bytes GC_PROTO((void)); /* Return the number of bytes allocated since the last collection. */ GC_API size_t GC_get_bytes_since_gc GC_PROTO((void)); /* Return the total number of bytes allocated in this process. */ /* Never decreases. */ GC_API size_t GC_get_total_bytes GC_PROTO((void)); /* Enable incremental/generational collection. */ /* Not advisable unless dirty bits are */ /* available or most heap objects are */ /* pointerfree(atomic) or immutable. */ /* Don't use in leak finding mode. */ /* Ignored if GC_dont_gc is true. */ /* Only the generational piece of this is */ /* functional if GC_parallel is TRUE */ /* or if GC_time_limit is GC_TIME_UNLIMITED. */ /* Causes GC_local_gcj_malloc() to revert to */ /* locked allocation. Must be called */ /* before any GC_local_gcj_malloc() calls. */ GC_API void GC_enable_incremental GC_PROTO((void)); /* Does incremental mode write-protect pages? Returns zero or */ /* more of the following, or'ed together: */ #define GC_PROTECTS_POINTER_HEAP 1 /* May protect non-atomic objs. */ #define GC_PROTECTS_PTRFREE_HEAP 2 #define GC_PROTECTS_STATIC_DATA 4 /* Curently never. */ #define GC_PROTECTS_STACK 8 /* Probably impractical. */ #define GC_PROTECTS_NONE 0 GC_API int GC_incremental_protection_needs GC_PROTO((void)); /* Perform some garbage collection work, if appropriate. */ /* Return 0 if there is no more work to be done. */ /* Typically performs an amount of work corresponding roughly */ /* to marking from one page. May do more work if further */ /* progress requires it, e.g. if incremental collection is */ /* disabled. It is reasonable to call this in a wait loop */ /* until it returns 0. */ GC_API int GC_collect_a_little GC_PROTO((void)); /* Allocate an object of size lb bytes. The client guarantees that */ /* as long as the object is live, it will be referenced by a pointer */ /* that points to somewhere within the first 256 bytes of the object. */ /* (This should normally be declared volatile to prevent the compiler */ /* from invalidating this assertion.) This routine is only useful */ /* if a large array is being allocated. It reduces the chance of */ /* accidentally retaining such an array as a result of scanning an */ /* integer that happens to be an address inside the array. (Actually, */ /* it reduces the chance of the allocator not finding space for such */ /* an array, since it will try hard to avoid introducing such a false */ /* reference.) On a SunOS 4.X or MS Windows system this is recommended */ /* for arrays likely to be larger than 100K or so. For other systems, */ /* or if the collector is not configured to recognize all interior */ /* pointers, the threshold is normally much higher. */ GC_API GC_PTR GC_malloc_ignore_off_page GC_PROTO((size_t lb)); GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb)); #if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION >= 720 # define GC_ADD_CALLER # define GC_RETURN_ADDR (GC_word)__return_address #endif #ifdef GC_ADD_CALLER # define GC_EXTRAS GC_RETURN_ADDR, __FILE__, __LINE__ # define GC_EXTRA_PARAMS GC_word ra, GC_CONST char * s, int i #else # define GC_EXTRAS __FILE__, __LINE__ # define GC_EXTRA_PARAMS GC_CONST char * s, int i #endif /* Debugging (annotated) allocation. GC_gcollect will check */ /* objects allocated in this way for overwrites, etc. */ GC_API GC_PTR GC_debug_malloc GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); GC_API GC_PTR GC_debug_malloc_atomic GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); GC_API GC_PTR GC_debug_malloc_uncollectable GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); GC_API GC_PTR GC_debug_malloc_stubborn GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); GC_API void GC_debug_free GC_PROTO((GC_PTR object_addr)); GC_API GC_PTR GC_debug_realloc GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes, GC_EXTRA_PARAMS)); GC_API void GC_debug_change_stubborn GC_PROTO((GC_PTR)); GC_API void GC_debug_end_stubborn_change GC_PROTO((GC_PTR)); /* Routines that allocate objects with debug information (like the */ /* above), but just fill in dummy file and line number information. */ /* Thus they can serve as drop-in malloc/realloc replacements. This */ /* can be useful for two reasons: */ /* 1) It allows the collector to be built with DBG_HDRS_ALL defined */ /* even if some allocation calls come from 3rd party libraries */ /* that can't be recompiled. */ /* 2) On some platforms, the file and line information is redundant, */ /* since it can be reconstructed from a stack trace. On such */ /* platforms it may be more convenient not to recompile, e.g. for */ /* leak detection. This can be accomplished by instructing the */ /* linker to replace malloc/realloc with these. */ GC_API GC_PTR GC_debug_malloc_replacement GC_PROTO((size_t size_in_bytes)); GC_API GC_PTR GC_debug_realloc_replacement GC_PROTO((GC_PTR object_addr, size_t size_in_bytes)); # ifdef GC_DEBUG # define GC_MALLOC(sz) GC_debug_malloc(sz, GC_EXTRAS) # define GC_MALLOC_ATOMIC(sz) GC_debug_malloc_atomic(sz, GC_EXTRAS) # define GC_MALLOC_UNCOLLECTABLE(sz) GC_debug_malloc_uncollectable(sz, \ GC_EXTRAS) # define GC_REALLOC(old, sz) GC_debug_realloc(old, sz, GC_EXTRAS) # define GC_FREE(p) GC_debug_free(p) # define GC_REGISTER_FINALIZER(p, f, d, of, od) \ GC_debug_register_finalizer(p, f, d, of, od) # define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \ GC_debug_register_finalizer_ignore_self(p, f, d, of, od) # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ GC_debug_register_finalizer_no_order(p, f, d, of, od) # define GC_MALLOC_STUBBORN(sz) GC_debug_malloc_stubborn(sz, GC_EXTRAS); # define GC_CHANGE_STUBBORN(p) GC_debug_change_stubborn(p) # define GC_END_STUBBORN_CHANGE(p) GC_debug_end_stubborn_change(p) # define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \ GC_general_register_disappearing_link(link, GC_base(obj)) # define GC_REGISTER_DISPLACEMENT(n) GC_debug_register_displacement(n) # else # define GC_MALLOC(sz) GC_malloc(sz) # define GC_MALLOC_ATOMIC(sz) GC_malloc_atomic(sz) # define GC_MALLOC_UNCOLLECTABLE(sz) GC_malloc_uncollectable(sz) # define GC_REALLOC(old, sz) GC_realloc(old, sz) # define GC_FREE(p) GC_free(p) # define GC_REGISTER_FINALIZER(p, f, d, of, od) \ GC_register_finalizer(p, f, d, of, od) # define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \ GC_register_finalizer_ignore_self(p, f, d, of, od) # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ GC_register_finalizer_no_order(p, f, d, of, od) # define GC_MALLOC_STUBBORN(sz) GC_malloc_stubborn(sz) # define GC_CHANGE_STUBBORN(p) GC_change_stubborn(p) # define GC_END_STUBBORN_CHANGE(p) GC_end_stubborn_change(p) # define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \ GC_general_register_disappearing_link(link, obj) # define GC_REGISTER_DISPLACEMENT(n) GC_register_displacement(n) # endif /* The following are included because they are often convenient, and */ /* reduce the chance for a misspecifed size argument. But calls may */ /* expand to something syntactically incorrect if t is a complicated */ /* type expression. */ # define GC_NEW(t) (t *)GC_MALLOC(sizeof (t)) # define GC_NEW_ATOMIC(t) (t *)GC_MALLOC_ATOMIC(sizeof (t)) # define GC_NEW_STUBBORN(t) (t *)GC_MALLOC_STUBBORN(sizeof (t)) # define GC_NEW_UNCOLLECTABLE(t) (t *)GC_MALLOC_UNCOLLECTABLE(sizeof (t)) /* Finalization. Some of these primitives are grossly unsafe. */ /* The idea is to make them both cheap, and sufficient to build */ /* a safer layer, closer to PCedar finalization. */ /* The interface represents my conclusions from a long discussion */ /* with Alan Demers, Dan Greene, Carl Hauser, Barry Hayes, */ /* Christian Jacobi, and Russ Atkinson. It's not perfect, and */ /* probably nobody else agrees with it. Hans-J. Boehm 3/13/92 */ typedef void (*GC_finalization_proc) GC_PROTO((GC_PTR obj, GC_PTR client_data)); GC_API void GC_register_finalizer GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); GC_API void GC_debug_register_finalizer GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); /* When obj is no longer accessible, invoke */ /* (*fn)(obj, cd). If a and b are inaccessible, and */ /* a points to b (after disappearing links have been */ /* made to disappear), then only a will be */ /* finalized. (If this does not create any new */ /* pointers to b, then b will be finalized after the */ /* next collection.) Any finalizable object that */ /* is reachable from itself by following one or more */ /* pointers will not be finalized (or collected). */ /* Thus cycles involving finalizable objects should */ /* be avoided, or broken by disappearing links. */ /* All but the last finalizer registered for an object */ /* is ignored. */ /* Finalization may be removed by passing 0 as fn. */ /* Finalizers are implicitly unregistered just before */ /* they are invoked. */ /* The old finalizer and client data are stored in */ /* *ofn and *ocd. */ /* Fn is never invoked on an accessible object, */ /* provided hidden pointers are converted to real */ /* pointers only if the allocation lock is held, and */ /* such conversions are not performed by finalization */ /* routines. */ /* If GC_register_finalizer is aborted as a result of */ /* a signal, the object may be left with no */ /* finalization, even if neither the old nor new */ /* finalizer were NULL. */ /* Obj should be the nonNULL starting address of an */ /* object allocated by GC_malloc or friends. */ /* Note that any garbage collectable object referenced */ /* by cd will be considered accessible until the */ /* finalizer is invoked. */ /* Another versions of the above follow. It ignores */ /* self-cycles, i.e. pointers from a finalizable object to */ /* itself. There is a stylistic argument that this is wrong, */ /* but it's unavoidable for C++, since the compiler may */ /* silently introduce these. It's also benign in that specific */ /* case. And it helps if finalizable objects are split to */ /* avoid cycles. */ /* Note that cd will still be viewed as accessible, even if it */ /* refers to the object itself. */ GC_API void GC_register_finalizer_ignore_self GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); GC_API void GC_debug_register_finalizer_ignore_self GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); /* Another version of the above. It ignores all cycles. */ /* It should probably only be used by Java implementations. */ /* Note that cd will still be viewed as accessible, even if it */ /* refers to the object itself. */ GC_API void GC_register_finalizer_no_order GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); GC_API void GC_debug_register_finalizer_no_order GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); /* The following routine may be used to break cycles between */ /* finalizable objects, thus causing cyclic finalizable */ /* objects to be finalized in the correct order. Standard */ /* use involves calling GC_register_disappearing_link(&p), */ /* where p is a pointer that is not followed by finalization */ /* code, and should not be considered in determining */ /* finalization order. */ GC_API int GC_register_disappearing_link GC_PROTO((GC_PTR * /* link */)); /* Link should point to a field of a heap allocated */ /* object obj. *link will be cleared when obj is */ /* found to be inaccessible. This happens BEFORE any */ /* finalization code is invoked, and BEFORE any */ /* decisions about finalization order are made. */ /* This is useful in telling the finalizer that */ /* some pointers are not essential for proper */ /* finalization. This may avoid finalization cycles. */ /* Note that obj may be resurrected by another */ /* finalizer, and thus the clearing of *link may */ /* be visible to non-finalization code. */ /* There's an argument that an arbitrary action should */ /* be allowed here, instead of just clearing a pointer. */ /* But this causes problems if that action alters, or */ /* examines connectivity. */ /* Returns 1 if link was already registered, 0 */ /* otherwise. */ /* Only exists for backward compatibility. See below: */ GC_API int GC_general_register_disappearing_link GC_PROTO((GC_PTR * /* link */, GC_PTR obj)); /* A slight generalization of the above. *link is */ /* cleared when obj first becomes inaccessible. This */ /* can be used to implement weak pointers easily and */ /* safely. Typically link will point to a location */ /* holding a disguised pointer to obj. (A pointer */ /* inside an "atomic" object is effectively */ /* disguised.) In this way soft */ /* pointers are broken before any object */ /* reachable from them are finalized. Each link */ /* May be registered only once, i.e. with one obj */ /* value. This was added after a long email discussion */ /* with John Ellis. */ /* Obj must be a pointer to the first word of an object */ /* we allocated. It is unsafe to explicitly deallocate */ /* the object containing link. Explicitly deallocating */ /* obj may or may not cause link to eventually be */ /* cleared. */ GC_API int GC_unregister_disappearing_link GC_PROTO((GC_PTR * /* link */)); /* Returns 0 if link was not actually registered. */ /* Undoes a registration by either of the above two */ /* routines. */ /* Auxiliary fns to make finalization work correctly with displaced */ /* pointers introduced by the debugging allocators. */ GC_API GC_PTR GC_make_closure GC_PROTO((GC_finalization_proc fn, GC_PTR data)); GC_API void GC_debug_invoke_finalizer GC_PROTO((GC_PTR obj, GC_PTR data)); /* Returns !=0 if GC_invoke_finalizers has something to do. */ GC_API int GC_should_invoke_finalizers GC_PROTO((void)); GC_API int GC_invoke_finalizers GC_PROTO((void)); /* Run finalizers for all objects that are ready to */ /* be finalized. Return the number of finalizers */ /* that were run. Normally this is also called */ /* implicitly during some allocations. If */ /* GC-finalize_on_demand is nonzero, it must be called */ /* explicitly. */ /* GC_set_warn_proc can be used to redirect or filter warning messages. */ /* p may not be a NULL pointer. */ typedef void (*GC_warn_proc) GC_PROTO((char *msg, GC_word arg)); GC_API GC_warn_proc GC_set_warn_proc GC_PROTO((GC_warn_proc p)); /* Returns old warning procedure. */ /* The following is intended to be used by a higher level */ /* (e.g. Java-like) finalization facility. It is expected */ /* that finalization code will arrange for hidden pointers to */ /* disappear. Otherwise objects can be accessed after they */ /* have been collected. */ /* Note that putting pointers in atomic objects or in */ /* nonpointer slots of "typed" objects is equivalent to */ /* disguising them in this way, and may have other advantages. */ # if defined(I_HIDE_POINTERS) || defined(GC_I_HIDE_POINTERS) typedef GC_word GC_hidden_pointer; # define HIDE_POINTER(p) (~(GC_hidden_pointer)(p)) # define REVEAL_POINTER(p) ((GC_PTR)(HIDE_POINTER(p))) /* Converting a hidden pointer to a real pointer requires verifying */ /* that the object still exists. This involves acquiring the */ /* allocator lock to avoid a race with the collector. */ # endif /* I_HIDE_POINTERS */ typedef GC_PTR (*GC_fn_type) GC_PROTO((GC_PTR client_data)); GC_API GC_PTR GC_call_with_alloc_lock GC_PROTO((GC_fn_type fn, GC_PTR client_data)); /* The following routines are primarily intended for use with a */ /* preprocessor which inserts calls to check C pointer arithmetic. */ /* Check that p and q point to the same object. */ /* Fail conspicuously if they don't. */ /* Returns the first argument. */ /* Succeeds if neither p nor q points to the heap. */ /* May succeed if both p and q point to between heap objects. */ GC_API GC_PTR GC_same_obj GC_PROTO((GC_PTR p, GC_PTR q)); /* Checked pointer pre- and post- increment operations. Note that */ /* the second argument is in units of bytes, not multiples of the */ /* object size. This should either be invoked from a macro, or the */ /* call should be automatically generated. */ GC_API GC_PTR GC_pre_incr GC_PROTO((GC_PTR *p, size_t how_much)); GC_API GC_PTR GC_post_incr GC_PROTO((GC_PTR *p, size_t how_much)); /* Check that p is visible */ /* to the collector as a possibly pointer containing location. */ /* If it isn't fail conspicuously. */ /* Returns the argument in all cases. May erroneously succeed */ /* in hard cases. (This is intended for debugging use with */ /* untyped allocations. The idea is that it should be possible, though */ /* slow, to add such a call to all indirect pointer stores.) */ /* Currently useless for multithreaded worlds. */ GC_API GC_PTR GC_is_visible GC_PROTO((GC_PTR p)); /* Check that if p is a pointer to a heap page, then it points to */ /* a valid displacement within a heap object. */ /* Fail conspicuously if this property does not hold. */ /* Uninteresting with GC_all_interior_pointers. */ /* Always returns its argument. */ GC_API GC_PTR GC_is_valid_displacement GC_PROTO((GC_PTR p)); /* Safer, but slow, pointer addition. Probably useful mainly with */ /* a preprocessor. Useful only for heap pointers. */ #ifdef GC_DEBUG # define GC_PTR_ADD3(x, n, type_of_result) \ ((type_of_result)GC_same_obj((x)+(n), (x))) # define GC_PRE_INCR3(x, n, type_of_result) \ ((type_of_result)GC_pre_incr(&(x), (n)*sizeof(*x)) # define GC_POST_INCR2(x, type_of_result) \ ((type_of_result)GC_post_incr(&(x), sizeof(*x)) # ifdef __GNUC__ # define GC_PTR_ADD(x, n) \ GC_PTR_ADD3(x, n, typeof(x)) # define GC_PRE_INCR(x, n) \ GC_PRE_INCR3(x, n, typeof(x)) # define GC_POST_INCR(x, n) \ GC_POST_INCR3(x, typeof(x)) # else /* We can't do this right without typeof, which ANSI */ /* decided was not sufficiently useful. Repeatedly */ /* mentioning the arguments seems too dangerous to be */ /* useful. So does not casting the result. */ # define GC_PTR_ADD(x, n) ((x)+(n)) # endif #else /* !GC_DEBUG */ # define GC_PTR_ADD3(x, n, type_of_result) ((x)+(n)) # define GC_PTR_ADD(x, n) ((x)+(n)) # define GC_PRE_INCR3(x, n, type_of_result) ((x) += (n)) # define GC_PRE_INCR(x, n) ((x) += (n)) # define GC_POST_INCR2(x, n, type_of_result) ((x)++) # define GC_POST_INCR(x, n) ((x)++) #endif /* Safer assignment of a pointer to a nonstack location. */ #ifdef GC_DEBUG # ifdef __STDC__ # define GC_PTR_STORE(p, q) \ (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q)) # else # define GC_PTR_STORE(p, q) \ (*(char **)GC_is_visible(p) = GC_is_valid_displacement(q)) # endif #else /* !GC_DEBUG */ # define GC_PTR_STORE(p, q) *((p) = (q)) #endif /* Fynctions called to report pointer checking errors */ GC_API void (*GC_same_obj_print_proc) GC_PROTO((GC_PTR p, GC_PTR q)); GC_API void (*GC_is_valid_displacement_print_proc) GC_PROTO((GC_PTR p)); GC_API void (*GC_is_visible_print_proc) GC_PROTO((GC_PTR p)); /* For pthread support, we generally need to intercept a number of */ /* thread library calls. We do that here by macro defining them. */ #if !defined(GC_USE_LD_WRAP) && \ (defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS)) # include "gc_pthread_redirects.h" #endif # if defined(PCR) || defined(GC_SOLARIS_THREADS) || \ defined(GC_PTHREADS) || defined(GC_WIN32_THREADS) /* Any flavor of threads except SRC_M3. */ /* This returns a list of objects, linked through their first */ /* word. Its use can greatly reduce lock contention problems, since */ /* the allocation lock can be acquired and released many fewer times. */ /* lb must be large enough to hold the pointer field. */ /* It is used internally by gc_local_alloc.h, which provides a simpler */ /* programming interface on Linux. */ GC_PTR GC_malloc_many(size_t lb); #define GC_NEXT(p) (*(GC_PTR *)(p)) /* Retrieve the next element */ /* in returned list. */ extern void GC_thr_init(); /* Needed for Solaris/X86 */ #endif /* THREADS && !SRC_M3 */ #if defined(GC_WIN32_THREADS) # include # include /* * All threads must be created using GC_CreateThread, so that they will be * recorded in the thread table. For backwards compatibility, this is not * technically true if the GC is built as a dynamic library, since it can * and does then use DllMain to keep track of thread creations. But new code * should be built to call GC_CreateThread. */ HANDLE WINAPI GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ); # if defined(_WIN32_WCE) /* * win32_threads.c implements the real WinMain, which will start a new thread * to call GC_WinMain after initializing the garbage collector. */ int WINAPI GC_WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ); # ifndef GC_BUILD # define WinMain GC_WinMain # define CreateThread GC_CreateThread # endif # endif /* defined(_WIN32_WCE) */ #endif /* defined(GC_WIN32_THREADS) */ /* * If you are planning on putting * the collector in a SunOS 5 dynamic library, you need to call GC_INIT() * from the statically loaded program section. * This circumvents a Solaris 2.X (X<=4) linker bug. */ #if defined(sparc) || defined(__sparc) # define GC_INIT() { extern end, etext; \ GC_noop(&end, &etext); } #else # if defined(__CYGWIN32__) && defined(GC_USE_DLL) || defined (_AIX) /* * Similarly gnu-win32 DLLs need explicit initialization from * the main program, as does AIX. */ # define GC_INIT() { GC_add_roots(DATASTART, DATAEND); } # else # define GC_INIT() # endif #endif #if !defined(_WIN32_WCE) \ && ((defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \ || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)) /* win32S may not free all resources on process exit. */ /* This explicitly deallocates the heap. */ GC_API void GC_win32_free_heap (); #endif #if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) ) /* Allocation really goes through GC_amiga_allocwrapper_do */ # include "gc_amiga_redirects.h" #endif #if defined(GC_REDIRECT_TO_LOCAL) && !defined(GC_LOCAL_ALLOC_H) # include "gc_local_alloc.h" #endif #ifdef __cplusplus } /* end of extern "C" */ #endif #endif /* _GC_H */ parser-3.4.3/src/lib/gc/include/Makefile.in000644 000000 000000 00000030307 11766635215 020551 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/gc/include DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = gc.h gc_allocator.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/gc/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/gc/include/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-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: parser-3.4.3/src/lib/gc/include/gc_allocator.h000644 000000 000000 00000016612 11744065151 021301 0ustar00rootwheel000000 000000 /* * Copyright (c) 1996-1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * Copyright (c) 2002 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /* * This implements standard-conforming allocators that interact with * the garbage collector. Gc_alloctor allocates garbage-collectable * objects of type T. Traceable_allocator allocates objects that * are not temselves garbage collected, but are scanned by the * collector for pointers to collectable objects. Traceable_alloc * should be used for explicitly managed STL containers that may * point to collectable objects. * * This code was derived from an earlier version of the GNU C++ standard * library, which itself was derived from the SGI STL implementation. */ #ifndef GC_ALLOCATOR_H #define GC_ALLOCATOR_H #include "gc.h" #include // for placement new #if defined(__GNUC__) # define GC_ATTR_UNUSED __attribute__((unused)) #else # define GC_ATTR_UNUSED #endif /* First some helpers to allow us to dispatch on whether or not a type * is known to be pointerfree. * These are private, except that the client may invoke the * GC_DECLARE_PTRFREE macro. */ struct GC_true_type {}; struct GC_false_type {}; template struct GC_type_traits { GC_false_type GC_is_ptr_free; }; # define GC_DECLARE_PTRFREE(T) \ template<> struct GC_type_traits { GC_true_type GC_is_ptr_free; } GC_DECLARE_PTRFREE(char); GC_DECLARE_PTRFREE(signed char); GC_DECLARE_PTRFREE(unsigned char); GC_DECLARE_PTRFREE(signed short); GC_DECLARE_PTRFREE(unsigned short); GC_DECLARE_PTRFREE(signed int); GC_DECLARE_PTRFREE(unsigned int); GC_DECLARE_PTRFREE(signed long); GC_DECLARE_PTRFREE(unsigned long); GC_DECLARE_PTRFREE(float); GC_DECLARE_PTRFREE(double); GC_DECLARE_PTRFREE(long double); /* The client may want to add others. */ // In the following GC_Tp is GC_true_type iff we are allocating a // pointerfree object. template inline void * GC_selective_alloc(size_t n, GC_Tp) { return GC_MALLOC(n); } template <> inline void * GC_selective_alloc(size_t n, GC_true_type) { return GC_MALLOC_ATOMIC(n); } /* Now the public gc_allocator class: */ template class gc_allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef GC_Tp* pointer; typedef const GC_Tp* const_pointer; typedef GC_Tp& reference; typedef const GC_Tp& const_reference; typedef GC_Tp value_type; template struct rebind { typedef gc_allocator other; }; gc_allocator() {} gc_allocator(const gc_allocator&) throw() {} # if !(GC_NO_MEMBER_TEMPLATES || 0 < _MSC_VER && _MSC_VER <= 1200) // MSVC++ 6.0 do not support member templates template gc_allocator(const gc_allocator&) throw() {} # endif ~gc_allocator() throw() {} pointer address(reference GC_x) const { return &GC_x; } const_pointer address(const_reference GC_x) const { return &GC_x; } // GC_n is permitted to be 0. The C++ standard says nothing about what // the return value is when GC_n == 0. GC_Tp* allocate(size_type GC_n, const void* = 0) { GC_type_traits traits; return static_cast (GC_selective_alloc(GC_n * sizeof(GC_Tp), traits.GC_is_ptr_free)); } // __p is not permitted to be a null pointer. void deallocate(pointer __p, size_type GC_ATTR_UNUSED) { GC_FREE(__p); } size_type max_size() const throw() { return size_t(-1) / sizeof(GC_Tp); } void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); } void destroy(pointer __p) { __p->~GC_Tp(); } }; template<> class gc_allocator { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef gc_allocator other; }; }; template inline bool operator==(const gc_allocator&, const gc_allocator&) { return true; } template inline bool operator!=(const gc_allocator&, const gc_allocator&) { return false; } /* * And the public traceable_allocator class. */ // Note that we currently don't specialize the pointer-free case, since a // pointer-free traceable container doesn't make that much sense, // though it could become an issue due to abstraction boundaries. template class traceable_allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef GC_Tp* pointer; typedef const GC_Tp* const_pointer; typedef GC_Tp& reference; typedef const GC_Tp& const_reference; typedef GC_Tp value_type; template struct rebind { typedef traceable_allocator other; }; traceable_allocator() throw() {} traceable_allocator(const traceable_allocator&) throw() {} # if !(GC_NO_MEMBER_TEMPLATES || 0 < _MSC_VER && _MSC_VER <= 1200) // MSVC++ 6.0 do not support member templates template traceable_allocator (const traceable_allocator&) throw() {} # endif ~traceable_allocator() throw() {} pointer address(reference GC_x) const { return &GC_x; } const_pointer address(const_reference GC_x) const { return &GC_x; } // GC_n is permitted to be 0. The C++ standard says nothing about what // the return value is when GC_n == 0. GC_Tp* allocate(size_type GC_n, const void* = 0) { return static_cast(GC_MALLOC_UNCOLLECTABLE(GC_n * sizeof(GC_Tp))); } // __p is not permitted to be a null pointer. void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n) { GC_FREE(__p); } size_type max_size() const throw() { return size_t(-1) / sizeof(GC_Tp); } void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); } void destroy(pointer __p) { __p->~GC_Tp(); } }; template<> class traceable_allocator { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef traceable_allocator other; }; }; template inline bool operator==(const traceable_allocator&, const traceable_allocator&) { return true; } template inline bool operator!=(const traceable_allocator&, const traceable_allocator&) { return false; } #endif /* GC_ALLOCATOR_H */ parser-3.4.3/src/lib/gc/include/Makefile.am000644 000000 000000 00000000045 11300360673 020517 0ustar00rootwheel000000 000000 noinst_HEADERS = gc.h gc_allocator.h parser-3.4.3/src/lib/memcached/memcached.vcproj000644 000000 000000 00000007066 11734572205 021531 0ustar00rootwheel000000 000000 parser-3.4.3/src/lib/memcached/Makefile.in000644 000000 000000 00000036225 11766635215 020450 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/memcached DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmemcached_la_LIBADD = am_libmemcached_la_OBJECTS = pa_memcached.lo libmemcached_la_OBJECTS = $(am_libmemcached_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmemcached_la_SOURCES) DIST_SOURCES = $(libmemcached_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = $(INCLTDL) noinst_HEADERS = constants.h types.h pa_memcached.h noinst_LTLIBRARIES = libmemcached.la libmemcached_la_SOURCES = pa_memcached.C EXTRA_DIST = memcached.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/memcached/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/memcached/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmemcached.la: $(libmemcached_la_OBJECTS) $(libmemcached_la_DEPENDENCIES) $(CXXLINK) $(libmemcached_la_OBJECTS) $(libmemcached_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_memcached.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-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: parser-3.4.3/src/lib/memcached/Makefile.am000644 000000 000000 00000000270 11766065303 020421 0ustar00rootwheel000000 000000 INCLUDES = $(INCLTDL) noinst_HEADERS = constants.h types.h pa_memcached.h noinst_LTLIBRARIES = libmemcached.la libmemcached_la_SOURCES = pa_memcached.C EXTRA_DIST = memcached.vcproj parser-3.4.3/src/lib/memcached/types.h000644 000000 000000 00000006713 11731730455 017711 0ustar00rootwheel000000 000000 /* LibMemcached * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. * * Summary: Types for libmemcached * */ #ifndef __LIBMEMCACHED_TYPES_H__ #define __LIBMEMCACHED_TYPES_H__ typedef struct memcached_st memcached_st; typedef struct memcached_stat_st memcached_stat_st; typedef struct memcached_analysis_st memcached_analysis_st; typedef struct memcached_result_st memcached_result_st; // All of the flavors of memcache_server_st typedef struct memcached_server_st memcached_server_st; typedef const struct memcached_server_st *memcached_server_instance_st; typedef struct memcached_server_st *memcached_server_list_st; typedef struct memcached_callback_st memcached_callback_st; // The following two structures are internal, and never exposed to users. typedef struct memcached_string_st memcached_string_st; typedef struct memcached_continuum_item_st memcached_continuum_item_st; #ifdef __cplusplus extern "C" { #endif typedef memcached_return_t (*memcached_clone_fn)(memcached_st *destination, const memcached_st *source); typedef memcached_return_t (*memcached_cleanup_fn)(const memcached_st *ptr); /** Memory allocation functions. */ typedef void (*memcached_free_fn)(const memcached_st *ptr, void *mem, void *context); typedef void *(*memcached_malloc_fn)(const memcached_st *ptr, const size_t size, void *context); typedef void *(*memcached_realloc_fn)(const memcached_st *ptr, void *mem, const size_t size, void *context); typedef void *(*memcached_calloc_fn)(const memcached_st *ptr, size_t nelem, const size_t elsize, void *context); typedef memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, memcached_result_st *result, void *context); typedef memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, memcached_server_instance_st server, void *context); /** Trigger functions. */ typedef memcached_return_t (*memcached_trigger_key_fn)(const memcached_st *ptr, const char *key, size_t key_length, memcached_result_st *result); typedef memcached_return_t (*memcached_trigger_delete_key_fn)(const memcached_st *ptr, const char *key, size_t key_length); typedef memcached_return_t (*memcached_dump_fn)(const memcached_st *ptr, const char *key, size_t key_length, void *context); #ifdef __cplusplus } #endif /** @note The following definitions are just here for backwards compatibility. */ typedef memcached_return_t memcached_return; typedef memcached_server_distribution_t memcached_server_distribution; typedef memcached_behavior_t memcached_behavior; typedef memcached_callback_t memcached_callback; typedef memcached_hash_t memcached_hash; typedef memcached_connection_t memcached_connection; typedef memcached_clone_fn memcached_clone_func; typedef memcached_cleanup_fn memcached_cleanup_func; typedef memcached_execute_fn memcached_execute_function; typedef memcached_server_fn memcached_server_function; typedef memcached_trigger_key_fn memcached_trigger_key; typedef memcached_trigger_delete_key_fn memcached_trigger_delete_key; typedef memcached_dump_fn memcached_dump_func; #endif /* __LIBMEMCACHED_TYPES_H__ */ parser-3.4.3/src/lib/memcached/pa_memcached.h000644 000000 000000 00000007142 12135610702 021117 0ustar00rootwheel000000 000000 /** @file Parser: memcached support decl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) */ #ifndef PA_MEMCACHED_H #define PA_MEMCACHED_H #include "constants.h" #include "types.h" // memcached library load function const char *memcached_load(const char *alt_library_name); // memcached library inferface typedef memcached_st *(*t_memcached)(const char *string, size_t string_length); typedef memcached_st *(*t_memcached_create)(memcached_st *ptr); typedef void (*t_memcached_free)(memcached_st *ptr); typedef const char *(*t_memcached_strerror)(memcached_st *ptr, memcached_return_t rc); typedef memcached_return_t (*t_memcached_server_push)(memcached_st *ptr, const memcached_server_list_st list); typedef memcached_server_list_st (*t_memcached_servers_parse)(const char *server_strings); typedef memcached_return_t (*t_memcached_version)(memcached_st *ptr); typedef memcached_return_t (*t_memcached_flush)(memcached_st *ptr, time_t expiration); typedef void (*t_memcached_quit)(memcached_st *ptr); typedef char *(*t_memcached_get)(memcached_st *ptr, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error); typedef memcached_return_t (*t_memcached_delete)(memcached_st *ptr, const char *key, size_t key_length, time_t expiration); typedef memcached_return_t (*t_memcached_mget)(memcached_st *ptr, const char * const *keys, const size_t *key_length, size_t number_of_keys); typedef memcached_return_t (*t_memcached_set)(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags); typedef memcached_return_t (*t_memcached_add)(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags); typedef memcached_result_st *(*t_memcached_fetch_result)(memcached_st *ptr, memcached_result_st *result, memcached_return_t *error); typedef memcached_result_st *(*t_memcached_result_create)(const memcached_st *ptr, memcached_result_st *result); typedef void (*t_memcached_result_free)(memcached_result_st *result); typedef const char *(*t_memcached_result_key_value)(const memcached_result_st *self); typedef const char *(*t_memcached_result_value)(const memcached_result_st *self); typedef size_t (*t_memcached_result_key_length)(const memcached_result_st *self); typedef size_t (*t_memcached_result_length)(const memcached_result_st *self); typedef uint32_t (*t_memcached_result_flags)(const memcached_result_st *self); extern t_memcached f_memcached; extern t_memcached_create f_memcached_create; extern t_memcached_free f_memcached_free; extern t_memcached_strerror f_memcached_strerror; extern t_memcached_server_push f_memcached_server_push; extern t_memcached_servers_parse f_memcached_servers_parse; extern t_memcached_version f_memcached_version; extern t_memcached_flush f_memcached_flush; extern t_memcached_quit f_memcached_quit; extern t_memcached_get f_memcached_get; extern t_memcached_delete f_memcached_delete; extern t_memcached_mget f_memcached_mget; extern t_memcached_set f_memcached_set; extern t_memcached_add f_memcached_add; extern t_memcached_fetch_result f_memcached_fetch_result; extern t_memcached_result_create f_memcached_result_create; extern t_memcached_result_free f_memcached_result_free; extern t_memcached_result_key_value f_memcached_result_key_value; extern t_memcached_result_value f_memcached_result_value; extern t_memcached_result_key_length f_memcached_result_key_length; extern t_memcached_result_length f_memcached_result_length; extern t_memcached_result_flags f_memcached_result_flags; #endif /* PA_MEMCACHED_H */ parser-3.4.3/src/lib/memcached/pa_memcached.C000644 000000 000000 00000005012 12165633045 021054 0ustar00rootwheel000000 000000 /** @file Parser: memcached support impl. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) */ #include "pa_config_includes.h" #include "pa_memcached.h" #include "ltdl.h" volatile const char * IDENT_PA_MEMCACHED_C="$Id: pa_memcached.C,v 1.8 2013/07/05 21:09:57 moko Exp $"; t_memcached f_memcached=0; t_memcached_create f_memcached_create; t_memcached_free f_memcached_free; t_memcached_strerror f_memcached_strerror; t_memcached_server_push f_memcached_server_push; t_memcached_servers_parse f_memcached_servers_parse; t_memcached_version f_memcached_version; t_memcached_flush f_memcached_flush; t_memcached_quit f_memcached_quit; t_memcached_get f_memcached_get; t_memcached_delete f_memcached_delete; t_memcached_mget f_memcached_mget; t_memcached_set f_memcached_set; t_memcached_add f_memcached_add; t_memcached_fetch_result f_memcached_fetch_result; t_memcached_result_create f_memcached_result_create; t_memcached_result_free f_memcached_result_free; t_memcached_result_key_value f_memcached_result_key_value; t_memcached_result_value f_memcached_result_value; t_memcached_result_key_length f_memcached_result_key_length; t_memcached_result_length f_memcached_result_length; t_memcached_result_flags f_memcached_result_flags; #define GLINK(name) f_##name=(t_##name)lt_dlsym(handle, #name); #define DLINK(name) GLINK(name) if(!f_##name) return "function " #name " was not found"; void pa_dlinit(); static const char *dlink(const char *dlopen_file_spec) { pa_dlinit(); lt_dlhandle handle=lt_dlopen(dlopen_file_spec); if(!handle){ if(const char* result=lt_dlerror()) return result; return "can not open the dynamic link module"; } GLINK(memcached); DLINK(memcached_create); DLINK(memcached_free); DLINK(memcached_strerror); DLINK(memcached_server_push); DLINK(memcached_servers_parse); DLINK(memcached_version); DLINK(memcached_flush); DLINK(memcached_quit); DLINK(memcached_get); DLINK(memcached_delete); DLINK(memcached_mget); DLINK(memcached_set); DLINK(memcached_add); DLINK(memcached_fetch_result); DLINK(memcached_result_create); DLINK(memcached_result_free); DLINK(memcached_result_key_value); DLINK(memcached_result_value); DLINK(memcached_result_key_length); DLINK(memcached_result_length); DLINK(memcached_result_flags); return 0; } bool memcached_linked = false; const char *memcached_status = 0; const char *memcached_load(const char *library_name){ if(!memcached_linked){ memcached_linked=true; memcached_status=dlink(library_name); } return memcached_status; } parser-3.4.3/src/lib/memcached/constants.h000644 000000 000000 00000011622 11731730455 020554 0ustar00rootwheel000000 000000 /* LibMemcached * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. * * Summary: Constants for libmemcached * */ #ifndef __LIBMEMCACHED_CONSTANTS_H__ #define __LIBMEMCACHED_CONSTANTS_H__ /* Public defines */ #define MEMCACHED_DEFAULT_PORT 11211 #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ #define MEMCACHED_MAX_BUFFER 8196 #define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */ #define MEMCACHED_POINTS_PER_SERVER 100 #define MEMCACHED_POINTS_PER_SERVER_KETAMA 160 #define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */ #define MEMCACHED_STRIDE 4 #define MEMCACHED_DEFAULT_TIMEOUT 5000 #define MEMCACHED_DEFAULT_CONNECT_TIMEOUT 4000 #define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should build for in the continuum */ #define MEMCACHED_PREFIX_KEY_MAX_SIZE 128 #define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU #define MEMCACHED_VERSION_STRING_LENGTH 24 typedef enum { MEMCACHED_SUCCESS, MEMCACHED_FAILURE, MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_CONNECTION_FAILURE, MEMCACHED_CONNECTION_BIND_FAILURE, MEMCACHED_WRITE_FAILURE, MEMCACHED_READ_FAILURE, MEMCACHED_UNKNOWN_READ_FAILURE, MEMCACHED_PROTOCOL_ERROR, MEMCACHED_CLIENT_ERROR, MEMCACHED_SERVER_ERROR, MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE, MEMCACHED_DATA_EXISTS, MEMCACHED_DATA_DOES_NOT_EXIST, MEMCACHED_NOTSTORED, MEMCACHED_STORED, MEMCACHED_NOTFOUND, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_PARTIAL_READ, MEMCACHED_SOME_ERRORS, MEMCACHED_NO_SERVERS, MEMCACHED_END, MEMCACHED_DELETED, MEMCACHED_VALUE, MEMCACHED_STAT, MEMCACHED_ITEM, MEMCACHED_ERRNO, MEMCACHED_FAIL_UNIX_SOCKET, MEMCACHED_NOT_SUPPORTED, MEMCACHED_NO_KEY_PROVIDED, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */ MEMCACHED_FETCH_NOTFINISHED, MEMCACHED_TIMEOUT, MEMCACHED_BUFFERED, MEMCACHED_BAD_KEY_PROVIDED, MEMCACHED_INVALID_HOST_PROTOCOL, MEMCACHED_SERVER_MARKED_DEAD, MEMCACHED_UNKNOWN_STAT_KEY, MEMCACHED_E2BIG, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_KEY_TOO_BIG, MEMCACHED_AUTH_PROBLEM, MEMCACHED_AUTH_FAILURE, MEMCACHED_AUTH_CONTINUE, MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */ } memcached_return_t; typedef enum { MEMCACHED_DISTRIBUTION_MODULA, MEMCACHED_DISTRIBUTION_CONSISTENT, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA, MEMCACHED_DISTRIBUTION_RANDOM, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY, MEMCACHED_DISTRIBUTION_CONSISTENT_MAX } memcached_server_distribution_t; typedef enum { MEMCACHED_BEHAVIOR_NO_BLOCK, MEMCACHED_BEHAVIOR_TCP_NODELAY, MEMCACHED_BEHAVIOR_HASH, MEMCACHED_BEHAVIOR_KETAMA, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, MEMCACHED_BEHAVIOR_CACHE_LOOKUPS, MEMCACHED_BEHAVIOR_SUPPORT_CAS, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, MEMCACHED_BEHAVIOR_DISTRIBUTION, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, MEMCACHED_BEHAVIOR_USER_DATA, MEMCACHED_BEHAVIOR_SORT_HOSTS, MEMCACHED_BEHAVIOR_VERIFY_KEY, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED, MEMCACHED_BEHAVIOR_KETAMA_HASH, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, MEMCACHED_BEHAVIOR_SND_TIMEOUT, MEMCACHED_BEHAVIOR_RCV_TIMEOUT, MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT, MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK, MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK, MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH, MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY, MEMCACHED_BEHAVIOR_NOREPLY, MEMCACHED_BEHAVIOR_USE_UDP, MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ, MEMCACHED_BEHAVIOR_CORK, MEMCACHED_BEHAVIOR_TCP_KEEPALIVE, MEMCACHED_BEHAVIOR_TCP_KEEPIDLE, MEMCACHED_BEHAVIOR_MAX } memcached_behavior_t; typedef enum { MEMCACHED_CALLBACK_PREFIX_KEY = 0, MEMCACHED_CALLBACK_USER_DATA = 1, MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2, MEMCACHED_CALLBACK_CLONE_FUNCTION = 3, #ifdef MEMCACHED_ENABLE_DEPRECATED MEMCACHED_CALLBACK_MALLOC_FUNCTION = 4, MEMCACHED_CALLBACK_REALLOC_FUNCTION = 5, MEMCACHED_CALLBACK_FREE_FUNCTION = 6, #endif MEMCACHED_CALLBACK_GET_FAILURE = 7, MEMCACHED_CALLBACK_DELETE_TRIGGER = 8, MEMCACHED_CALLBACK_MAX } memcached_callback_t; typedef enum { MEMCACHED_HASH_DEFAULT= 0, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_HSIEH, MEMCACHED_HASH_MURMUR, MEMCACHED_HASH_JENKINS, MEMCACHED_HASH_CUSTOM, MEMCACHED_HASH_MAX } memcached_hash_t; typedef enum { MEMCACHED_CONNECTION_UNKNOWN, MEMCACHED_CONNECTION_TCP, MEMCACHED_CONNECTION_UDP, MEMCACHED_CONNECTION_UNIX_SOCKET, MEMCACHED_CONNECTION_MAX } memcached_connection_t; #endif /* __LIBMEMCACHED_CONSTANTS_H__ */ parser-3.4.3/src/lib/md5/Makefile.in000644 000000 000000 00000036010 12170072104 017175 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/md5 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmd5_la_LIBADD = am_libmd5_la_OBJECTS = pa_md5c.lo pa_sha2.lo libmd5_la_OBJECTS = $(am_libmd5_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmd5_la_SOURCES) DIST_SOURCES = $(libmd5_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_md5.h pa_sha2.h noinst_LTLIBRARIES = libmd5.la libmd5_la_SOURCES = pa_md5c.c pa_sha2.c EXTRA_DIST = md5.vcproj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/md5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/md5/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmd5.la: $(libmd5_la_OBJECTS) $(libmd5_la_DEPENDENCIES) $(LINK) $(libmd5_la_OBJECTS) $(libmd5_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_md5c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_sha2.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-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: parser-3.4.3/src/lib/md5/pa_md5c.c000644 000000 000000 00000045372 12172765171 016636 0ustar00rootwheel000000 000000 /** @file Parser: copied from apache 1.3.20 sources. Replaced ap_ to pa_ prefixes. linked into all targets but Apache-module target, where linked targets/apache/pa_md5c.c stub instead. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) */ /* * This is work is derived from material Copyright RSA Data Security, Inc. * * The RSA copyright statement and Licence for that original material is * included below. This is followed by the Apache copyright statement and * licence for the modifications made to that material. */ /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* ==================================================================== * Copyright (c) 1996-1999 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * 4. The names "Apache Server" and "Apache Group" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Group and was originally based * on public domain software written at the National Center for * Supercomputing Applications, University of Illinois, Urbana-Champaign. * For more information on the Apache Group and the Apache HTTP server * project, please see . * */ /* * The pa_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 * MD5 crypt() function, which is licenced as follows: * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- */ #include "pa_md5.h" volatile const char * IDENT_PA_MD5_C="$Id: pa_md5c.c,v 1.17 2013/07/21 14:04:41 moko Exp $" IDENT_PA_MD5_H; /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform(UINT4 state[4], const unsigned char block[64]); static void Encode(unsigned char *output, const UINT4 *input, unsigned int len); static void Decode(UINT4 *output, const unsigned char *input, unsigned int len); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void pa_MD5Init(PA_MD5_CTX *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void pa_MD5Update(PA_MD5_CTX *context, const unsigned char *input, unsigned int inputLen) { unsigned int i, idx, partLen; /* Compute number of bytes mod 64 */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4) inputLen << 3)) < ((UINT4) inputLen << 3)) { context->count[1]++; } context->count[1] += (UINT4) inputLen >> 29; partLen = 64 - idx; /* Transform as many times as possible. */ #ifndef CHARSET_EBCDIC if (inputLen >= partLen) { memcpy(&context->buffer[idx], input, partLen); MD5Transform(context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) { MD5Transform(context->state, &input[i]); } idx = 0; } else { i = 0; } /* Buffer remaining input */ memcpy(&context->buffer[idx], &input[i], inputLen - i); #else /*CHARSET_EBCDIC*/ if (inputLen >= partLen) { ebcdic2ascii(&context->buffer[idx], input, partLen); MD5Transform(context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) { unsigned char inp_tmp[64]; ebcdic2ascii(inp_tmp, &input[i], 64); MD5Transform(context->state, inp_tmp); } idx = 0; } else { i = 0; } /* Buffer remaining input */ ebcdic2ascii(&context->buffer[idx], &input[i], inputLen - i); #endif /*CHARSET_EBCDIC*/ } /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ void pa_MD5Final(unsigned char digest[16], PA_MD5_CTX *context) { unsigned char bits[8]; unsigned int idx, padLen; /* Save number of bits */ Encode(bits, context->count, 8); #ifdef CHARSET_EBCDIC /* XXX: @@@: In order to make this no more complex than necessary, * this kludge converts the bits[] array using the ascii-to-ebcdic * table, because the following pa_MD5Update() re-translates * its input (ebcdic-to-ascii). * Otherwise, we would have to pass a "conversion" flag to pa_MD5Update() */ ascii2ebcdic(bits,bits,8); /* Since everything is converted to ascii within pa_MD5Update(), * the initial 0x80 (PADDING[0]) must be stored as 0x20 */ PADDING[0] = os_toebcdic[0x80]; #endif /*CHARSET_EBCDIC*/ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (idx < 56) ? (56 - idx) : (120 - idx); pa_MD5Update(context, (const unsigned char *)PADDING, padLen); /* Append length (before padding) */ pa_MD5Update(context, (const unsigned char *)bits, 8); /* Store state in digest */ Encode(digest, context->state, 16); /* Zeroize sensitive information. */ memset(context, 0, sizeof(*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform(UINT4 state[4], const unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode(x, block, 64); /* Round 1 */ FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */ FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */ FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */ FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */ FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */ FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */ FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */ FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */ FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */ FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */ FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */ GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */ GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */ GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */ GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */ GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */ GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */ GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */ GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */ GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */ GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */ HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */ HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */ HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */ HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */ HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */ HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */ HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */ HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */ HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */ II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */ II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */ II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */ II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */ II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */ II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */ II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */ II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */ II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ memset(x, 0, sizeof(x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode(unsigned char *output, const UINT4 *input, unsigned int len) { unsigned int i, j; UINT4 k; for (i = 0, j = 0; j < len; i++, j += 4) { k = input[i]; output[j] = (unsigned char) (k & 0xff); output[j + 1] = (unsigned char) ((k >> 8) & 0xff); output[j + 2] = (unsigned char) ((k >> 16) & 0xff); output[j + 3] = (unsigned char) ((k >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is * a multiple of 4. */ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4) input[j]) | (((UINT4) input[j + 1]) << 8) | (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24); } /* * The following MD5 password encryption code was largely borrowed from * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is * licenced as stated at the top of this file. */ void pa_to64(char *s, unsigned long v, int n) { static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; while (--n >= 0) { *s++ = itoa64[v&0x3f]; v >>= 6; } } void pa_MD5Encode(const unsigned char *pw, const unsigned char *salt, char *result, size_t nbytes) { /* * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL, * plus 4 for the '$' separators, plus the password hash itself. * Let's leave a goodly amount of leeway. */ char passwd[120], *p; const unsigned char *sp, *ep; unsigned char final[16]; int i; unsigned int sl; int pl; unsigned int pwlen; PA_MD5_CTX ctx, ctx1; unsigned long l; /* * Refine the salt first. It's possible we were given an already-hashed * string as the salt argument, so extract the actual salt value from it * if so. Otherwise just use the string up to the first '$' as the salt. */ sp = salt; /* * If it starts with the magic string, then skip that. */ if (strncmp((char *)sp, PA_MD5PW_ID, PA_MD5PW_IDLEN) == 0) { sp += PA_MD5PW_IDLEN; } /* * It stops at the first '$' or 8 chars, whichever comes first */ for (ep = sp; (*ep != '\0') && (*ep != '$') && (ep < (sp + 8)); ep++) { continue; } /* * Get the length of the true salt */ sl = ep - sp; /* * 'Time to make the doughnuts..' */ pa_MD5Init(&ctx); pwlen = strlen((char *)pw); /* * The password first, since that is what is most unknown */ pa_MD5Update(&ctx, pw, pwlen); /* * Then our magic string */ pa_MD5Update(&ctx, (const unsigned char *) PA_MD5PW_ID, PA_MD5PW_IDLEN); /* * Then the raw salt */ pa_MD5Update(&ctx, sp, sl); /* * Then just as many characters of the MD5(pw, salt, pw) */ pa_MD5Init(&ctx1); pa_MD5Update(&ctx1, pw, pwlen); pa_MD5Update(&ctx1, sp, sl); pa_MD5Update(&ctx1, pw, pwlen); pa_MD5Final(final, &ctx1); for(pl = pwlen; pl > 0; pl -= 16) { pa_MD5Update(&ctx, final, (pl > 16) ? 16 : (unsigned int) pl); } /* * Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); /* * Then something really weird... */ for (i = pwlen; i != 0; i >>= 1) { if (i & 1) { pa_MD5Update(&ctx, final, 1); } else { pa_MD5Update(&ctx, pw, 1); } } /* * Now make the output string. We know our limitations, so we * can use the string routines without bounds checking. */ strncpy(passwd, PA_MD5PW_ID, PA_MD5PW_IDLEN + 1); strncpy(passwd + PA_MD5PW_IDLEN, (char *)sp, sl + 1); passwd[PA_MD5PW_IDLEN + sl] = '$'; passwd[PA_MD5PW_IDLEN + sl + 1] = '\0'; pa_MD5Final(final, &ctx); /* * And now, just to make sure things don't run too fast.. * On a 60 Mhz Pentium this takes 34 msec, so you would * need 30 seconds to build a 1000 entry dictionary... */ for (i = 0; i < 1000; i++) { pa_MD5Init(&ctx1); if (i & 1) { pa_MD5Update(&ctx1, pw, pwlen); } else { pa_MD5Update(&ctx1, final, 16); } if (i % 3) { pa_MD5Update(&ctx1, sp, sl); } if (i % 7) { pa_MD5Update(&ctx1, pw, pwlen); } if (i & 1) { pa_MD5Update(&ctx1, final, 16); } else { pa_MD5Update(&ctx1, pw, pwlen); } pa_MD5Final(final,&ctx1); } p = passwd + strlen(passwd); l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; pa_to64(p, l, 4); p += 4; l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; pa_to64(p, l, 4); p += 4; l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; pa_to64(p, l, 4); p += 4; l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; pa_to64(p, l, 4); p += 4; l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; pa_to64(p, l, 4); p += 4; l = final[11] ; pa_to64(p, l, 2); p += 2; *p = '\0'; /* * Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); strncpy(result, passwd, nbytes - 1); } parser-3.4.3/src/lib/md5/pa_md5.h000644 000000 000000 00000012405 12171337664 016470 0ustar00rootwheel000000 000000 /** @file Parser: copied from apache 1.3.20 sources. Replaced ap_ to pa_ prefixes. linked into all targets but Apache-module target, where linked targets/apache/pa_md5c.c stub instead. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) */ /* * This is work is derived from material Copyright RSA Data Security, Inc. * * The RSA copyright statement and Licence for that original material is * included below. This is followed by the Apache copyright statement and * licence for the modifications made to that material. */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* ==================================================================== * Copyright (c) 1996-1999 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * 4. The names "Apache Server" and "Apache Group" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Group and was originally based * on public domain software written at the National Center for * Supercomputing Applications, University of Illinois, Urbana-Champaign. * For more information on the Apache Group and the Apache HTTP server * project, please see . * */ #ifndef PA_MD5_H #define PA_MD5_H #define IDENT_PA_MD5_H "$Id: pa_md5.h,v 1.13 2013/07/16 21:48:36 moko Exp $" #ifdef __cplusplus extern "C" { #endif #include "pa_config_includes.h" #define MD5_DIGESTSIZE 16 /* UINT4 defines a four byte word */ typedef uint32_t UINT4; /* MD5 context. */ typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } PA_MD5_CTX; /* * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ #define PA_MD5PW_ID "$apr1$" #define PA_MD5PW_IDLEN 6 void pa_MD5Init(PA_MD5_CTX *context); void pa_MD5Update(PA_MD5_CTX *context, const unsigned char *input, unsigned int inputLen); void pa_MD5Final(unsigned char digest[MD5_DIGESTSIZE], PA_MD5_CTX *context); void pa_MD5Encode(const unsigned char *password, const unsigned char *salt, char *result, size_t nbytes); void pa_to64(char *s, unsigned long v, int n); #ifdef __cplusplus } #endif #endif /* !PA_MD5_H */ parser-3.4.3/src/lib/md5/Makefile.am000644 000000 000000 00000000204 12170071637 017172 0ustar00rootwheel000000 000000 noinst_HEADERS = pa_md5.h pa_sha2.h noinst_LTLIBRARIES = libmd5.la libmd5_la_SOURCES = pa_md5c.c pa_sha2.c EXTRA_DIST = md5.vcproj parser-3.4.3/src/lib/md5/md5.vcproj000644 000000 000000 00000010372 12170072531 017051 0ustar00rootwheel000000 000000 parser-3.4.3/src/lib/md5/pa_sha2.c000644 000000 000000 00000074045 12175721563 016642 0ustar00rootwheel000000 000000 /* * FILE: sha2.c * AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/ * * Copyright (c) 2000-2001, Aaron D. Gifford * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "pa_sha2.h" /* * ASSERT NOTE: * Some sanity checking code is included using assert(). On my FreeBSD * system, this additional code can be removed by compiling with NDEBUG * defined. Check your own systems manpage on assert() to see how to * compile WITHOUT the sanity checking code on your system. * * UNROLLED TRANSFORM LOOP NOTE: * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform * loop version for the hash transform rounds (defined using macros * later in this file). Either define on the command line, for example: * * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c * * or define below: * * #define SHA2_UNROLL_TRANSFORM * */ /*** SHA-256/384/512 Machine Architecture Definitions *****************/ /* * Define the followingsha2_* types to types of the correct length on * the native archtecture. Most BSD systems and Linux define u_intXX_t * types. Machines with very recent ANSI C headers, can use the * uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H * during compile or in the sha.h header file. * * Machines that support neither u_intXX_t nor inttypes.h's uintXX_t * will need to define these three typedefs below (and the appropriate * ones in sha.h too) by hand according to their system architecture. * * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t * types and pointing out recent ANSI C support for uintXX_t in inttypes.h. */ typedef uint8_t sha2_byte; /* Exactly 1 byte */ typedef uint32_t sha2_word32; /* Exactly 4 bytes */ typedef uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ #define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) #define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) #define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ #ifdef PA_LITTLE_ENDIAN #define REVERSE32(w,x) { \ sha2_word32 tmp = (w); \ tmp = (tmp >> 16) | (tmp << 16); \ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ } #define REVERSE64(w,x) { \ sha2_word64 tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ ((tmp & 0x0000ffff0000ffffULL) << 16); \ } #endif /* PA_LITTLE_ENDIAN */ /* * Macro for incrementally adding the unsigned 64-bit integer n to the * unsigned 128-bit integer (represented using a two-element array of * 64-bit words): */ #define ADDINC128(w,n) { \ (w)[0] += (sha2_word64)(n); \ if ((w)[0] < (n)) { \ (w)[1]++; \ } \ } /* * Macros for copying blocks of memory and for zeroing out ranges * of memory. Using these macros makes it easy to switch from * using memset()/memcpy() and using bzero()/bcopy(). * * Please define either SHA2_USE_MEMSET_MEMCPY or define * SHA2_USE_BZERO_BCOPY depending on which function set you * choose to use: */ #if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) /* Default to memset()/memcpy() if no option is specified */ #define SHA2_USE_MEMSET_MEMCPY 1 #endif #if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) /* Abort with an error if BOTH options are defined */ #error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both! #endif #ifdef SHA2_USE_MEMSET_MEMCPY #define MEMSET_BZERO(p,l) memset((p), 0, (l)) #define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) #endif #ifdef SHA2_USE_BZERO_BCOPY #define MEMSET_BZERO(p,l) bzero((p), (l)) #define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) #endif /*** THE SIX LOGICAL FUNCTIONS ****************************************/ /* * Bit shifting and rotation (used by the six SHA-XYZ logical functions: * * NOTE: The naming of R and S appears backwards here (R is a SHIFT and * S is a ROTATION) because the SHA-256/384/512 description document * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this * same "backwards" definition. */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) /* 32-bit Rotate-right (used in SHA-256): */ #define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) /* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) /* Four of six logical functions used in SHA-256: */ #define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) #define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) #define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) #define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) #define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) #define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) /*** INTERNAL FUNCTION PROTOTYPES *************************************/ /* NOTE: These should not be accessed directly from outside this * library -- they are intended for private internal visibility/use * only. */ void pa_SHA512_Last(SHA512_CTX*); void pa_SHA256_Transform(SHA256_CTX*, const sha2_word32*); void pa_SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ const static sha2_word32 K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* Initial hash value H for SHA-256: */ const static sha2_word32 sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }; /* Hash constant words K for SHA-384 and SHA-512: */ const static sha2_word64 K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; /* Initial hash value H for SHA-384 */ const static sha2_word64 sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; /* Initial hash value H for SHA-512 */ const static sha2_word64 sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; /* * Constant used by SHA256/384/512_End() functions for converting the * digest to a readable hexadecimal character string: */ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-256: *********************************************************/ void pa_SHA256_Init(SHA256_CTX* context) { if (context == (SHA256_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH); context->bitcount = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-256 round macros: */ #ifdef PA_LITTLE_ENDIAN #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE32(*data++, W256[j]); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + W256[j]; \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #else /* PA_LITTLE_ENDIAN */ #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + (W256[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #endif /* PA_LITTLE_ENDIAN */ #define ROUND256(a,b,c,d,e,f,g,h) \ s0 = W256[(j+1)&0x0f]; \ s0 = sigma0_256(s0); \ s1 = W256[(j+14)&0x0f]; \ s1 = sigma1_256(s1); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ void pa_SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, *W256; int j; W256 = (sha2_word32*)context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { /* Rounds 0 to 15 (unrolled): */ ROUND256_0_TO_15(a,b,c,d,e,f,g,h); ROUND256_0_TO_15(h,a,b,c,d,e,f,g); ROUND256_0_TO_15(g,h,a,b,c,d,e,f); ROUND256_0_TO_15(f,g,h,a,b,c,d,e); ROUND256_0_TO_15(e,f,g,h,a,b,c,d); ROUND256_0_TO_15(d,e,f,g,h,a,b,c); ROUND256_0_TO_15(c,d,e,f,g,h,a,b); ROUND256_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds to 64: */ do { ROUND256(a,b,c,d,e,f,g,h); ROUND256(h,a,b,c,d,e,f,g); ROUND256(g,h,a,b,c,d,e,f); ROUND256(f,g,h,a,b,c,d,e); ROUND256(e,f,g,h,a,b,c,d); ROUND256(d,e,f,g,h,a,b,c); ROUND256(c,d,e,f,g,h,a,b); ROUND256(b,c,d,e,f,g,h,a); } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ void pa_SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, T2, *W256; int j; W256 = (sha2_word32*)context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #ifdef PA_LITTLE_ENDIAN /* Copy data while converting to host byte order */ REVERSE32(*data++,W256[j]); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; #else /* PA_LITTLE_ENDIAN */ /* Apply the SHA-256 compression function to update a..h with copy */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); #endif /* PA_LITTLE_ENDIAN */ T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W256[(j+1)&0x0f]; s0 = sigma0_256(s0); s1 = W256[(j+14)&0x0f]; s1 = sigma1_256(s1); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void pa_SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); usedspace = (unsigned int)((context->bitcount >> 3) % SHA256_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = SHA256_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); context->bitcount += freespace << 3; len -= freespace; data += freespace; pa_SHA256_Transform(context, (sha2_word32*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); context->bitcount += len << 3; /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ pa_SHA256_Transform(context, (sha2_word32*)data); context->bitcount += SHA256_BLOCK_LENGTH << 3; len -= SHA256_BLOCK_LENGTH; data += SHA256_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ MEMCPY_BCOPY(context->buffer, data, len); context->bitcount += len << 3; } /* Clean up: */ usedspace = freespace = 0; } void pa_SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; /* Sanity check: */ assert(context != (SHA256_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { usedspace = (unsigned int)((context->bitcount >> 3) % SHA256_BLOCK_LENGTH); #ifdef PA_LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount,context->bitcount); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < SHA256_BLOCK_LENGTH) { MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ pa_SHA256_Transform(context, (sha2_word32*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); } } else { /* Set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Set the bit count: */ *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ pa_SHA256_Transform(context, (sha2_word32*)context->buffer); #ifdef PA_LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE32(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, SHA256_DIGEST_LENGTH); #endif } /* Clean up state data: */ MEMSET_BZERO(context, sizeof(SHA256_CTX)); usedspace = 0; } char *pa_SHA256_End(SHA256_CTX* context, char buffer[]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; /* Sanity check: */ assert(context != (SHA256_CTX*)0); if (buffer != (char*)0) { pa_SHA256_Final(digest, context); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { MEMSET_BZERO(context, sizeof(SHA256_CTX)); } MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); return buffer; } char* pa_SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { SHA256_CTX context; pa_SHA256_Init(&context); pa_SHA256_Update(&context, data, len); return pa_SHA256_End(&context, digest); } /*** SHA-512: *********************************************************/ void pa_SHA512_Init(SHA512_CTX* context) { if (context == (SHA512_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-512 round macros: */ #ifdef PA_LITTLE_ENDIAN #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE64(*data++, W512[j]); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + W512[j]; \ (d) += T1, \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ j++ #else /* PA_LITTLE_ENDIAN */ #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + (W512[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ #endif /* PA_LITTLE_ENDIAN */ #define ROUND512(a,b,c,d,e,f,g,h) \ s0 = W512[(j+1)&0x0f]; \ s0 = sigma0_512(s0); \ s1 = W512[(j+14)&0x0f]; \ s1 = sigma1_512(s1); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ void pa_SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { ROUND512_0_TO_15(a,b,c,d,e,f,g,h); ROUND512_0_TO_15(h,a,b,c,d,e,f,g); ROUND512_0_TO_15(g,h,a,b,c,d,e,f); ROUND512_0_TO_15(f,g,h,a,b,c,d,e); ROUND512_0_TO_15(e,f,g,h,a,b,c,d); ROUND512_0_TO_15(d,e,f,g,h,a,b,c); ROUND512_0_TO_15(c,d,e,f,g,h,a,b); ROUND512_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds up to 79: */ do { ROUND512(a,b,c,d,e,f,g,h); ROUND512(h,a,b,c,d,e,f,g); ROUND512(g,h,a,b,c,d,e,f); ROUND512(f,g,h,a,b,c,d,e); ROUND512(e,f,g,h,a,b,c,d); ROUND512(d,e,f,g,h,a,b,c); ROUND512(c,d,e,f,g,h,a,b); ROUND512(b,c,d,e,f,g,h,a); } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ void pa_SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #ifdef PA_LITTLE_ENDIAN /* Convert TO host byte order */ REVERSE64(*data++, W512[j]); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; #else /* PA_LITTLE_ENDIAN */ /* Apply the SHA-512 compression function to update a..h with copy */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); #endif /* PA_LITTLE_ENDIAN */ T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W512[(j+1)&0x0f]; s0 = sigma0_512(s0); s1 = W512[(j+14)&0x0f]; s1 = sigma1_512(s1); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void pa_SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); usedspace = (unsigned int)((context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = SHA512_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; pa_SHA512_Transform(context, (sha2_word64*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); ADDINC128(context->bitcount, len << 3); /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ pa_SHA512_Transform(context, (sha2_word64*)data); ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); len -= SHA512_BLOCK_LENGTH; data += SHA512_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ MEMCPY_BCOPY(context->buffer, data, len); ADDINC128(context->bitcount, len << 3); } /* Clean up: */ usedspace = freespace = 0; } void pa_SHA512_Last(SHA512_CTX* context) { unsigned int usedspace; usedspace = (unsigned int)((context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH); #ifdef PA_LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0],context->bitcount[0]); REVERSE64(context->bitcount[1],context->bitcount[1]); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < SHA512_BLOCK_LENGTH) { MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ pa_SHA512_Transform(context, (sha2_word64*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); } } else { /* Prepare for final transform: */ MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Store the length of input data (in bits): */ *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; /* Final transform: */ pa_SHA512_Transform(context, (sha2_word64*)context->buffer); } void pa_SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ assert(context != (SHA512_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { pa_SHA512_Last(context); /* Save the hash data for output: */ #ifdef PA_LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); #endif } /* Zero out state data */ MEMSET_BZERO(context, sizeof(SHA512_CTX)); } char *pa_SHA512_End(SHA512_CTX* context, char buffer[]) { sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; int i; /* Sanity check: */ assert(context != (SHA512_CTX*)0); if (buffer != (char*)0) { pa_SHA512_Final(digest, context); for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { MEMSET_BZERO(context, sizeof(SHA512_CTX)); } MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); return buffer; } char* pa_SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { SHA512_CTX context; pa_SHA512_Init(&context); pa_SHA512_Update(&context, data, len); return pa_SHA512_End(&context, digest); } /*** SHA-384: *********************************************************/ void pa_SHA384_Init(SHA384_CTX* context) { if (context == (SHA384_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } void pa_SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { pa_SHA512_Update((SHA512_CTX*)context, data, len); } void pa_SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ assert(context != (SHA384_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { pa_SHA512_Last((SHA512_CTX*)context); /* Save the hash data for output: */ #ifdef PA_LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 6; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); #endif } /* Zero out state data */ MEMSET_BZERO(context, sizeof(SHA384_CTX)); } char *pa_SHA384_End(SHA384_CTX* context, char buffer[]) { sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; int i; /* Sanity check: */ assert(context != (SHA384_CTX*)0); if (buffer != (char*)0) { pa_SHA384_Final(digest, context); for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { MEMSET_BZERO(context, sizeof(SHA384_CTX)); } MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); return buffer; } char* pa_SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { SHA384_CTX context; pa_SHA384_Init(&context); pa_SHA384_Update(&context, data, len); return pa_SHA384_End(&context, digest); } parser-3.4.3/src/lib/md5/pa_sha2.h000644 000000 000000 00000007472 12171337664 016650 0ustar00rootwheel000000 000000 /* * FILE: sha2.h * AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/ * * Copyright (c) 2000-2001, Aaron D. Gifford * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: pa_sha2.h,v 1.2 2013/07/16 21:48:36 moko Exp $ */ #ifndef __PA_SHA2_H__ #define __PA_SHA2_H__ #ifdef __cplusplus extern "C" { #endif #include "pa_config_includes.h" /*** SHA-256/384/512 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 #define SHA256_DIGEST_LENGTH 32 #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) #define SHA384_BLOCK_LENGTH 128 #define SHA384_DIGEST_LENGTH 48 #define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) #define SHA512_BLOCK_LENGTH 128 #define SHA512_DIGEST_LENGTH 64 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) /*** SHA-256/384/512 Context Structures *******************************/ /* NOTE: If your architecture does not define either u_intXX_t types or * uintXX_t (from inttypes.h), you may need to define things by hand * for your system: */ typedef struct _SHA256_CTX { uint32_t state[8]; uint64_t bitcount; uint8_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; typedef struct _SHA512_CTX { uint64_t state[8]; uint64_t bitcount[2]; uint8_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ void pa_SHA256_Init(SHA256_CTX *); void pa_SHA256_Update(SHA256_CTX*, const uint8_t*, size_t); void pa_SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); char* pa_SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); char* pa_SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); void pa_SHA384_Init(SHA384_CTX*); void pa_SHA384_Update(SHA384_CTX*, const uint8_t*, size_t); void pa_SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); char* pa_SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); char* pa_SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); void pa_SHA512_Init(SHA512_CTX*); void pa_SHA512_Update(SHA512_CTX*, const uint8_t*, size_t); void pa_SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); char* pa_SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); char* pa_SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __SHA2_H__ */ parser-3.4.3/src/lib/json/Makefile.in000644 000000 000000 00000036055 12233734172 017504 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/json DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libjson_la_LIBADD = am_libjson_la_OBJECTS = pa_json.lo libjson_la_OBJECTS = $(am_libjson_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libjson_la_SOURCES) DIST_SOURCES = $(libjson_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I../../include -I../gc/include noinst_HEADERS = pa_json.h noinst_LTLIBRARIES = libjson.la libjson_la_SOURCES = pa_json.C EXTRA_DIST = json.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/json/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/json/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libjson.la: $(libjson_la_OBJECTS) $(libjson_la_DEPENDENCIES) $(CXXLINK) $(libjson_la_OBJECTS) $(libjson_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_json.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-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: parser-3.4.3/src/lib/json/pa_json.C000644 000000 000000 00000065271 12233736165 017202 0ustar00rootwheel000000 000000 /* * Copyright (C) 2009-2011 Vincent Hanquez * * This program 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; version 2.1 or version 3.0 only. * * 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. */ /* * the class, states and state transition tables has been inspired by the JSON_parser.c * available at http://json.org, but are quite different on the way that the * parser handles its parse buffer and contains significant differences that affect * the JSON compliance. */ #include "pa_json.h" enum classes { C_SPACE, /* space */ C_NL, /* newline */ C_WHITE, /* tab, CR */ C_LCURB, C_RCURB, /* object opening/closing */ C_LSQRB, C_RSQRB, /* array opening/closing */ /* syntax symbols */ C_COLON, C_COMMA, C_QUOTE, /* " */ C_BACKS, /* \ */ C_SLASH, /* / */ C_PLUS, C_MINUS, C_DOT, C_ZERO, C_DIGIT, /* digits */ C_a, C_b, C_c, C_d, C_e, C_f, C_l, C_n, C_r, C_s, C_t, C_u, /* nocaps letters */ C_ABCDF, C_E, /* caps letters */ C_OTHER, /* all other */ C_STAR, /* star in C style comment */ C_HASH, /* # for YAML comment */ C_ERROR = 0xfe, }; /* map from character < 128 to classes. from 128 to 256 all C_OTHER */ static uint8_t character_class[128] = { C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_WHITE, C_NL, C_ERROR, C_ERROR, C_WHITE, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_SPACE, C_OTHER, C_QUOTE, C_HASH, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_STAR, C_PLUS, C_COMMA, C_MINUS, C_DOT, C_SLASH, C_ZERO, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_COLON, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_ABCDF, C_ABCDF, C_ABCDF, C_ABCDF, C_E, C_ABCDF, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_LSQRB, C_BACKS, C_RSQRB, C_OTHER, C_OTHER, C_OTHER, C_a, C_b, C_c, C_d, C_e, C_f, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_l, C_OTHER, C_n, C_OTHER, C_OTHER, C_OTHER, C_r, C_s, C_t, C_u, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_LCURB, C_OTHER, C_RCURB, C_OTHER, C_OTHER }; /* define all states and actions that will be taken on each transition. * * states are defined first because of the fact they are use as index in the * transitions table. they usually contains either a number or a prefix _ * for simple state like string, object, value ... * * actions are defined starting from 0x80. state error is defined as 0xff */ enum states { STATE_GO, /* start */ STATE_OK, /* ok */ STATE_OO, /* object */ STATE_KK, /* key */ STATE_CO, /* colon */ STATE_VV, /* value */ STATE_AA, /* array */ STATE_SS, /* string */ STATE_E0, /* escape */ STATE_U1, STATE_U2, STATE_U3, STATE_U4, /* unicode states */ STATE_M0, STATE_Z0, STATE_I0, /* number states */ STATE_R1, STATE_R2, /* real states (after-dot digits) */ STATE_X1, STATE_X2, STATE_X3, /* exponant states */ STATE_T1, STATE_T2, STATE_T3, /* true constant states */ STATE_F1, STATE_F2, STATE_F3, STATE_F4, /* false constant states */ STATE_N1, STATE_N2, STATE_N3, /* null constant states */ STATE_C1, STATE_C2, STATE_C3, /* C-comment states */ STATE_Y1, /* YAML-comment state */ STATE_D1, STATE_D2, /* multi unicode states */ }; /* the following are actions that need to be taken */ enum actions { STATE_KS = 0x80, /* key separator */ STATE_SP, /* comma separator */ STATE_AB, /* array begin */ STATE_AE, /* array ending */ STATE_OB, /* object begin */ STATE_OE, /* object end */ STATE_CB, /* C-comment begin */ STATE_YB, /* YAML-comment begin */ STATE_CE, /* YAML/C comment end */ STATE_FA, /* false */ STATE_TR, /* true */ STATE_NU, /* null */ STATE_DE, /* double detected by exponent */ STATE_DF, /* double detected by . */ STATE_SE, /* string end */ STATE_MX, /* integer detected by minus */ STATE_ZX, /* integer detected by zero */ STATE_IX, /* integer detected by 1-9 */ STATE_UC, /* Unicode character read */ }; /* error state */ #define STATE___ 0xff #define NR_STATES (STATE_D2 + 1) #define NR_CLASSES (C_HASH + 1) #define IS_STATE_ACTION(s) ((s) & 0x80) #define S(x) STATE_##x #define PT_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a1,b1,c1,d1,e1,f1,g1,h1) \ { S(a),S(b),S(c),S(d),S(e),S(f),S(g),S(h),S(i),S(j),S(k),S(l),S(m),S(n), \ S(o),S(p),S(q),S(r),S(s),S(t),S(u),S(v),S(w),S(x),S(y),S(z),S(a1),S(b1), \ S(c1),S(d1),S(e1),S(f1),S(g1),S(h1) } /* map from the (previous state+new character class) to the next parser transition */ static const uint8_t state_transition_table[NR_STATES][NR_CLASSES] = { /* white ABCDF other */ /* sp nl | { } [ ] : , " \ / + - . 0 19 a b c d e f l n r s t u | E | * # */ /*GO*/ PT_(GO,GO,GO,OB,__,AB,__,__,__,__,__,CB,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,YB), /*OK*/ PT_(OK,OK,OK,__,OE,__,AE,__,SP,__,__,CB,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,YB), /*OO*/ PT_(OO,OO,OO,__,OE,__,__,__,__,SS,__,CB,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,YB), /*KK*/ PT_(KK,KK,KK,__,__,__,__,__,__,SS,__,CB,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,YB), /*CO*/ PT_(CO,CO,CO,__,__,__,__,KS,__,__,__,CB,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,YB), /*VV*/ PT_(VV,VV,VV,OB,__,AB,__,__,__,SS,__,CB,__,MX,__,ZX,IX,__,__,__,__,__,F1,__,N1,__,__,T1,__,__,__,__,__,YB), /*AA*/ PT_(AA,AA,AA,OB,__,AB,AE,__,__,SS,__,CB,__,MX,__,ZX,IX,__,__,__,__,__,F1,__,N1,__,__,T1,__,__,__,__,__,YB), /****************************************************************************************************************/ /*SS*/ PT_(SS,__,__,SS,SS,SS,SS,SS,SS,SE,E0,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS,SS), /*E0*/ PT_(__,__,__,__,__,__,__,__,__,SS,SS,SS,__,__,__,__,__,__,SS,__,__,__,SS,__,SS,SS,__,SS,U1,__,__,__,__,__), /*U1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,U2,U2,U2,U2,U2,U2,U2,U2,__,__,__,__,__,__,U2,U2,__,__,__), /*U2*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,U3,U3,U3,U3,U3,U3,U3,U3,__,__,__,__,__,__,U3,U3,__,__,__), /*U3*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,U4,U4,U4,U4,U4,U4,U4,U4,__,__,__,__,__,__,U4,U4,__,__,__), /*U4*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,UC,UC,UC,UC,UC,UC,UC,UC,__,__,__,__,__,__,UC,UC,__,__,__), /****************************************************************************************************************/ /*M0*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,Z0,I0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /*Z0*/ PT_(OK,OK,OK,__,OE,__,AE,__,SP,__,__,CB,__,__,DF,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,YB), /*I0*/ PT_(OK,OK,OK,__,OE,__,AE,__,SP,__,__,CB,__,__,DF,I0,I0,__,__,__,__,DE,__,__,__,__,__,__,__,__,DE,__,__,YB), /*R1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,R2,R2,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /*R2*/ PT_(OK,OK,OK,__,OE,__,AE,__,SP,__,__,CB,__,__,__,R2,R2,__,__,__,__,X1,__,__,__,__,__,__,__,__,X1,__,__,YB), /*X1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,X2,X2,__,X3,X3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /*X2*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,X3,X3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /*X3*/ PT_(OK,OK,OK,__,OE,__,AE,__,SP,__,__,__,__,__,__,X3,X3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /****************************************************************************************************************/ /*T1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,T2,__,__,__,__,__,__,__,__), /*T2*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,T3,__,__,__,__,__), /*T3*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,TR,__,__,__,__,__,__,__,__,__,__,__,__), /*F1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F2,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /*F2*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F3,__,__,__,__,__,__,__,__,__,__), /*F3*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F4,__,__,__,__,__,__,__), /*F4*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,FA,__,__,__,__,__,__,__,__,__,__,__,__), /*N1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,N2,__,__,__,__,__), /*N2*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,N3,__,__,__,__,__,__,__,__,__,__), /*N3*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,NU,__,__,__,__,__,__,__,__,__,__), /****************************************************************************************************************/ /*C1*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,C2,__), /*C2*/ PT_(C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C3,C2), /*C3*/ PT_(C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,CE,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C2,C3,C2), /*Y1*/ PT_(Y1,CE,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1,Y1), /*D1*/ PT_(__,__,__,__,__,__,__,__,__,__,D2,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__), /*D2*/ PT_(__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,U1,__,__,__,__,__), }; #undef S #undef PT_ /* map from (previous state+new character class) to the buffer policy. ignore=0/append=1/escape=2 */ static const uint8_t buffer_policy_table[NR_STATES][NR_CLASSES] = { /* white ABCDF other */ /* sp nl | { } [ ] : , " \ / + - . 0 19 a b c d e f l n r s t u | E | * # */ /*GO*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*OK*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*OO*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*KK*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*CO*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*VV*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*AA*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /**************************************************************************************************************/ /*SS*/ { 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /*E0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0 }, /*U1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /*U2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /*U3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /*U4*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /**************************************************************************************************************/ /*M0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*Z0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*I0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, /*R1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*R2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, /*X1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*X2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*X3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /**************************************************************************************************************/ /*T1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*T2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*T3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F4*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*N1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*N2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*N3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /**************************************************************************************************************/ /*C1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*C2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*C3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*Y1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*D1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*D2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; #define MODE_ARRAY 0 #define MODE_OBJECT 1 #define parser_malloc(parser, s) parser->config.user_malloc(s) #define parser_realloc(parser, p, s) parser->config.user_realloc(p, s) #define parser_free(parser, p) parser->config.user_free(p) static int state_grow(json_parser *parser) { uint32_t newsize = parser->stack_size * 2; void *ptr; if (parser->config.max_nesting != 0) return JSON_ERROR_NESTING_LIMIT; ptr = parser_realloc(parser, parser->stack, newsize * sizeof(uint8_t)); if (!ptr) return JSON_ERROR_NO_MEMORY; parser->stack = (uint8_t *)ptr; parser->stack_size = newsize; return 0; } static int state_push(json_parser *parser, uint8_t mode) { if (parser->stack_offset >= parser->stack_size) { int ret = state_grow(parser); if (ret) return ret; } parser->stack[parser->stack_offset++] = mode; return 0; } static int state_pop(json_parser *parser, uint8_t mode) { if (parser->stack_offset == 0) return JSON_ERROR_POP_EMPTY; parser->stack_offset--; if (parser->stack[parser->stack_offset] != mode) return JSON_ERROR_POP_UNEXPECTED_MODE; return 0; } static int buffer_grow(json_parser *parser) { uint32_t newsize; void *ptr; uint32_t max = parser->config.max_data; if (max > 0 && parser->buffer_size == max) return JSON_ERROR_DATA_LIMIT; newsize = parser->buffer_size * 2; if (max > 0 && newsize > max) newsize = max; ptr = parser_realloc(parser, parser->buffer, newsize * sizeof(char)); if (!ptr) return JSON_ERROR_NO_MEMORY; parser->buffer = (char *)ptr; parser->buffer_size = newsize; return 0; } static int buffer_push(json_parser *parser, unsigned char c) { int ret; if (parser->buffer_offset + 1 >= parser->buffer_size) { ret = buffer_grow(parser); if (ret) return ret; } parser->buffer[parser->buffer_offset++] = c; return 0; } static int do_callback_withbuf(json_parser *parser, int type) { if (!parser->callback) return 0; parser->buffer[parser->buffer_offset] = '\0'; return (*parser->callback)(parser->userdata, type, parser->buffer, parser->buffer_offset); } static int do_callback(json_parser *parser, int type) { if (!parser->callback) return 0; return (*parser->callback)(parser->userdata, type, NULL, 0); } static int do_buffer(json_parser *parser) { int ret = 0; switch (parser->type) { case JSON_KEY: case JSON_STRING: case JSON_FLOAT: case JSON_INT: case JSON_NULL: case JSON_TRUE: case JSON_FALSE: ret = do_callback_withbuf(parser, parser->type); if (ret) return ret; break; default: break; } parser->buffer_offset = 0; return ret; } static const uint8_t hextable[] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, }; #define hex(c) (hextable[(uint8_t) c]) /* high surrogate range from d800 to dbff */ /* low surrogate range dc00 to dfff */ #define IS_HIGH_SURROGATE(uc) (((uc) & 0xfc00) == 0xd800) #define IS_LOW_SURROGATE(uc) (((uc) & 0xfc00) == 0xdc00) /* transform an unicode [0-9A-Fa-f]{4} sequence into a proper value */ static int decode_unicode_char(json_parser *parser) { uint32_t uval; char *b = parser->buffer; uint32_t offset = parser->buffer_offset; uval = (hex(b[offset - 4]) << 12) | (hex(b[offset - 3]) << 8) | (hex(b[offset - 2]) << 4) | hex(b[offset - 1]); parser->buffer_offset -= 4; /* fast case */ if (!parser->unicode_multi && uval < 0x80) { b[parser->buffer_offset++] = (char) uval; return 0; } if (parser->unicode_multi) { if (!IS_LOW_SURROGATE(uval)) return JSON_ERROR_UNICODE_MISSING_LOW_SURROGATE; uval = 0x10000 + ((parser->unicode_multi & 0x3ff) << 10) + (uval & 0x3ff); b[parser->buffer_offset++] = (char) ((uval >> 18) | 0xf0); b[parser->buffer_offset++] = (char) (((uval >> 12) & 0x3f) | 0x80); b[parser->buffer_offset++] = (char) (((uval >> 6) & 0x3f) | 0x80); b[parser->buffer_offset++] = (char) ((uval & 0x3f) | 0x80); parser->unicode_multi = 0; return 0; } if (IS_LOW_SURROGATE(uval)) return JSON_ERROR_UNICODE_UNEXPECTED_LOW_SURROGATE; if (IS_HIGH_SURROGATE(uval)) { parser->unicode_multi = (uint16_t)uval; return 0; } if (uval < 0x800) { b[parser->buffer_offset++] = (char) ((uval >> 6) | 0xc0); b[parser->buffer_offset++] = (char) ((uval & 0x3f) | 0x80); } else { b[parser->buffer_offset++] = (char) ((uval >> 12) | 0xe0); b[parser->buffer_offset++] = (char) (((uval >> 6) & 0x3f) | 0x80); b[parser->buffer_offset++] = (char) (((uval >> 0) & 0x3f) | 0x80); } return 0; } static int buffer_push_escape(json_parser *parser, unsigned char next) { char c = '\0'; switch (next) { case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case '"': c = '"'; break; case '/': c = '/'; break; case '\\': c = '\\'; break; } /* push the escaped character */ return buffer_push(parser, c); } #define CHK(f) { ret = f; if (ret) return ret; } static int act_uc(json_parser *parser) { int ret; CHK(decode_unicode_char(parser)); parser->state = (uint8_t)((parser->unicode_multi) ? STATE_D1 : STATE_SS); return 0; } static int act_yb(json_parser *parser) { if (!parser->config.allow_yaml_comments) return JSON_ERROR_COMMENT_NOT_ALLOWED; parser->save_state = parser->state; return 0; } static int act_cb(json_parser *parser) { if (!parser->config.allow_c_comments) return JSON_ERROR_COMMENT_NOT_ALLOWED; parser->save_state = parser->state; return 0; } static int act_ce(json_parser *parser) { parser->state = (uint8_t)((parser->save_state > STATE_AA) ? STATE_OK : parser->save_state); return 0; } static int act_ob(json_parser *parser) { int ret; CHK(do_callback(parser, JSON_OBJECT_BEGIN)); CHK(state_push(parser, MODE_OBJECT)); parser->expecting_key = 1; return 0; } static int act_oe(json_parser *parser) { int ret; CHK(state_pop(parser, MODE_OBJECT)); CHK(do_callback(parser, JSON_OBJECT_END)); parser->expecting_key = 0; return 0; } static int act_ab(json_parser *parser) { int ret; CHK(do_callback(parser, JSON_ARRAY_BEGIN)); CHK(state_push(parser, MODE_ARRAY)); return 0; } static int act_ae(json_parser *parser) { int ret; CHK(state_pop(parser, MODE_ARRAY)); CHK(do_callback(parser, JSON_ARRAY_END)); return 0; } static int act_se(json_parser *parser) { int ret; CHK(do_callback_withbuf(parser, (parser->expecting_key) ? JSON_KEY : JSON_STRING)); parser->buffer_offset = 0; parser->state = (uint8_t)((parser->expecting_key) ? STATE_CO : STATE_OK); parser->expecting_key = 0; return 0; } static int act_sp(json_parser *parser) { if (parser->stack_offset == 0) return JSON_ERROR_COMMA_OUT_OF_STRUCTURE; if (parser->stack[parser->stack_offset - 1] == MODE_OBJECT) { parser->expecting_key = 1; parser->state = STATE_KK; } else parser->state = STATE_VV; return 0; } struct action_descr { int (*call)(json_parser *parser); json_type type; uint8_t state; /* 0 if we let the callback set the value it want */ uint8_t dobuffer; }; static struct action_descr actions_map[] = { { NULL, JSON_NONE, STATE_VV, 0 }, /* KS */ { act_sp, JSON_NONE, 0, 1 }, /* SP */ { act_ab, JSON_NONE, STATE_AA, 0 }, /* AB */ { act_ae, JSON_NONE, STATE_OK, 1 }, /* AE */ { act_ob, JSON_NONE, STATE_OO, 0 }, /* OB */ { act_oe, JSON_NONE, STATE_OK, 1 }, /* OE */ { act_cb, JSON_NONE, STATE_C1, 1 }, /* CB */ { act_yb, JSON_NONE, STATE_Y1, 1 }, /* YB */ { act_ce, JSON_NONE, 0, 0 }, /* CE */ { NULL, JSON_FALSE, STATE_OK, 0 }, /* FA */ { NULL, JSON_TRUE, STATE_OK, 0 }, /* TR */ { NULL, JSON_NULL, STATE_OK, 0 }, /* NU */ { NULL, JSON_FLOAT, STATE_X1, 0 }, /* DE */ { NULL, JSON_FLOAT, STATE_R1, 0 }, /* DF */ { act_se, JSON_NONE, 0, 0 }, /* SE */ { NULL, JSON_INT, STATE_M0, 0 }, /* MX */ { NULL, JSON_INT, STATE_Z0, 0 }, /* ZX */ { NULL, JSON_INT, STATE_I0, 0 }, /* IX */ { act_uc, JSON_NONE, 0, 0 }, /* UC */ }; static int do_action(json_parser *parser, uint8_t next_state) { struct action_descr *descr = &actions_map[next_state & ~0x80]; if (descr->call) { int ret; if (descr->dobuffer) CHK(do_buffer(parser)); CHK((descr->call)(parser)); } if (descr->state) parser->state = descr->state; parser->type = descr->type; return 0; } /** json_parser_init initialize a parser structure taking a config, * a config and its userdata. * return JSON_ERROR_NO_MEMORY if memory allocation failed or SUCCESS. */ int json_parser_init(json_parser *parser, json_config *config, json_parser_callback callback, void *userdata) { memset(parser, 0, sizeof(*parser)); if (config) memcpy(&parser->config, config, sizeof(json_config)); parser->callback = callback; parser->userdata = userdata; /* initialise parsing stack and state */ parser->stack_offset = 0; parser->state = STATE_GO; /* initialize the parse stack */ parser->stack_size = (parser->config.max_nesting > 0) ? parser->config.max_nesting : LIBJSON_DEFAULT_STACK_SIZE; parser->stack = (uint8_t *)parser_malloc(parser, parser->stack_size * sizeof(parser->stack[0])); if (!parser->stack) return JSON_ERROR_NO_MEMORY; /* initialize the parse buffer */ parser->buffer_size = (parser->config.buffer_initial_size > 0) ? parser->config.buffer_initial_size : LIBJSON_DEFAULT_BUFFER_SIZE; if (parser->config.max_data > 0 && parser->buffer_size > parser->config.max_data) parser->buffer_size = parser->config.max_data; parser->buffer = (char *)parser_malloc(parser, parser->buffer_size * sizeof(char)); if (!parser->buffer) { parser_free(parser, parser->stack); return JSON_ERROR_NO_MEMORY; } return 0; } /** json_parser_free freed memory structure allocated by the parser */ int json_parser_free(json_parser *parser) { if (!parser) return 0; parser_free(parser, parser->stack); parser_free(parser, parser->buffer); parser->stack = NULL; parser->buffer = NULL; return 0; } /** json_parser_is_done return 0 is the parser isn't in a finish state. !0 if it is */ int json_parser_is_done(json_parser *parser) { /* need to compare the state to !GO to not accept empty document */ return parser->stack_offset == 0 && parser->state != STATE_GO; } /** json_parser_string append a string s with a specific length to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise. * the user can supplied a valid processed pointer that will * be fill with the number of processed characters before returning */ int json_parser_string(json_parser *parser, const char *s, uint32_t length, uint32_t *processed) { int ret; uint8_t next_class, next_state; uint32_t buffer_policy; uint32_t i; ret = 0; for (i = 0; i < length; i++) { unsigned char ch = s[i]; ret = 0; next_class = (uint8_t)((ch >= 128) ? C_OTHER : character_class[ch]); if (next_class == C_ERROR) { ret = JSON_ERROR_BAD_CHAR; break; } next_state = state_transition_table[parser->state][next_class]; buffer_policy = buffer_policy_table[parser->state][next_class]; if (next_state == STATE___) { ret = JSON_ERROR_UNEXPECTED_CHAR; break; } /* add char to buffer */ if (buffer_policy) { ret = (buffer_policy == 2) ? buffer_push_escape(parser, ch) : buffer_push(parser, ch); if (ret) break; } /* move to the next level */ if (IS_STATE_ACTION(next_state)) ret = do_action(parser, next_state); else parser->state = next_state; if (ret) break; } if (processed) *processed = i; return ret; } /** json_parser_char append one single char to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise */ int json_parser_char(json_parser *parser, unsigned char ch) { return json_parser_string(parser, (char *) &ch, 1, NULL); } parser-3.4.3/src/lib/json/json.vcproj000644 000000 000000 00000007641 12233736717 017643 0ustar00rootwheel000000 000000 parser-3.4.3/src/lib/json/Makefile.am000644 000000 000000 00000000240 12233734064 017456 0ustar00rootwheel000000 000000 INCLUDES = -I../../include -I../gc/include noinst_HEADERS = pa_json.h noinst_LTLIBRARIES = libjson.la libjson_la_SOURCES = pa_json.C EXTRA_DIST = json.vcproj parser-3.4.3/src/lib/json/pa_json.h000644 000000 000000 00000007547 12175542046 017247 0ustar00rootwheel000000 000000 /* * Copyright (C) 2009-2011 Vincent Hanquez * * This program 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; version 2.1 or version 3.0 only. * * 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. */ #ifndef JSON_H #define JSON_H #include "pa_config_includes.h" #ifdef __cplusplus extern "C" { #endif typedef enum { JSON_NONE, JSON_ARRAY_BEGIN, JSON_OBJECT_BEGIN, JSON_ARRAY_END, JSON_OBJECT_END, JSON_INT, JSON_FLOAT, JSON_STRING, JSON_KEY, JSON_TRUE, JSON_FALSE, JSON_NULL, } json_type; typedef enum { /* SUCCESS = 0 */ /* running out of memory */ JSON_ERROR_NO_MEMORY = 1, /* character < 32, except space newline tab */ JSON_ERROR_BAD_CHAR, /* trying to pop more object/array than pushed on the stack */ JSON_ERROR_POP_EMPTY, /* trying to pop wrong type of mode. popping array in object mode, vice versa */ JSON_ERROR_POP_UNEXPECTED_MODE, /* reach nesting limit on stack */ JSON_ERROR_NESTING_LIMIT, /* reach data limit on buffer */ JSON_ERROR_DATA_LIMIT, /* comment are not allowed with current configuration */ JSON_ERROR_COMMENT_NOT_ALLOWED, /* unexpected char in the current parser context */ JSON_ERROR_UNEXPECTED_CHAR, /* unicode low surrogate missing after high surrogate */ JSON_ERROR_UNICODE_MISSING_LOW_SURROGATE, /* unicode low surrogate missing without previous high surrogate */ JSON_ERROR_UNICODE_UNEXPECTED_LOW_SURROGATE, /* found a comma not in structure (array/object) */ JSON_ERROR_COMMA_OUT_OF_STRUCTURE, /* callback returns error */ JSON_ERROR_CALLBACK, } json_error; #define LIBJSON_DEFAULT_STACK_SIZE 256 #define LIBJSON_DEFAULT_BUFFER_SIZE 4096 typedef int (*json_parser_callback)(void *userdata, int type, const char *data, uint32_t length); typedef struct { uint32_t buffer_initial_size; uint32_t max_nesting; uint32_t max_data; int allow_c_comments; int allow_yaml_comments; void * (*user_malloc)(size_t size); void * (*user_realloc)(void *ptr, size_t size); void (*user_free)(void *ptr); } json_config; typedef struct json_parser { json_config config; /* SAJ callback */ json_parser_callback callback; void *userdata; /* parser state */ uint8_t state; uint8_t save_state; uint8_t expecting_key; uint16_t unicode_multi; json_type type; /* state stack */ uint8_t *stack; uint32_t stack_offset; uint32_t stack_size; /* parse buffer */ char *buffer; uint32_t buffer_size; uint32_t buffer_offset; } json_parser; /** json_parser_init initialize a parser structure taking a config, * a config and its userdata. * return JSON_ERROR_NO_MEMORY if memory allocation failed or SUCCESS. */ int json_parser_init(json_parser *parser, json_config *cfg, json_parser_callback callback, void *userdata); /** json_parser_free freed memory structure allocated by the parser */ int json_parser_free(json_parser *parser); /** json_parser_string append a string s with a specific length to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise. * the user can supplied a valid processed pointer that will * be fill with the number of processed characters before returning */ int json_parser_string(json_parser *parser, const char *string, uint32_t length, uint32_t *processed); /** json_parser_char append one single char to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise */ int json_parser_char(json_parser *parser, unsigned char next_char); /** json_parser_is_done return 0 is the parser isn't in a finish state. !0 if it is */ int json_parser_is_done(json_parser *parser); #ifdef __cplusplus } #endif #endif /* JSON_H */ parser-3.4.3/src/lib/curl/Makefile.in000644 000000 000000 00000030250 11766635215 017477 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/curl DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = curl.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/curl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/curl/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-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: parser-3.4.3/src/lib/curl/Makefile.am000644 000000 000000 00000000031 11744235623 017453 0ustar00rootwheel000000 000000 noinst_HEADERS = curl.h parser-3.4.3/src/lib/curl/curl.h000644 000000 000000 00000105266 12137312213 016541 0ustar00rootwheel000000 000000 #ifndef __CURL_CURL_H #define __CURL_CURL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id: curl.h,v 1.4 2013/04/28 21:28:43 moko Exp $ ***************************************************************************/ /* * If you have libcurl problems, all docs and details are found here: * http://curl.haxx.se/libcurl/ * * curl-library mailing list subscription and unsubscription web interface: * http://cool.haxx.se/mailman/listinfo/curl-library/ */ typedef struct CURL CURL; typedef enum { CURLE_OK = 0, CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ CURLE_URL_MALFORMAT, /* 3 */ CURLE_OBSOLETE4, /* 4 - NOT USED */ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ CURLE_COULDNT_RESOLVE_HOST, /* 6 */ CURLE_COULDNT_CONNECT, /* 7 */ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server due to lack of access - when login fails this is not returned. */ CURLE_OBSOLETE10, /* 10 - NOT USED */ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ CURLE_OBSOLETE12, /* 12 - NOT USED */ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ CURLE_FTP_CANT_GET_HOST, /* 15 */ CURLE_OBSOLETE16, /* 16 - NOT USED */ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ CURLE_PARTIAL_FILE, /* 18 */ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ CURLE_OBSOLETE20, /* 20 - NOT USED */ CURLE_QUOTE_ERROR, /* 21 - quote command failure */ CURLE_HTTP_RETURNED_ERROR, /* 22 */ CURLE_WRITE_ERROR, /* 23 */ CURLE_OBSOLETE24, /* 24 - NOT USED */ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ CURLE_OUT_OF_MEMORY, /* 27 */ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error instead of a memory allocation error if CURL_DOES_CONVERSIONS is defined */ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ CURLE_OBSOLETE29, /* 29 - NOT USED */ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ CURLE_OBSOLETE32, /* 32 - NOT USED */ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ CURLE_HTTP_POST_ERROR, /* 34 */ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ CURLE_FILE_COULDNT_READ_FILE, /* 37 */ CURLE_LDAP_CANNOT_BIND, /* 38 */ CURLE_LDAP_SEARCH_FAILED, /* 39 */ CURLE_OBSOLETE40, /* 40 - NOT USED */ CURLE_FUNCTION_NOT_FOUND, /* 41 */ CURLE_ABORTED_BY_CALLBACK, /* 42 */ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ CURLE_OBSOLETE44, /* 44 - NOT USED */ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ CURLE_OBSOLETE46, /* 46 - NOT USED */ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ CURLE_OBSOLETE50, /* 50 - NOT USED */ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint wasn't verified fine */ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */ CURLE_SEND_ERROR, /* 55 - failed sending network data */ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ CURLE_OBSOLETE57, /* 57 - NOT IN USE */ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind that failed */ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not accepted and we failed to login */ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ CURLE_TFTP_PERM, /* 69 - permission problem on server */ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ CURLE_CONV_FAILED, /* 75 - conversion failed */ CURLE_CONV_REQD, /* 76 - caller must register conversion callbacks using curl_easy_setopt options CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and CURLOPT_CONV_FROM_UTF8_FUNCTION */ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing or wrong format */ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ CURLE_SSH, /* 79 - error from the SSH layer, somewhat generic so the error message will be of interest when this has happened */ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL connection */ CURLE_AGAIN, /* 81 - socket is not ready for send/recv, wait till it's ready and try again (Added in 7.18.2) */ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or wrong format (Added in 7.19.0) */ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in 7.19.0) */ CURL_LAST /* never use! */ } CURLcode; /* long may be 32 or 64 bits, but we should never depend on anything else but 32 */ #define CURLOPTTYPE_LONG 0 #define CURLOPTTYPE_OBJECTPOINT 10000 #define CURLOPTTYPE_FUNCTIONPOINT 20000 #define CURLOPTTYPE_OFF_T 30000 /* name is uppercase CURLOPT_, type is one of the defined CURLOPTTYPE_ number is unique identifier */ #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number /* * This macro-mania below setups the CURLOPT_[what] enum, to be used with * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] * word. */ typedef enum { /* This is the FILE * or void * the regular output should be written to. */ CINIT(FILE, OBJECTPOINT, 1), /* The full URL to get/put */ CINIT(URL, OBJECTPOINT, 2), /* Port number to connect to, if other than default. */ CINIT(PORT, LONG, 3), /* Name of proxy to use. */ CINIT(PROXY, OBJECTPOINT, 4), /* "name:password" to use when fetching. */ CINIT(USERPWD, OBJECTPOINT, 5), /* "name:password" to use with proxy. */ CINIT(PROXYUSERPWD, OBJECTPOINT, 6), /* Range to get, specified as an ASCII string. */ CINIT(RANGE, OBJECTPOINT, 7), /* not used */ /* Specified file stream to upload from (use as input): */ CINIT(INFILE, OBJECTPOINT, 9), /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE * bytes big. If this is not used, error messages go to stderr instead: */ CINIT(ERRORBUFFER, OBJECTPOINT, 10), /* Function that will be called to store the output (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), /* Function that will be called to read the input (instead of fread). The * parameters will use fread() syntax, make sure to follow them. */ CINIT(READFUNCTION, FUNCTIONPOINT, 12), /* Time-out the read operation after this amount of seconds */ CINIT(TIMEOUT, LONG, 13), /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about * how large the file being sent really is. That allows better error * checking and better verifies that the upload was successful. -1 means * unknown size. * * For large file support, there is also a _LARGE version of the key * which takes an off_t type, allowing platforms with larger off_t * sizes to handle larger files. See below for INFILESIZE_LARGE. */ CINIT(INFILESIZE, LONG, 14), /* POST static input fields. */ CINIT(POSTFIELDS, OBJECTPOINT, 15), /* Set the referrer page (needed by some CGIs) */ CINIT(REFERER, OBJECTPOINT, 16), /* Set the FTP PORT string (interface name, named or numerical IP address) Use i.e '-' to use default address. */ CINIT(FTPPORT, OBJECTPOINT, 17), /* Set the User-Agent string (examined by some CGIs) */ CINIT(USERAGENT, OBJECTPOINT, 18), /* If the download receives less than "low speed limit" bytes/second * during "low speed time" seconds, the operations is aborted. * You could i.e if you have a pretty high speed connection, abort if * it is less than 2000 bytes/sec during 20 seconds. */ /* Set the "low speed limit" */ CINIT(LOW_SPEED_LIMIT, LONG, 19), /* Set the "low speed time" */ CINIT(LOW_SPEED_TIME, LONG, 20), /* Set the continuation offset. * * Note there is also a _LARGE version of this key which uses * off_t types, allowing for large file offsets on platforms which * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. */ CINIT(RESUME_FROM, LONG, 21), /* Set cookie in request: */ CINIT(COOKIE, OBJECTPOINT, 22), /* This points to a linked list of headers, struct curl_slist kind */ CINIT(HTTPHEADER, OBJECTPOINT, 23), /* This points to a linked list of post entries, struct curl_httppost */ CINIT(HTTPPOST, OBJECTPOINT, 24), /* name of the file keeping your private SSL-certificate */ CINIT(SSLCERT, OBJECTPOINT, 25), /* password for the SSL or SSH private key */ CINIT(KEYPASSWD, OBJECTPOINT, 26), /* send TYPE parameter? */ CINIT(CRLF, LONG, 27), /* send linked-list of QUOTE commands */ CINIT(QUOTE, OBJECTPOINT, 28), /* send FILE * or void * to store headers to, if you use a callback it is simply passed to the callback unmodified */ CINIT(WRITEHEADER, OBJECTPOINT, 29), /* point to a file to read the initial cookies from, also enables "cookie awareness" */ CINIT(COOKIEFILE, OBJECTPOINT, 31), /* What version to specifically try to use. See CURL_SSLVERSION defines below. */ CINIT(SSLVERSION, LONG, 32), /* What kind of HTTP time condition to use, see defines */ CINIT(TIMECONDITION, LONG, 33), /* Time to use with the above condition. Specified in number of seconds since 1 Jan 1970 */ CINIT(TIMEVALUE, LONG, 34), /* 35 = OBSOLETE */ /* Custom request, for customizing the get command like HTTP: DELETE, TRACE and others FTP: to use a different list command */ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), /* HTTP request, for odd commands like DELETE, TRACE and others */ CINIT(STDERR, OBJECTPOINT, 37), /* 38 is not used */ /* send linked-list of post-transfer QUOTE commands */ CINIT(POSTQUOTE, OBJECTPOINT, 39), /* Pass a pointer to string of the output using full variable-replacement as described elsewhere. */ CINIT(WRITEINFO, OBJECTPOINT, 40), CINIT(VERBOSE, LONG, 41), /* talk a lot */ CINIT(HEADER, LONG, 42), /* throw the header out too */ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ CINIT(UPLOAD, LONG, 46), /* this is an upload */ CINIT(POST, LONG, 47), /* HTTP POST method */ CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ /* Specify whether to read the user+password from the .netrc or the URL. * This must be one of the CURL_NETRC_* enums below. */ CINIT(NETRC, LONG, 51), CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ CINIT(PUT, LONG, 54), /* HTTP PUT */ /* 55 = OBSOLETE */ /* Function that will be called instead of the internal progress display * function. This function should be defined as the curl_progress_callback * prototype defines. */ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), /* Data passed to the progress callback */ CINIT(PROGRESSDATA, OBJECTPOINT, 57), /* We want the referrer field set automatically when following locations */ CINIT(AUTOREFERER, LONG, 58), /* Port of the proxy, can be set in the proxy string as well with: "[host]:[port]" */ CINIT(PROXYPORT, LONG, 59), /* size of the POST input data, if strlen() is not good to use */ CINIT(POSTFIELDSIZE, LONG, 60), /* tunnel non-http operations through a HTTP proxy */ CINIT(HTTPPROXYTUNNEL, LONG, 61), /* Set the interface string to use as outgoing network interface */ CINIT(INTERFACE, OBJECTPOINT, 62), /* Set the krb4/5 security level, this also enables krb4/5 awareness. This * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string * is set but doesn't match one of these, 'private' will be used. */ CINIT(KRBLEVEL, OBJECTPOINT, 63), /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ CINIT(SSL_VERIFYPEER, LONG, 64), /* The CApath or CAfile used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAINFO, OBJECTPOINT, 65), /* 66 = OBSOLETE */ /* 67 = OBSOLETE */ /* Maximum number of http redirects to follow */ CINIT(MAXREDIRS, LONG, 68), /* Pass a long set to 1 to get the date of the requested document (if possible)! Pass a zero to shut it off. */ CINIT(FILETIME, LONG, 69), /* This points to a linked list of telnet options */ CINIT(TELNETOPTIONS, OBJECTPOINT, 70), /* Max amount of cached alive connections */ CINIT(MAXCONNECTS, LONG, 71), /* What policy to use when closing connections when the cache is filled up */ CINIT(CLOSEPOLICY, LONG, 72), /* 73 = OBSOLETE */ /* Set to explicitly use a new connection for the upcoming transfer. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FRESH_CONNECT, LONG, 74), /* Set to explicitly forbid the upcoming transfer's connection to be re-used when done. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FORBID_REUSE, LONG, 75), /* Set to a file name that contains random data for libcurl to use to seed the random engine when doing SSL connects. */ CINIT(RANDOM_FILE, OBJECTPOINT, 76), /* Set to the Entropy Gathering Daemon socket pathname */ CINIT(EGDSOCKET, OBJECTPOINT, 77), /* Time-out connect operations after this amount of seconds, if connects are OK within this time, then fine... This only aborts the connect phase. [Only works on unix-style/SIGALRM operating systems] */ CINIT(CONNECTTIMEOUT, LONG, 78), /* Function that will be called to store headers (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), /* Set this to force the HTTP request to get back to GET. Only really usable if POST, PUT or a custom request have been used first. */ CINIT(HTTPGET, LONG, 80), /* Set if we should verify the Common name from the peer certificate in ssl * handshake, set 1 to check existence, 2 to ensure that it matches the * provided hostname. */ CINIT(SSL_VERIFYHOST, LONG, 81), /* Specify which file name to write all known cookies in after completed operation. Set file name to "-" (dash) to make it go to stdout. */ CINIT(COOKIEJAR, OBJECTPOINT, 82), /* Specify which SSL ciphers to use */ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), /* Specify which HTTP version to use! This must be set to one of the CURL_HTTP_VERSION* enums set below. */ CINIT(HTTP_VERSION, LONG, 84), /* Specifically switch on or off the FTP engine's use of the EPSV command. By default, that one will always be attempted before the more traditional PASV command. */ CINIT(FTP_USE_EPSV, LONG, 85), /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ CINIT(SSLCERTTYPE, OBJECTPOINT, 86), /* name of the file keeping your private SSL-key */ CINIT(SSLKEY, OBJECTPOINT, 87), /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ CINIT(SSLKEYTYPE, OBJECTPOINT, 88), /* crypto engine for the SSL-sub system */ CINIT(SSLENGINE, OBJECTPOINT, 89), /* set the crypto engine for the SSL-sub system as default the param has no meaning... */ CINIT(SSLENGINE_DEFAULT, LONG, 90), /* Non-zero value means to use the global dns cache */ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */ /* DNS cache timeout */ CINIT(DNS_CACHE_TIMEOUT, LONG, 92), /* send linked-list of pre-transfer QUOTE commands */ CINIT(PREQUOTE, OBJECTPOINT, 93), /* set the debug function */ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), /* set the data for the debug function */ CINIT(DEBUGDATA, OBJECTPOINT, 95), /* mark this as start of a cookie session */ CINIT(COOKIESESSION, LONG, 96), /* The CApath directory used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAPATH, OBJECTPOINT, 97), /* Instruct libcurl to use a smaller receive buffer */ CINIT(BUFFERSIZE, LONG, 98), /* Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information. */ CINIT(NOSIGNAL, LONG, 99), /* Provide a CURLShare for mutexing non-ts data */ CINIT(SHARE, OBJECTPOINT, 100), /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ CINIT(PROXYTYPE, LONG, 101), /* Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. */ CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), /* Set pointer to private data */ CINIT(PRIVATE, OBJECTPOINT, 103), /* Set aliases for HTTP 200 in the HTTP Response header */ CINIT(HTTP200ALIASES, OBJECTPOINT, 104), /* Continue to send authentication (user+password) when following locations, even when hostname changed. This can potentially send off the name and password to whatever host the server decides. */ CINIT(UNRESTRICTED_AUTH, LONG, 105), /* Specifically switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. */ CINIT(FTP_USE_EPRT, LONG, 106), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(HTTPAUTH, LONG, 107), /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx in second argument. The function must be matching the curl_ssl_ctx_callback proto. */ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), /* Set the userdata for the ssl context callback function's third argument */ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), /* FTP Option that causes missing dirs to be created on the remote server. In 7.19.4 we introduced the convenience enums for this option using the CURLFTP_CREATE_DIR prefix. */ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(PROXYAUTH, LONG, 111), /* FTP option that changes the timeout, in seconds, associated with getting a response. This is different from transfer timeout time and essentially places a demand on the FTP server to acknowledge commands in a timely manner. */ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to tell libcurl to resolve names to those IP versions only. This only has affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ CINIT(IPRESOLVE, LONG, 113), /* Set this option to limit the size of a file that will be downloaded from an HTTP or FTP server. Note there is also _LARGE version which adds large file support for platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ CINIT(MAXFILESIZE, LONG, 114), /* See the comment for INFILESIZE above, but in short, specifies * the size of the file being uploaded. -1 means unknown. */ CINIT(INFILESIZE_LARGE, OFF_T, 115), /* Sets the continuation offset. There is also a LONG version of this; * look above for RESUME_FROM. */ CINIT(RESUME_FROM_LARGE, OFF_T, 116), /* Sets the maximum size of data that will be downloaded from * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. */ CINIT(MAXFILESIZE_LARGE, OFF_T, 117), /* Set this option to the file name of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there. */ CINIT(NETRC_FILE, OBJECTPOINT, 118), /* Enable SSL/TLS for FTP, pick one of: CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise CURLFTPSSL_CONTROL - SSL for the control connection or fail CURLFTPSSL_ALL - SSL for all communication or fail */ CINIT(USE_SSL, LONG, 119), /* The _LARGE version of the standard POSTFIELDSIZE option */ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), /* Enable/disable the TCP Nagle algorithm */ CINIT(TCP_NODELAY, LONG, 121), /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 123 OBSOLETE. Gone in 7.16.0 */ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 127 OBSOLETE. Gone in 7.16.0 */ /* 128 OBSOLETE. Gone in 7.16.0 */ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option can be used to change libcurl's default action which is to first try "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK response has been received. Available parameters are: CURLFTPAUTH_DEFAULT - let libcurl decide CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL */ CINIT(FTPSSLAUTH, LONG, 129), CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), CINIT(IOCTLDATA, OBJECTPOINT, 131), /* 132 OBSOLETE. Gone in 7.16.0 */ /* 133 OBSOLETE. Gone in 7.16.0 */ /* zero terminated string for pass on to the FTP server when asked for "account" info */ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), /* feed cookies into cookie engine */ CINIT(COOKIELIST, OBJECTPOINT, 135), /* ignore Content-Length */ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), /* Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection. */ CINIT(FTP_SKIP_PASV_IP, LONG, 137), /* Select "file method" to use when doing FTP, see the curl_ftpmethod above. */ CINIT(FTP_FILEMETHOD, LONG, 138), /* Local port number to bind the socket to */ CINIT(LOCALPORT, LONG, 139), /* Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first. */ CINIT(LOCALPORTRANGE, LONG, 140), /* no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET */ CINIT(CONNECT_ONLY, LONG, 141), /* Function that will be called to convert from the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), /* Function that will be called to convert to the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), /* Function that will be called to convert from UTF8 (instead of using the iconv calls in libcurl) Note that this is used only for SSL certificate processing */ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), /* if the connection proceeds too quickly then need to slow it down */ /* limit-rate: maximum number of bytes per second to send or receive */ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), /* Pointer to command string to send if USER/PASS fails. */ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), /* callback function for setting socket options */ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), CINIT(SOCKOPTDATA, OBJECTPOINT, 149), /* set to 0 to disable session ID re-use for this transfer, default is enabled (== 1) */ CINIT(SSL_SESSIONID_CACHE, LONG, 150), /* allowed SSH authentication methods */ CINIT(SSH_AUTH_TYPES, LONG, 151), /* Used by scp/sftp to do public/private key authentication */ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), /* Send CCC (Clear Command Channel) after authentication */ CINIT(FTP_SSL_CCC, LONG, 154), /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ CINIT(TIMEOUT_MS, LONG, 155), CINIT(CONNECTTIMEOUT_MS, LONG, 156), /* set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed */ CINIT(HTTP_TRANSFER_DECODING, LONG, 157), CINIT(HTTP_CONTENT_DECODING, LONG, 158), /* Permission used when creating new files and directories on the remote server for protocols that support it, SFTP/SCP/FILE */ CINIT(NEW_FILE_PERMS, LONG, 159), CINIT(NEW_DIRECTORY_PERMS, LONG, 160), /* Set the behaviour of POST when redirecting. Values must be set to one of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ CINIT(POSTREDIR, LONG, 161), /* used by scp/sftp to verify the host's public key */ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), /* Callback function for opening socket (instead of socket(2)). Optionally, callback is able change the address or refuse to connect returning CURL_SOCKET_BAD. The callback should have type curl_opensocket_callback */ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), /* POST volatile input fields. */ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ CINIT(PROXY_TRANSFER_MODE, LONG, 166), /* Callback function for seeking in the input stream */ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), CINIT(SEEKDATA, OBJECTPOINT, 168), /* CRL file */ CINIT(CRLFILE, OBJECTPOINT, 169), /* Issuer certificate */ CINIT(ISSUERCERT, OBJECTPOINT, 170), /* (IPv6) Address scope */ CINIT(ADDRESS_SCOPE, LONG, 171), /* Collect certificate chain info and allow it to get retrievable with CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only working with OpenSSL-powered builds. */ CINIT(CERTINFO, LONG, 172), /* "name" and "pwd" to use when fetching. */ CINIT(USERNAME, OBJECTPOINT, 173), CINIT(PASSWORD, OBJECTPOINT, 174), /* "name" and "pwd" to use with Proxy when fetching. */ CINIT(PROXYUSERNAME, OBJECTPOINT, 175), CINIT(PROXYPASSWORD, OBJECTPOINT, 176), /* Comma separated list of hostnames defining no-proxy zones. These should match both hostnames directly, and hostnames within a domain. For example, local.com will match local.com and www.local.com, but NOT notlocal.com or www.notlocal.com. For compatibility with other implementations of this, .local.com will be considered to be the same as local.com. A single * is the only valid wildcard, and effectively disables the use of proxy. */ CINIT(NOPROXY, OBJECTPOINT, 177), /* block size for TFTP transfers */ CINIT(TFTP_BLKSIZE, LONG, 178), /* Socks Service */ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), /* Socks Service */ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), /* set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other external inputs and want to restrict what protocol(s) to deal with. Defaults to CURLPROTO_ALL. */ CINIT(PROTOCOLS, LONG, 181), /* set the bitmask for the protocols that libcurl is allowed to follow to, as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs to be set in both bitmasks to be allowed to get redirected to. Defaults to all protocols except FILE and SCP. */ CINIT(REDIR_PROTOCOLS, LONG, 182), /* set the SSH knownhost file name to use */ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), /* set the SSH host key callback, must point to a curl_sshkeycallback function */ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), /* set the SSH host key callback custom pointer */ CINIT(SSH_KEYDATA, OBJECTPOINT, 185), CURLOPT_LASTENTRY /* the last unused */ } CURLoption; /* compatibility with older names */ #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING /* three convenient "aliases" that follow the name scheme better */ #define CURLOPT_WRITEDATA CURLOPT_FILE #define CURLOPT_READDATA CURLOPT_INFILE #define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER #define CFINIT(name) CURLFORM_ ## name typedef enum { CFINIT(NOTHING), /********* the first one is unused ************/ /* */ CFINIT(COPYNAME), CFINIT(PTRNAME), CFINIT(NAMELENGTH), CFINIT(COPYCONTENTS), CFINIT(PTRCONTENTS), CFINIT(CONTENTSLENGTH), CFINIT(FILECONTENT), CFINIT(ARRAY), CFINIT(OBSOLETE), CFINIT(FILE), CFINIT(BUFFER), CFINIT(BUFFERPTR), CFINIT(BUFFERLENGTH), CFINIT(CONTENTTYPE), CFINIT(CONTENTHEADER), CFINIT(FILENAME), CFINIT(END), CFINIT(OBSOLETE2), CFINIT(STREAM), CURLFORM_LASTENTRY /* the last unused */ } CURLformoption; #define CURLINFO_STRING 0x100000 #define CURLINFO_LONG 0x200000 #define CURLINFO_DOUBLE 0x300000 #define CURLINFO_SLIST 0x400000 #define CURLINFO_MASK 0x0fffff #define CURLINFO_TYPEMASK 0xf00000 typedef enum { CURLINFO_NONE, /* first, never use this */ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, CURLINFO_FILETIME = CURLINFO_LONG + 14, CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, CURLINFO_PRIVATE = CURLINFO_STRING + 21, CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, CURLINFO_CERTINFO = CURLINFO_SLIST + 34, CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, /* Fill in new entries below here! */ CURLINFO_LASTONE = 35 } CURLINFO; #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP versions that your system allows */ #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ typedef enum { CURL_FORMADD_OK, /* first, no error */ CURL_FORMADD_MEMORY, CURL_FORMADD_OPTION_TWICE, CURL_FORMADD_NULL, CURL_FORMADD_UNKNOWN_OPTION, CURL_FORMADD_INCOMPLETE, CURL_FORMADD_ILLEGAL_ARRAY, CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ CURL_FORMADD_LAST /* last */ } CURLFORMcode; #endif /* __CURL_CURL_H */ parser-3.4.3/src/lib/gd/gif.h000644 000000 000000 00000015213 11730603273 015765 0ustar00rootwheel000000 000000 /** @file Parser: image manipulations decls. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) based on: gd.h: declarations file for the gifdraw module. Written by Tom Boutell, 5/94. Copyright 1994, Cold Spring Harbor Labs. Permission granted to use this code in any fashion provided that this notice is retained and any alterations are labeled as such. It is requested, but not required, that you share extensions to this module with us so that we can incorporate them into new versions. */ #ifndef GIF_H #define GIF_H #define IDENT_GIF_H "$Id: gif.h,v 1.5 2012/03/16 09:24:11 moko Exp $" #include "pa_config_includes.h" #include "pa_memory.h" #define gdMaxColors 0x100 #define HSIZE 5003 /* 80% occupancy */ struct gdBuf { void *ptr; size_t size; gdBuf(void *aptr, size_t asize): ptr(aptr), size(asize) {} }; class gdGrowingBuf: PA_Object { unsigned char *fptr; size_t fallocated; size_t fused; void expand(size_t delta) { size_t new_allocated=fallocated+delta; fptr=(unsigned char*)realloc(fptr, new_allocated); fallocated=new_allocated; } public: operator gdBuf() { return gdBuf(fptr, fused); } gdGrowingBuf(): fptr(0), fallocated(0), fused(0) {} void append(unsigned char *abuf, size_t asize) { ssize_t delta=asize-(fallocated-fused); if(delta>0) expand(delta+100); memcpy(&fptr[fused], abuf, asize); fused+=asize; } }; /** Image type. See functions below; you will not need to change the elements directly. Use the provided macros to access sx, sy, the color table, and colorsTotal for read-only purposes. */ class gdImage: public PA_Object { public: //@{ /// @name Functions to manipulate images void Create(int asx, int asy); bool CreateFromGif(FILE *fd); void SetPixel(int x, int y, int color); int GetPixel(int x, int y); void Line(int x1, int y1, int x2, int y2, int color); void StyledLine(int x1, int y1, int x2, int y2, int color, const char* lineStyle); void Rectangle(int x1, int y1, int x2, int y2, int color); void LineReplaceColor(int x1, int y1, int x2, int y2, int a, int b); void FilledRectangle(int x1, int y1, int x2, int y2, int color); //@} /// Point type for use in polygon drawing. struct Point { int x, y; }; void Polygon(Point *p, int n, int c, bool closed=true); void FilledPolygon(Point *p, int n, int c); void FilledPolygonReplaceColor(Point *p, int n, int a, int b); int ColorAllocate(int r, int g, int b); int ColorClosest(int r, int g, int b, int tolerance=0); int ColorExact(int r, int g, int b); int ColorRGB(int r, int g, int b); int Color(unsigned int rgb); unsigned int DecodeColor(int color); void ColorDeallocate(int color); void SetColorTransparent(int color); int BoundsSafe(int x, int y); void DoSetPixel(int x, int y, int color); gdBuf Gif(); void Arc(int cx, int cy, int w, int h, int s, int e, int color); void Sector(int cx, int cy, int w, int h, int s, int e, int color); void FillToBorder(int x, int y, int border, int color); void Fill(int x, int y, int color); void Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h); void CopyResampled(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH, int tolerance); void SetLineWidth(int width); void SetLineStyle(const char* aLineStyle); void SetInterlace(int interlaceArg); /* On or off(1 or 0) */ public: //@{ /// @name information about image. READ ONLY int SX() { return sx; } int SY() { return sy; } int ColorsTotal() { return colorsTotal; } int Red(int c) { return red[c]; } int Green(int c) { return green[c]; } int Blue(int c) { return blue[c]; } int GetTransparent() { return transparent; } int GetInterlaced() { return interlace; } //@} private: unsigned char ** pixels; int sx; int sy; int colorsTotal; int red[gdMaxColors]; int green[gdMaxColors]; int blue[gdMaxColors]; int open[gdMaxColors]; int transparent; int *polyInts; int polyAllocated; int lineWidth; const char* lineStyle; int interlace; private: // read gif int GetDataBlock(FILE *fd, unsigned char *buf); int LWZReadByte(FILE *fd, int flag, int input_code_size); void ReadImage(FILE *fd, int len, int height, unsigned char(*cmap)[256], int interlace, int ignore); int DoExtension(FILE *fd, int label, int *Transparent); int GetCode(FILE *fd, int code_size, int flag); private: // read gif int ZeroDataBlock; }; /// used by gdImage::Gif to produce buffer with bytes in GIF format class gdGifEncoder: public PA_Object { public: gdGifEncoder(gdImage& aim); gdBuf encode( int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue); private: /// a code_int must be able to hold 2**GIFBITS values of type int, and also -1 typedef int code_int; #ifdef SIGNED_COMPARE_SLOW typedef unsigned long int count_int; typedef unsigned short int count_short; #else typedef long int count_int; #endif private: void Putbyte(unsigned char c); void Putword(int w); void Write(void *buf, size_t size); void prepare_encoder(void); void BumpPixel(void); int GIFNextPixel(); void compress(int init_bits); void output(code_int code); void cl_block(void); void cl_hash(count_int hsize); void char_init(void); void char_out(int c); void flush_char(void); private: gdImage& im; gdGrowingBuf buf; int Width, Height; int curx, cury; long CountDown; int Pass; int Interlace; int g_init_bits; int ClearCode; int EOFCode; int n_bits; /* number of bits/code */ int maxbits; /* user settable max # bits/code */ code_int maxcode; /* maximum code, given n_bits */ code_int maxmaxcode; /* should NEVER generate this code */ count_int htab [HSIZE]; unsigned short codetab [HSIZE]; code_int hsize; /* for dynamic table sizing */ code_int free_ent; /* first unused entry */ /* * block compression parameters -- after all codes are used up, * and compression rate changes, start over. */ int clear_flg; int offset; long int in_count; /* length of input */ long int out_count; /* # of codes output(for debugging) */ unsigned long cur_accum; int cur_bits; /* * Number of characters so far in this 'packet' */ int a_count; /* * Define the storage for the packet accumulator */ char accum[ 256 ]; }; inline int gdImage::BoundsSafe(int x, int y){ return(!(((y < 0) ||(y >= sy)) ||((x < 0) ||(x >= sx)))); } inline /*paf int*/void gdImage::DoSetPixel(int x, int y, int color){ if(BoundsSafe(x, y)) pixels[x][y] = (unsigned char)color; } #endif parser-3.4.3/src/lib/gd/gif.C000644 000000 000000 00000052640 11730603273 015725 0ustar00rootwheel000000 000000 /** @file Parser: image manipulations impl1. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) based on: gd Written by Tom Boutell, 5/94. Copyright 1994, Cold Spring Harbor Labs. Permission granted to use this code in any fashion provided that this notice is retained and any alterations are labeled as such. It is requested, but not required, that you share extensions to this module with us so that we can incorporate them into new versions. */ #include "gif.h" #include "mtables.h" volatile const char * IDENT_GIF_C="$Id: gif.C,v 1.7 2012/03/16 09:24:11 moko Exp $" IDENT_GIF_H; //static void BrushApply(int x, int y); //static void TileApply(int x, int y); void gdImage::Create(int asx, int asy) { sx = asx; sy = asy; int i; pixels = (unsigned char **) malloc(sizeof(unsigned char *) * sx); polyInts = 0; polyAllocated = 0; lineWidth = 1; for (i=0; (i>8, r=g>>8; return ColorRGB(r & 0xFF,g & 0xFF,b & 0xFF); } unsigned int gdImage::DecodeColor(int color) { if(color<0) return color; return (((red[color]<<8) + green[color])<<8)+blue[color]; } void gdImage::ColorDeallocate(int color) { /* Mark it open. */ open[color] = 1; } void gdImage::SetColorTransparent(int color) { transparent = color; } void gdImage::SetPixel(int x, int y, int color) { //paf int p; switch (lineWidth){ case 1: { DoSetPixel(x, y,color); return; } case 2: { DoSetPixel(x, y-1,color); DoSetPixel(x-1, y,color); DoSetPixel(x, y,color); DoSetPixel(x+1, y,color); DoSetPixel(x, y+1,color); return; } default:{ int i,j; for (i=-1;i<=1;i++) DoSetPixel(x+i, y-2,color); for (j=-1;j<=1;j++) for (i=-2;i<=2;i++) DoSetPixel(x+i, y+j,color); for (i=-1;i<=1;i++) DoSetPixel(x+i, y+2,color); return; } } } int gdImage::GetPixel(int x, int y) { return BoundsSafe(x, y) ? pixels[x][y]:-1; } /* Bresenham as presented in Foley & Van Dam */ /* As above, plus dashing */ #define styledSet \ { \ if (lineStyle) { \ if(!lineStyle[styleStep]) \ styleStep = 0; \ on=lineStyle[styleStep++]!=' '; \ } \ if (on) { \ SetPixel(x, y, color); \ } \ } void gdImage::Line(int x1, int y1, int x2, int y2, int color) { int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; int styleStep = 0; int on = 1; dx = abs(x2-x1); dy = abs(y2-y1); if (dy <= dx) { d = 2*dy - dx; incr1 = 2*dy; incr2 = 2 * (dy - dx); if (x1 > x2) { x = x2; y = y2; ydirflag = (-1); xend = x1; } else { x = x1; y = y1; ydirflag = 1; xend = x2; } styledSet; if (((y2 - y1) * ydirflag) > 0) { while (x < xend) { x++; if (d <0) { d+=incr1; } else { y++; d+=incr2; } styledSet; } } else { while (x < xend) { x++; if (d <0) { d+=incr1; } else { y--; d+=incr2; } styledSet; } } } else { d = 2*dx - dy; incr1 = 2*dx; incr2 = 2 * (dx - dy); if (y1 > y2) { y = y2; x = x2; yend = y1; xdirflag = (-1); } else { y = y1; x = x1; yend = y2; xdirflag = 1; } styledSet; if (((x2 - x1) * xdirflag) > 0) { while (y < yend) { y++; if (d <0) { d+=incr1; } else { x++; d+=incr2; } styledSet; } } else { while (y < yend) { y++; if (d <0) { d+=incr1; } else { x--; d+=incr2; } styledSet; } } } } /* s and e are integers modulo 360 (degrees), with 0 degrees being the rightmost extreme and degrees changing clockwise. cx and cy are the center in pixels; w and h are the horizontal and vertical diameter in pixels. Nice interface, but slow, since I don't yet use Bresenham (I'm using an inefficient but simple solution with too much work going on in it; generalizing Bresenham to ellipses and partial arcs of ellipses is non-trivial, at least for me) and there are other inefficiencies (small circles do far too much work). */ void gdImage::Arc(int cx, int cy, int w, int h, int s, int e, int color) { #if 0 if(s==0 && e==360) { // full if(w==h) { // circle? /* Bresenham octant code, which I should use eventually */ int x, y, d; x = 0; y = w/2; d = 3-w; while (x <= y) { SetPixel(cx+x, cy+y, color); SetPixel(cx+x, cy-y, color); SetPixel(cx-x, cy+y, color); SetPixel(cx-x, cy-y, color); SetPixel(cx+y, cy+x, color); SetPixel(cx+y, cy-x, color); SetPixel(cx-y, cy+x, color); SetPixel(cx-y, cy-x, color); if (d < 0) { d += 4 * x + 6; } else { d += 4 * (x - y) + 10; y--; } x++; } } else { // full ellipse w/=2; h/=2; int elx, ely; long aa, aa2, bb, bb2, d, dx, dy; elx = 0; ely = h; aa = (long)w * w; aa2 = 2 * aa; bb = (long)h * h; bb2 = 2 * bb; d = bb - aa * h + aa/4; dx = 0; dy = aa2 * h; SetPixel(cx, cy - ely, color); SetPixel(cx, cy + ely, color); SetPixel(cx - w, cy, color); SetPixel(cx + w, cy, color); while (dx < dy) { if (d > 0) { ely--; dy-=aa2; d-=dy;} elx++; dx+=bb2; d+=bb+dx; SetPixel(cx + elx, cy + ely, color); SetPixel(cx - elx, cy + ely, color); SetPixel(cx + elx, cy - ely, color); SetPixel(cx - elx, cy - ely, color); }; d+=(3 * (aa - bb)/2 - (dx + dy))/2; while (ely > 0) { if (d < 0) {elx++; dx+=bb2; d+=bb + dx;} ely--; dy-=aa2; d+=aa - dy; SetPixel(cx + elx, cy + ely, color); SetPixel(cx - elx, cy + ely, color); SetPixel(cx + elx, cy - ely, color); SetPixel(cx - elx, cy - ely, color); }; } } else { #endif int i; int lx = 0, ly = 0; int w2, h2; w2 = w/2; h2 = h/2; while (e < s) e += 360; // paf while(s<0) s+=360; while(s>360) s-=360; while(e<0) e+=360; while(e>360) e-=360; for (i=s; (i <= e); i++) { int x, y; x = ((long)cost[i] * (long)w2 / costScale) + cx; y = ((long)sint[i] * (long)h2 / sintScale) + cy; if (i != s) { Line(lx, ly, x, y, color); } lx = x; ly = y; } #if 0 } #endif } /* // http://firststeps.narod.ru/cgi/18.html int CGIScreen::Ellipse(int exc, int eyc, int ea, int eb , unsigned char Color) { int elx, ely; long aa, aa2, bb, bb2, d, dx, dy; elx = 0; ely = eb; aa = (long)ea * ea; aa2 = 2 * aa; bb = (long)eb * eb; bb2 = 2 * bb; d = bb - aa * eb + aa/4; dx = 0; dy = aa2 * eb; PutPixel(exc, eyc - ely, Color); PutPixel(exc, eyc + ely, Color); PutPixel(exc - ea, eyc, Color); PutPixel(exc + ea, eyc, Color); while (dx < dy) { if (d > 0) { ely--; dy-=aa2; d-=dy;} elx++; dx+=bb2; d+=bb+dx; PutPixel(exc + elx, eyc + ely, Color); PutPixel(exc - elx, eyc + ely, Color); PutPixel(exc + elx, eyc - ely, Color); PutPixel(exc - elx, eyc - ely, Color); }; d+=(3 * (aa - bb)/2 - (dx + dy))/2; while (ely > 0) { if (d < 0) {elx++; dx+=bb2; d+=bb + dx;} ely--; dy-=aa2; d+=aa - dy; PutPixel(exc + elx, eyc + ely, Color); PutPixel(exc - elx, eyc + ely, Color); PutPixel(exc + elx, eyc - ely, Color); PutPixel(exc - elx, eyc - ely, Color); }; return 0; }; */ void gdImage::Sector(int cx, int cy, int w, int h, int s, int e, int color) { int i; int lx = 0, ly = 0; int w2, h2; w2 = w/2; h2 = h/2; while (e < s) e += 360; // paf while(s<0) s+=360; while(s>360) s-=360; while(e<0) e+=360; while(e>360) e-=360; for (i=s; (i <= e); i++) { int x, y; x = ((long)cost[i] * (long)w2 / costScale) + cx; y = ((long)sint[i] * (long)h2 / sintScale) + cy; if(i==s || i==e) Line(cx, cy, x, y, color); if (i != s) { Line(lx, ly, x, y, color); } lx = x; ly = y; } } void gdImage::FillToBorder(int x, int y, int border, int color) { if(!BoundsSafe(x, y)) //PAF return; int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; leftLimit = (-1); if (border < 0) { /* Refuse to fill to a non-solid border */ return; } for (i = x; (i >= 0); i--) { if (GetPixel(i, y) == border) { break; } SetPixel(i, y, color); leftLimit = i; } if (leftLimit == (-1)) { return; } /* Seek right */ rightLimit = x; for (i = (x+1); (i < sx); i++) { if (GetPixel(i, y) == border) { break; } SetPixel(i, y, color); rightLimit = i; } /* Look at lines above and below and start paints */ /* Above */ if (y > 0) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y-1); if (lastBorder) { if ((c != border) && (c != color)) { FillToBorder(i, y-1, border, color); lastBorder = 0; } } else if ((c == border) || (c == color)) { lastBorder = 1; } } } /* Below */ if (y < ((sy) - 1)) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y+1); if (lastBorder) { if ((c != border) && (c != color)) { FillToBorder(i, y+1, border, color); lastBorder = 0; } } else if ((c == border) || (c == color)) { lastBorder = 1; } } } } void gdImage::Fill(int x, int y, int color) { if(!BoundsSafe(x, y)) //PAF return; int lastBorder; int old; int leftLimit, rightLimit; int i; old = GetPixel(x, y); if (old == color) { /* Nothing to be done */ return; } /* Seek left */ leftLimit = (-1); for (i = x; (i >= 0); i--) { if (GetPixel(i, y) != old) { break; } DoSetPixel(i, y, color); // PAF, was SetPixel leftLimit = i; } if (leftLimit == (-1)) { return; } /* Seek right */ rightLimit = x; for (i = (x+1); (i < sx); i++) { if (GetPixel(i, y) != old) { break; } DoSetPixel(i, y, color); // PAF, was SetPixel rightLimit = i; } /* Look at lines above and below and start paints */ /* Above */ if (y > 0) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y-1); if (lastBorder) { if (c == old) { Fill(i, y-1, color); lastBorder = 0; } } else if (c != old) { lastBorder = 1; } } } /* Below */ if (y < ((sy) - 1)) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y+1); if (lastBorder) { if (c == old) { Fill(i, y+1, color); lastBorder = 0; } } else if (c != old) { lastBorder = 1; } } } } void gdImage::Rectangle(int x1, int y1, int x2, int y2, int color) { Line(x1, y1, x2, y1, color); Line(x1, y2, x2, y2, color); Line(x1, y1, x1, y2, color); Line(x2, y1, x2, y2, color); } void gdImage::FilledRectangle(int x1, int y1, int x2, int y2, int color) { if(x1>x2) { int t=x1; x1=x2; x2=t; } if(y1>y2) { int t=y1; y1=y2; y2=t; } int x, y; for (y=y1; (y<=y2); y++) for (x=x1; (x<=x2); x++) SetPixel(x, y, color); } void gdImage::Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h) { int c; int x, y; int tox, toy; int i; int colorMap[gdMaxColors]; for (i=0; (i sy2 - sy1) { yportion = sy2 - sy1; } sy = floor (sy); } else if (sy == floor (sy2)) { yportion = sy2 - floor (sy2); } else { yportion = 1.0; } sx1 = ((double) x - (double) dstX) * (double) srcW / dstW; sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW; sx = sx1; do { double xportion; double pcontribution; int p; if (floor (sx) == floor (sx1)) { xportion = 1.0 - (sx - floor (sx)); if (xportion > sx2 - sx1) { xportion = sx2 - sx1; } sx = floor (sx); } else if (sx == floor (sx2)) { xportion = sx2 - floor (sx2); } else { xportion = 1.0; } pcontribution = xportion * yportion; p = src.GetPixel ( (int) sx, (int) sy); // fix added 20020116 by paf to support transparent src if (p!=srcTransparent) { transparent = false; red += Red (p) * pcontribution; green += Green (p) * pcontribution; blue += Blue (p) * pcontribution; } spixels += xportion * yportion; sx += 1.0; } while (sx < sx2); sy += 1.0; } while (sy < sy2); if(transparent) continue; if (spixels != 0.0) { red /= spixels; green /= spixels; blue /= spixels; } /* Clamping to allow for rounding errors above */ if (red > 255.0) red = 255.0; if (green > 255.0) green = 255.0; if (blue > 255.0) blue = 255.0; red=round(red); green=round(green); blue=round(blue); /* First look for an exact match */ int nc = dst.ColorExact((int)red, (int)green, (int)blue); if (nc == (-1)) { /* No, so go for the closest color with high tolerance */ nc = dst.ColorClosest((int)red, (int)green, (int)blue, tolerance); if (nc == (-1)) { /* Not found with even high tolerance, so try to allocate it */ nc = dst.ColorAllocate((int)red, (int)green, (int)blue); /* If we're out of colors, go for the closest color */ if (nc == (-1)) nc = dst.ColorClosest((int)red, (int)green, (int)blue); } } dst.SetPixel(x, y, nc); } } } void gdImage::Polygon(Point *p, int n, int c, bool closed) { int i; int lx, ly; if (!n) { return; } lx = p->x; ly = p->y; if(closed) Line(lx, ly, p[n-1].x, p[n-1].y, c); for (i=1; (i < n); i++) { p++; Line(lx, ly, p->x, p->y, c); lx = p->x; ly = p->y; } } static int gdCompareInt(const void *a, const void *b) { return (*(const int *)a) - (*(const int *)b); } void gdImage::FilledPolygon(Point *p, int n, int c) { int i; int y; int y1, y2; int ints; if (!n) { return; } if (!polyAllocated) { polyInts = (int *) malloc(sizeof(int) * n); polyAllocated = n; } if (polyAllocated < n) { while (polyAllocated < n) { polyAllocated *= 2; } polyInts = (int *) realloc(polyInts, sizeof(int) * polyAllocated); } y1 = p[0].y; y2 = p[0].y; for (i=1; (i < n); i++) { if (p[i].y < y1) { y1 = p[i].y; } if (p[i].y > y2) { y2 = p[i].y; } } for (y=y1; (y <= y2); y++) { int interLast = 0; int dirLast = 0; int interFirst = 1; ints = 0; for (i=0; (i <= n); i++) { int x1, x2; int y1, y2; int dir; int ind1, ind2; int lastInd1 = 0; if ((i == n) || (!i)) { ind1 = n-1; ind2 = 0; } else { ind1 = i-1; ind2 = i; } y1 = p[ind1].y; y2 = p[ind2].y; if (y1 < y2) { y1 = p[ind1].y; y2 = p[ind2].y; x1 = p[ind1].x; x2 = p[ind2].x; dir = -1; } else if (y1 > y2) { y2 = p[ind1].y; y1 = p[ind2].y; x2 = p[ind1].x; x1 = p[ind2].x; dir = 1; } else { /* Horizontal; just draw it */ Line( p[ind1].x, y1, p[ind2].x, y1, c); continue; } if ((y >= y1) && (y <= y2)) { int inter = (y-y1) * (x2-x1) / (y2-y1) + x1; /* Only count intersections once except at maxima and minima. Also, if two consecutive intersections are endpoints of the same horizontal line that is not at a maxima or minima, discard the leftmost of the two. */ if (!interFirst) { if ((p[ind1].y == p[lastInd1].y) && (p[ind1].x != p[lastInd1].x)) { if (dir == dirLast) { if (inter > interLast) { /* Replace the old one */ polyInts[ints] = inter; } else { /* Discard this one */ } continue; } } if (inter == interLast) { if (dir == dirLast) { continue; } } } if (i > 0) { polyInts[ints++] = inter; } lastInd1 = i; dirLast = dir; interLast = inter; interFirst = 0; } } qsort(polyInts, ints, sizeof(int), gdCompareInt); for (i=0; (i < (ints-1)); i+=2) Line(polyInts[i], y, polyInts[i+1], y, c); } } //001005paf this used in drawing straight lines in gdImage::FilledPolygonReplaceColor void gdImage::LineReplaceColor(int x1, int y1, int x2, int y2, int a, int b) { if(y1!=y2) return; for(int x=x1; x<=x2; x++) if(BoundsSafe(x, y1)) { unsigned char *pixel=&pixels[x][y1]; if(*pixel==a) *pixel=b; } } void gdImage::FilledPolygonReplaceColor(Point *p, int n, int a, int b) { int i; int y; int y1, y2; int ints; if (!n) { return; } if (!polyAllocated) { polyInts = (int *) malloc(sizeof(int) * n); polyAllocated = n; } if (polyAllocated < n) { while (polyAllocated < n) { polyAllocated *= 2; } polyInts = (int *) realloc(polyInts, sizeof(int) * polyAllocated); } y1 = p[0].y; y2 = p[0].y; for (i=1; (i < n); i++) { if (p[i].y < y1) { y1 = p[i].y; } if (p[i].y > y2) { y2 = p[i].y; } } for (y=y1; (y <= y2); y++) { int interLast = 0; int dirLast = 0; int interFirst = 1; ints = 0; for (i=0; (i <= n); i++) { int x1, x2; int y1, y2; int dir; int ind1, ind2; int lastInd1 = 0; if ((i == n) || (!i)) { ind1 = n-1; ind2 = 0; } else { ind1 = i-1; ind2 = i; } y1 = p[ind1].y; y2 = p[ind2].y; if (y1 < y2) { y1 = p[ind1].y; y2 = p[ind2].y; x1 = p[ind1].x; x2 = p[ind2].x; dir = -1; } else if (y1 > y2) { y2 = p[ind1].y; y1 = p[ind2].y; x2 = p[ind1].x; x1 = p[ind2].x; dir = 1; } else { /* Horizontal; just draw it */ LineReplaceColor( p[ind1].x, y1, p[ind2].x, y1, a,b); continue; } if ((y >= y1) && (y <= y2)) { int inter = (y-y1) * (x2-x1) / (y2-y1) + x1; /* Only count intersections once except at maxima and minima. Also, if two consecutive intersections are endpoints of the same horizontal line that is not at a maxima or minima, discard the leftmost of the two. */ if (!interFirst) { if ((p[ind1].y == p[lastInd1].y) && (p[ind1].x != p[lastInd1].x)) { if (dir == dirLast) { if (inter > interLast) { /* Replace the old one */ polyInts[ints] = inter; } else { /* Discard this one */ } continue; } } if (inter == interLast) { if (dir == dirLast) { continue; } } } if (i > 0) { polyInts[ints++] = inter; } lastInd1 = i; dirLast = dir; interLast = inter; interFirst = 0; } } qsort(polyInts, ints, sizeof(int), gdCompareInt); for (i=0; (i < (ints-1)); i+=2) { LineReplaceColor(polyInts[i], y, polyInts[i+1], y, a,b); } } } void gdImage::SetInterlace(int interlaceArg) { interlace = interlaceArg; } void gdImage::SetLineWidth(int width) { lineWidth=width; } void gdImage::SetLineStyle(const char* alineStyle) { lineStyle=alineStyle; } parser-3.4.3/src/lib/gd/Makefile.in000644 000000 000000 00000036211 11766635215 017127 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/gd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libgd_la_LIBADD = am_libgd_la_OBJECTS = gif.lo gifio.lo libgd_la_OBJECTS = $(am_libgd_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgd_la_SOURCES) DIST_SOURCES = $(libgd_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I../../types -I../../lib/gc/include -I../../lib/cord/include @XML_INCLUDES@ noinst_HEADERS = gif.h mtables.h noinst_LTLIBRARIES = libgd.la libgd_la_SOURCES = gif.C gifio.C EXTRA_DIST = gd.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/gd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/gd/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgd.la: $(libgd_la_OBJECTS) $(libgd_la_DEPENDENCIES) $(CXXLINK) $(libgd_la_OBJECTS) $(libgd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifio.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-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: parser-3.4.3/src/lib/gd/mtables.h000644 000000 000000 00000012743 07757403246 016670 0ustar00rootwheel000000 000000 #ifndef MTABLES_H #define MTABLES_H 1 #define costScale 1024 int cost[] = { 1024, 1023, 1023, 1022, 1021, 1020, 1018, 1016, 1014, 1011, 1008, 1005, 1001, 997, 993, 989, 984, 979, 973, 968, 962, 955, 949, 942, 935, 928, 920, 912, 904, 895, 886, 877, 868, 858, 848, 838, 828, 817, 806, 795, 784, 772, 760, 748, 736, 724, 711, 698, 685, 671, 658, 644, 630, 616, 601, 587, 572, 557, 542, 527, 512, 496, 480, 464, 448, 432, 416, 400, 383, 366, 350, 333, 316, 299, 282, 265, 247, 230, 212, 195, 177, 160, 142, 124, 107, 89, 71, 53, 35, 17, 0, -17, -35, -53, -71, -89, -107, -124, -142, -160, -177, -195, -212, -230, -247, -265, -282, -299, -316, -333, -350, -366, -383, -400, -416, -432, -448, -464, -480, -496, -512, -527, -542, -557, -572, -587, -601, -616, -630, -644, -658, -671, -685, -698, -711, -724, -736, -748, -760, -772, -784, -795, -806, -817, -828, -838, -848, -858, -868, -877, -886, -895, -904, -912, -920, -928, -935, -942, -949, -955, -962, -968, -973, -979, -984, -989, -993, -997, -1001, -1005, -1008, -1011, -1014, -1016, -1018, -1020, -1021, -1022, -1023, -1023, -1024, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1011, -1008, -1005, -1001, -997, -993, -989, -984, -979, -973, -968, -962, -955, -949, -942, -935, -928, -920, -912, -904, -895, -886, -877, -868, -858, -848, -838, -828, -817, -806, -795, -784, -772, -760, -748, -736, -724, -711, -698, -685, -671, -658, -644, -630, -616, -601, -587, -572, -557, -542, -527, -512, -496, -480, -464, -448, -432, -416, -400, -383, -366, -350, -333, -316, -299, -282, -265, -247, -230, -212, -195, -177, -160, -142, -124, -107, -89, -71, -53, -35, -17, 0, 17, 35, 53, 71, 89, 107, 124, 142, 160, 177, 195, 212, 230, 247, 265, 282, 299, 316, 333, 350, 366, 383, 400, 416, 432, 448, 464, 480, 496, 512, 527, 542, 557, 572, 587, 601, 616, 630, 644, 658, 671, 685, 698, 711, 724, 736, 748, 760, 772, 784, 795, 806, 817, 828, 838, 848, 858, 868, 877, 886, 895, 904, 912, 920, 928, 935, 942, 949, 955, 962, 968, 973, 979, 984, 989, 993, 997, 1001, 1005, 1008, 1011, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023, 1024 //paf }; #define sintScale 1024 int sint[] = { 0, 17, 35, 53, 71, 89, 107, 124, 142, 160, 177, 195, 212, 230, 247, 265, 282, 299, 316, 333, 350, 366, 383, 400, 416, 432, 448, 464, 480, 496, 512, 527, 542, 557, 572, 587, 601, 616, 630, 644, 658, 671, 685, 698, 711, 724, 736, 748, 760, 772, 784, 795, 806, 817, 828, 838, 848, 858, 868, 877, 886, 895, 904, 912, 920, 928, 935, 942, 949, 955, 962, 968, 973, 979, 984, 989, 993, 997, 1001, 1005, 1008, 1011, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023, 1024, 1023, 1023, 1022, 1021, 1020, 1018, 1016, 1014, 1011, 1008, 1005, 1001, 997, 993, 989, 984, 979, 973, 968, 962, 955, 949, 942, 935, 928, 920, 912, 904, 895, 886, 877, 868, 858, 848, 838, 828, 817, 806, 795, 784, 772, 760, 748, 736, 724, 711, 698, 685, 671, 658, 644, 630, 616, 601, 587, 572, 557, 542, 527, 512, 496, 480, 464, 448, 432, 416, 400, 383, 366, 350, 333, 316, 299, 282, 265, 247, 230, 212, 195, 177, 160, 142, 124, 107, 89, 71, 53, 35, 17, 0, -17, -35, -53, -71, -89, -107, -124, -142, -160, -177, -195, -212, -230, -247, -265, -282, -299, -316, -333, -350, -366, -383, -400, -416, -432, -448, -464, -480, -496, -512, -527, -542, -557, -572, -587, -601, -616, -630, -644, -658, -671, -685, -698, -711, -724, -736, -748, -760, -772, -784, -795, -806, -817, -828, -838, -848, -858, -868, -877, -886, -895, -904, -912, -920, -928, -935, -942, -949, -955, -962, -968, -973, -979, -984, -989, -993, -997, -1001, -1005, -1008, -1011, -1014, -1016, -1018, -1020, -1021, -1022, -1023, -1023, -1024, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1011, -1008, -1005, -1001, -997, -993, -989, -984, -979, -973, -968, -962, -955, -949, -942, -935, -928, -920, -912, -904, -895, -886, -877, -868, -858, -848, -838, -828, -817, -806, -795, -784, -772, -760, -748, -736, -724, -711, -698, -685, -671, -658, -644, -630, -616, -601, -587, -572, -557, -542, -527, -512, -496, -480, -464, -448, -432, -416, -400, -383, -366, -350, -333, -316, -299, -282, -265, -247, -230, -212, -195, -177, -160, -142, -124, -107, -89, -71, -53, -35, -17, 0 // paf }; #endif parser-3.4.3/src/lib/gd/Makefile.am000644 000000 000000 00000000321 11766065303 017102 0ustar00rootwheel000000 000000 INCLUDES = -I../../types -I../../lib/gc/include -I../../lib/cord/include @XML_INCLUDES@ noinst_HEADERS = gif.h mtables.h noinst_LTLIBRARIES = libgd.la libgd_la_SOURCES = gif.C gifio.C EXTRA_DIST = gd.vcproj parser-3.4.3/src/lib/gd/gifio.C000644 000000 000000 00000061155 11730603273 016256 0ustar00rootwheel000000 000000 /** @file Parser: image manipulations impl2. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) based on: gd Written by Tom Boutell, 5/94. Copyright 1994, Cold Spring Harbor Labs. Permission granted to use this code in any fashion provided that this notice is retained and any alterations are labeled as such. It is requested, but not required, that you share extensions to this module with us so that we can incorporate them into new versions. based on: ** ** Based on GIFENCOD by David Rowley . A ** Lempel-Zim compression based on "compress". ** ** Modified by Marcel Wijkstra ** ** Copyright(C) 1989 by Jef Poskanzer. ** ** Permission to use, copy, modify, and distribute this software and its ** documentation for any purpose and without fee is hereby granted, provided ** that the above copyright notice appear in all copies and that both that ** copyright notice and this permission notice appear in supporting ** documentation. This software is provided "as is" without express or ** implied warranty. ** ** The Graphics Interchange Format(c) is the Copyright property of ** CompuServe Incorporated. GIF(sm) is a Service Mark property of ** CompuServe Incorporated. */ #include "gif.h" volatile const char * IDENT_GIFIO_C="$Id: gifio.C,v 1.4 2012/03/16 09:24:11 moko Exp $"; static int colorstobpp(int colors); gdBuf gdImage::Gif() { int BitsPerPixel = colorstobpp(colorsTotal); /* Clear any old values in statics strewn through the GIF code */ gdGifEncoder encoder(*this); /* All set, let's do it. */ return encoder.encode( sx, sy, interlace, 0, transparent, BitsPerPixel, red, green, blue); } static int colorstobpp(int colors) { int bpp = 0; if( colors <= 2 ) bpp = 1; else if( colors <= 4 ) bpp = 2; else if( colors <= 8 ) bpp = 3; else if( colors <= 16 ) bpp = 4; else if( colors <= 32 ) bpp = 5; else if( colors <= 64 ) bpp = 6; else if( colors <= 128 ) bpp = 7; else if( colors <= 256 ) bpp = 8; return bpp; } /***************************************************************************** * * GIFENCODE.C - GIF Image compression interface * * GIFEncode( FName, GHeight, GWidth, GInterlace, Background, Transparent, * BitsPerPixel, Red, Green, Blue, gdGifEncoder::Ptr ) * *****************************************************************************/ #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* * Bump the 'curx' and 'cury' to point to the next pixel */ void gdGifEncoder::BumpPixel(void) { /* * Bump the current X position */ ++curx; /* * If we are at the end of a scan line, set curx back to the beginning * If we are interlaced, bump the cury to the appropriate spot, * otherwise, just increment it. */ if( curx == Width ) { curx = 0; if( !Interlace ) ++cury; else { switch( Pass ) { case 0: cury += 8; if( cury >= Height ) { ++Pass; cury = 4; } break; case 1: cury += 8; if( cury >= Height ) { ++Pass; cury = 2; } break; case 2: cury += 4; if( cury >= Height ) { ++Pass; cury = 1; } break; case 3: cury += 2; break; } } } } /* * Return the next pixel from the image */ int gdGifEncoder::GIFNextPixel() { int r; if( CountDown == 0 ) return EOF; --CountDown; r = im.GetPixel(curx, cury); BumpPixel(); return r; } /* public */ gdBuf gdGifEncoder::encode(int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue) { int B; int RWidth, RHeight; int LeftOfs, TopOfs; int Resolution; int ColorMapSize; int InitCodeSize; int i; Interlace = GInterlace; ColorMapSize = 1 << BitsPerPixel; RWidth = Width = GWidth; RHeight = Height = GHeight; LeftOfs = TopOfs = 0; Resolution = BitsPerPixel; /* * Calculate number of bits we are expecting */ CountDown =(long)Width *(long)Height; /* * Indicate which pass we are on(if interlace) */ Pass = 0; /* * The initial code size */ if( BitsPerPixel <= 1 ) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; /* * Set up the current x and y position */ curx = cury = 0; /* * Write the Magic header */ Putbyte('G');Putbyte('I');Putbyte('F'); Putbyte('8');Putbyte(Transparent < 0?'7':'9');Putbyte('a'); /* * Write out the screen width and height */ Putword( RWidth); Putword( RHeight); /* * Indicate that there is a global colour map */ B = 0x80; /* Yes, there is a color map */ /* * OR in the resolution */ B |=(Resolution - 1) << 5; /* * OR in the Bits per Pixel */ B |=(BitsPerPixel - 1); /* * Write it out */ Putbyte(B); /* * Write out the Background colour */ Putbyte(Background); /* * Byte of 0's(future expansion) */ Putbyte(0); /* * Write out the Global Colour Map */ for( i=0; i= 0 ) { Putbyte( '!'); Putbyte( 0xf9); Putbyte( 4); Putbyte( 1); Putbyte( 0); Putbyte( 0); Putbyte((unsigned char) Transparent); Putbyte( 0); } /* * Write an Image separator */ Putbyte( ','); /* * Write the Image header */ Putword( LeftOfs); Putword( TopOfs); Putword( Width); Putword( Height); /* * Write out whether or not the image is interlaced */ if( Interlace ) Putbyte( 0x40); else Putbyte( 0x00); /* * Write out the initial code size */ Putbyte( InitCodeSize); /* * Go and actually compress the data */ compress( InitCodeSize+1 ); /* * Write out a Zero-length packet(to end the series) */ Putbyte( 0); /* * Write the GIF file terminator */ Putbyte( ';'); return buf; } /* * Write out a byte to the GIF file */ void gdGifEncoder::Putbyte(unsigned char c) { buf.append(&c, 1); } /* * Write out a word to the GIF file */ void gdGifEncoder::Putword(int w) { unsigned char b0=w & 0xff; unsigned char b1=w >> 8; buf.append(&b0, 1); buf.append(&b1, 1); } void gdGifEncoder::Write(void *abuf, size_t size) { buf.append((unsigned char*)abuf, size); } /*************************************************************************** * * GIFCOMPR.C - GIF Image compression routines * * Lempel-Ziv compression based on 'compress'. GIF modifications by * David Rowley(mgardi@watdcsu.waterloo.edu) * ***************************************************************************/ /* * General DEFINEs */ #define GIFBITS 12 #ifdef NO_UCHAR typedef char char_type; #else typedef unsigned char char_type; #endif /* * * GIF Image compression - modified 'compress' * * Based on: compress.c - File compression ala IEEE Computer, June 1984. * * By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) * Jim McKie (decvax!mcvax!jim) * Steve Davies (decvax!vax135!petsd!peora!srd) * Ken Turkowski (decvax!decwrl!turtlevax!ken) * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) * */ #ifdef COMPATIBLE /* But wrong! */ # define MAXCODE(n_bits) ((code_int) 1 <<(n_bits) - 1) #else # define MAXCODE(n_bits) (((code_int) 1 <<(n_bits)) - 1) #endif #define HashTabOf(i) htab[i] #define CodeTabOf(i) codetab[i] /* * To save much memory, we overlay the table used by compress() with those * used by decompress(). The tab_prefix table is the same size and type * as the codetab. The tab_suffix table needs 2**GIFBITS characters. We * get this from the beginning of htab. The output stack uses the rest * of htab, and contains characters. There is plenty of room for any * possible stack(stack used to be 8000 characters). */ #define tab_prefixof(i) CodeTabOf(i) #define tab_suffixof(i) ((char_type*)(htab))[i] #define de_stack ((char_type*)&tab_suffixof((code_int)1< 0 ) goto probe; nomatch: output((code_int) ent ); ++out_count; ent = c; #ifdef SIGNED_COMPARE_SLOW if((unsigned) free_ent <(unsigned) maxmaxcode) { #else if( free_ent < maxmaxcode ) { /* } */ #endif CodeTabOf(i) = free_ent++; /* code -> hashtable */ HashTabOf(i) = fcode; } else cl_block(); } /* * Put out the final code. */ output((code_int)ent ); ++out_count; output((code_int) EOFCode ); } /***************************************************************** * TAG( output ) * * Output the given code. * Inputs: * code: A n_bits-bit integer. If == -1, then EOF. This assumes * that n_bits =<(long)wordsize - 1. * Outputs: * Outputs code to the file. * Assumptions: * Chars are 8 bits long. * Algorithm: * Maintain a GIFBITS character long buffer(so that 8 codes will * fit in it exactly). Use the VAX insv instruction to insert each * code in turn. When the buffer fills up empty it and start over. */ static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; void gdGifEncoder::output(code_int code) { cur_accum &= masks[ cur_bits ]; if( cur_bits > 0 ) cur_accum |=((long)code << cur_bits); else cur_accum = code; cur_bits += n_bits; while( cur_bits >= 8 ) { char_out((unsigned int)(cur_accum & 0xff) ); cur_accum >>= 8; cur_bits -= 8; } /* * If the next entry is going to be too big for the code size, * then increase it, if possible. */ if( free_ent > maxcode || clear_flg ) { if( clear_flg ) { maxcode = MAXCODE(n_bits = g_init_bits); clear_flg = 0; } else { ++n_bits; if( n_bits == maxbits ) maxcode = maxmaxcode; else maxcode = MAXCODE(n_bits); } } if( code == EOFCode ) { /* * At EOF, write the rest of the buffer. */ while( cur_bits > 0 ) { char_out((unsigned int)(cur_accum & 0xff) ); cur_accum >>= 8; cur_bits -= 8; } flush_char(); } } /* * Clear out the hash table */ void gdGifEncoder::cl_block(void) /* table clear for block compress */ { cl_hash((count_int) hsize ); free_ent = ClearCode + 2; clear_flg = 1; output((code_int)ClearCode ); } void gdGifEncoder::cl_hash(count_int hsize) /* reset code table */ { register count_int *htab_p = htab+hsize; register long i; register long m1 = -1; i = hsize - 16; do { /* might use Sys V memset(3) here */ *(htab_p-16) = m1; *(htab_p-15) = m1; *(htab_p-14) = m1; *(htab_p-13) = m1; *(htab_p-12) = m1; *(htab_p-11) = m1; *(htab_p-10) = m1; *(htab_p-9) = m1; *(htab_p-8) = m1; *(htab_p-7) = m1; *(htab_p-6) = m1; *(htab_p-5) = m1; *(htab_p-4) = m1; *(htab_p-3) = m1; *(htab_p-2) = m1; *(htab_p-1) = m1; htab_p -= 16; } while((i -= 16) >= 0); for( i += 16; i > 0; --i ) *--htab_p = m1; } /****************************************************************************** * * GIF Specific routines * ******************************************************************************/ /* * Set up the 'byte output' routine */ void gdGifEncoder::char_init(void) { a_count = 0; } /* * Add a character to the end of the current packet, and if it is 254 * characters, flush the packet to disk. */ void gdGifEncoder::char_out(int c) { accum[ a_count++ ] = c; if( a_count >= 254 ) flush_char(); } /* * Flush the packet to disk, and reset the accumulator */ void gdGifEncoder::flush_char(void) { if( a_count > 0 ) { Putbyte( a_count ); Write( accum, a_count); a_count = 0; } } gdGifEncoder::gdGifEncoder(gdImage& aim): im(aim) { /* Some of these are properly initialized later. What I'm doing here is making sure code that depends on C's initialization of statics doesn't break when the code gets called more than once. */ Width = 0; Height = 0; curx = 0; cury = 0; CountDown = 0; Pass = 0; Interlace = 0; a_count = 0; cur_accum = 0; cur_bits = 0; g_init_bits = 0; ClearCode = 0; EOFCode = 0; free_ent = 0; clear_flg = 0; offset = 0; in_count = 1; out_count = 0; hsize = HSIZE; n_bits = 0; maxbits = GIFBITS; maxcode = 0; maxmaxcode =(code_int)1 << GIFBITS; } /* +-------------------------------------------------------------------+ */ /* | Copyright 1990, 1991, 1993, David Koblas.(koblas@netcom.com) | */ /* | Permission to use, copy, modify, and distribute this software | */ /* | and its documentation for any purpose and without fee is hereby | */ /* | granted, provided that the above copyright notice appear in all | */ /* | copies and that both that copyright notice and this permission | */ /* | notice appear in supporting documentation. This software is | */ /* | provided "as is" without express or implied warranty. | */ /* +-------------------------------------------------------------------+ */ #define MAXCOLORMAPSIZE 256 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define CM_RED 0 #define CM_GREEN 1 #define CM_BLUE 2 #define MAX_LWZ_BITS 12 #define INTERLACE 0x40 #define LOCALCOLORMAP 0x80 #define BitSet(byte, bit) (((byte) &(bit)) ==(bit)) #define ReadOK(file,buffer,len)(fread(buffer, len, 1, file) != 0) #define LM_to_uint(a,b) (((b)<<8)|(a)) /* We may eventually want to use this information, but def it out for now */ #if 0 struct GifScreen { unsigned int Width; unsigned int Height; unsigned char ColorMap[3][MAXCOLORMAPSIZE]; unsigned int BitPixel; unsigned int ColorResolution; unsigned int Background; unsigned int AspectRatio; }; #endif /// Graphic Control Extension struct #ifndef DOXYGEN struct Gif89 { int transparent; int delayTime; int inputFlag; int disposal; }; #endif static int ReadColorMap(FILE *fd, int number, unsigned char(*buffer)[256]); bool gdImage::CreateFromGif(FILE *fd) { int imageNumber; int BitPixel; int ColorResolution; int Background; int AspectRatio; int Transparent =(-1); unsigned char buf[16]; unsigned char c; unsigned char ColorMap[3][MAXCOLORMAPSIZE]; unsigned char localColorMap[3][MAXCOLORMAPSIZE]; int imw, imh; int useGlobalColormap; int bitPixel; int imageCount = 0; char version[4]; ZeroDataBlock = FALSE; imageNumber = 1; if(! ReadOK(fd,buf,6)) { return false; } if(strncmp((char *)buf,"GIF",3) != 0) { return false; } strncpy(version,(char *)buf + 3, 3); version[3] = '\0'; if((strcmp(version, "87a") != 0) &&(strcmp(version, "89a") != 0)) { return false; } if(! ReadOK(fd,buf,7)) { return false; } BitPixel = 2<<(buf[4]&0x07); ColorResolution =(int)(((buf[4]&0x70)>>3)+1); Background = buf[5]; AspectRatio = buf[6]; if(BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ if(ReadColorMap(fd, BitPixel, ColorMap)) { return false; } } for(;;) { if(! ReadOK(fd,&c,1)) { return false; } if(c == ';') { /* GIF terminator */ int i; if(imageCount < imageNumber) { return false; } /* Check for open colors at the end, so we can reduce colorsTotal and ultimately BitsPerPixel */ for(i=((colorsTotal-1));(i>=0); i--) { if(open[i]) { colorsTotal--; } else { break; } } return true; } if(c == '!') { /* Extension */ if(! ReadOK(fd,&c,1)) { return false; } DoExtension(fd, c, &Transparent); continue; } if(c != ',') { /* Not a valid start character */ continue; } ++imageCount; if(! ReadOK(fd,buf,9)) { return false; } useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP); bitPixel = 1<<((buf[8]&0x07)+1); imw = LM_to_uint(buf[4],buf[5]); imh = LM_to_uint(buf[6],buf[7]); Create(imw, imh); interlace = BitSet(buf[8], INTERLACE); if(! useGlobalColormap) { if(ReadColorMap(fd, bitPixel, localColorMap)) { return false; } ReadImage(fd, imw, imh, localColorMap, BitSet(buf[8], INTERLACE), imageCount != imageNumber); } else { ReadImage(fd, imw, imh, ColorMap, BitSet(buf[8], INTERLACE), imageCount != imageNumber); } if(Transparent !=(-1)) { SetColorTransparent(Transparent); } } } static int ReadColorMap(FILE *fd, int number, unsigned char(*buffer)[256]) { int i; unsigned char rgb[3]; for(i = 0; i < number; ++i) { if(! ReadOK(fd, rgb, sizeof(rgb))) { return TRUE; } buffer[CM_RED][i] = rgb[0] ; buffer[CM_GREEN][i] = rgb[1] ; buffer[CM_BLUE][i] = rgb[2] ; } return FALSE; } int gdImage::DoExtension(FILE *fd, int label, int *Transparent) { static unsigned char buf[256]; switch(label) { case 0xf9: { /* Graphic Control Extension */ (void) GetDataBlock(fd,(unsigned char*) buf); Gif89 gif89 = { -1, -1, -1, 0 }; // PAF:huh? gif89.disposal =(buf[0] >> 2) & 0x7; gif89.inputFlag =(buf[0] >> 1) & 0x1; gif89.delayTime = LM_to_uint(buf[1],buf[2]); if((buf[0] & 0x1) != 0) *Transparent = buf[3]; while(GetDataBlock(fd,(unsigned char*) buf) != 0) ; return FALSE; } default: break; } while(GetDataBlock(fd,(unsigned char*) buf) != 0) ; return FALSE; } int gdImage::GetDataBlock(FILE *fd, unsigned char *buf) { unsigned char count; if(! ReadOK(fd,&count,1)) { return -1; } ZeroDataBlock = count == 0; if((count != 0) &&(! ReadOK(fd, buf, count))) { return -1; } return count; } int gdImage::GetCode(FILE *fd, int code_size, int flag) { static unsigned char buf[280]; static int curbit, lastbit, done, last_byte; int i, j, ret; unsigned char count; if(flag) { curbit = 0; lastbit = 0; done = FALSE; return 0; } if((curbit+code_size) >= lastbit) { if(done) { if(curbit >= lastbit) { /* Oh well */ } return -1; } buf[0] = buf[last_byte-2]; buf[1] = buf[last_byte-1]; if((count = GetDataBlock(fd, &buf[2])) == 0) done = TRUE; last_byte = 2 + count; curbit =(curbit - lastbit) + 16; lastbit =(2+count)*8 ; } ret = 0; for(i = curbit, j = 0; j < code_size; ++i, ++j) ret |=((buf[ i / 8 ] &(1 <<(i % 8))) != 0) << j; curbit += code_size; return ret; } int gdImage::LWZReadByte(FILE *fd, int flag, int input_code_size) { static int fresh = FALSE; int code, incode; static int code_size, set_code_size; static int max_code, max_code_size; static int firstcode, oldcode; static int clear_code, end_code; static int table[2][(1<< MAX_LWZ_BITS)]; static int stack[(1<<(MAX_LWZ_BITS))*2], *sp; register int i; if(flag) { set_code_size = input_code_size; code_size = set_code_size+1; clear_code = 1 << set_code_size ; end_code = clear_code + 1; max_code_size = 2*clear_code; max_code = clear_code+2; GetCode(fd, 0, TRUE); fresh = TRUE; for(i = 0; i < clear_code; ++i) { table[0][i] = 0; table[1][i] = i; } for(; i <(1< stack) return *--sp; while((code = GetCode(fd, code_size, FALSE)) >= 0) { if(code == clear_code) { for(i = 0; i < clear_code; ++i) { table[0][i] = 0; table[1][i] = i; } for(; i <(1< 0) ; if(count != 0) return -2; } incode = code; if(code >= max_code) { *sp++ = firstcode; code = oldcode; } while(code >= clear_code) { *sp++ = table[1][code]; if(code == table[0][code]) { /* Oh well */ } code = table[0][code]; } *sp++ = firstcode = table[1][code]; if((code = max_code) <(1<= max_code_size) && (max_code_size <(1< stack) return *--sp; } return code; } void gdImage::ReadImage(FILE *fd, int len, int height, unsigned char(*cmap)[256], int interlace, int ignore) { unsigned char c; int v; int xpos = 0, ypos = 0, pass = 0; int i; /* Stash the color map into the image */ for(i=0;(i= 0) ; return; } while((v = LWZReadByte(fd,FALSE,c)) >= 0 ) { /* This how we recognize which colors are actually used. */ if(open[v]) { open[v] = 0; } SetPixel(xpos, ypos, v); ++xpos; if(xpos == len) { xpos = 0; if(interlace) { switch(pass) { case 0: case 1: ypos += 8; break; case 2: ypos += 4; break; case 3: ypos += 2; break; } if(ypos >= height) { ++pass; switch(pass) { case 1: ypos = 4; break; case 2: ypos = 2; break; case 3: ypos = 1; break; default: goto fini; } } } else { ++ypos; } } if(ypos >= height) break; } fini: if(LWZReadByte(fd,FALSE,c)>=0) { /* Ignore extra */ } } parser-3.4.3/src/lib/gd/gd.vcproj000644 000000 000000 00000007126 12230131504 016657 0ustar00rootwheel000000 000000 parser-3.4.3/src/targets/cgi/000755 000000 000000 00000000000 12234223575 016123 5ustar00rootwheel000000 000000 parser-3.4.3/src/targets/Makefile.in000644 000000 000000 00000043041 11766635216 017440 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/targets DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = cgi isapi apache DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #don't compile apache @COMPILE_APACHE_MODULE_FALSE@SUBDIRS = cgi isapi @COMPILE_APACHE_MODULE_TRUE@SUBDIRS = apache cgi all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: parser-3.4.3/src/targets/Makefile.am000644 000000 000000 00000000143 11763355105 017414 0ustar00rootwheel000000 000000 if COMPILE_APACHE_MODULE SUBDIRS = apache cgi else #don't compile apache SUBDIRS = cgi isapi endif parser-3.4.3/src/targets/isapi/000755 000000 000000 00000000000 12234223575 016466 5ustar00rootwheel000000 000000 parser-3.4.3/src/targets/apache/000755 000000 000000 00000000000 12234223575 016602 5ustar00rootwheel000000 000000 parser-3.4.3/src/targets/apache/Makefile.in000644 000000 000000 00000051501 11773052135 020650 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/targets/apache DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = am_mod_parser3_la_OBJECTS = pa_threads.lo mod_parser3_core.lo \ mod_parser3_la-mod_parser3.lo mod_parser3_la_OBJECTS = $(am_mod_parser3_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(mod_parser3_la_SOURCES) DIST_SOURCES = $(mod_parser3_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ PA_LIBS = ../../classes/libclasses.la ../../types/libtypes.la ../../main/libmain.la ../../lib/gd/libgd.la ../../lib/cord/libcord.la \ ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la ../../lib/smtp/libsmtp.la ../../lib/json/libjson.la ../../lib/memcached/libmemcached.la INCLUDES = $(APACHE_INC) -I./ -I../../classes -I../../types -I../../lib/gc/include -I../../lib/cord/include @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS mod_parser3_la_LINK = $(LIBTOOL) --tag=CXX --tag=disable-static --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(mod_parser3_la_LDFLAGS) $(LDFLAGS) -o $@ noinst_HEADERS = pa_httpd.h lib_LTLIBRARIES = mod_parser3.la mod_parser3_la_SOURCES = pa_threads.C mod_parser3_core.C mod_parser3.c mod_parser3_la_DEPENDENCIES = Makefile $(PA_LIBS) mod_parser3_la_LDFLAGS = -module -avoid-version mod_parser3_la_CFLAGS = $(APACHE_CFLAGS) mod_parser3_la_LIBADD = $(PA_LIBS) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ $(LIBLTDL) all: all-am .SUFFIXES: .SUFFIXES: .C .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/apache/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/apache/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 $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done mod_parser3.la: $(mod_parser3_la_OBJECTS) $(mod_parser3_la_DEPENDENCIES) $(mod_parser3_la_LINK) -rpath $(libdir) $(mod_parser3_la_OBJECTS) $(mod_parser3_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_parser3_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_parser3_la-mod_parser3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_threads.Plo@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mod_parser3_la-mod_parser3.lo: mod_parser3.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_parser3_la_CFLAGS) $(CFLAGS) -MT mod_parser3_la-mod_parser3.lo -MD -MP -MF $(DEPDIR)/mod_parser3_la-mod_parser3.Tpo -c -o mod_parser3_la-mod_parser3.lo `test -f 'mod_parser3.c' || echo '$(srcdir)/'`mod_parser3.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_parser3_la-mod_parser3.Tpo $(DEPDIR)/mod_parser3_la-mod_parser3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_parser3.c' object='mod_parser3_la-mod_parser3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_parser3_la_CFLAGS) $(CFLAGS) -c -o mod_parser3_la-mod_parser3.lo `test -f 'mod_parser3.c' || echo '$(srcdir)/'`mod_parser3.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # 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: parser-3.4.3/src/targets/apache/mod_parser3.c000644 000000 000000 00000022451 12231524647 021171 0ustar00rootwheel000000 000000 /** @file Parser: apache 1.3 and 2.2 module Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "httpd.h" #include "http_config.h" #include "http_core.h" #include "http_log.h" #include "http_main.h" #include "http_protocol.h" #include "util_script.h" #include "pa_httpd.h" volatile const char * IDENT_MOD_PARSER3_C="$Id: mod_parser3.c,v 1.17 2013/10/22 16:36:55 moko Exp $" IDENT_PA_HTTPD_H; #define PARSER3_HANDLER "parser3-handler" /* * To Ease Compatibility */ #ifdef STANDARD20_MODULE_STUFF #include "apr_strings.h" #include "ap_mpm.h" #define ap_pcalloc apr_pcalloc #define ap_pstrdup apr_pstrdup #define ap_table_get apr_table_get #define ap_table_elts apr_table_elts #define ap_table_addn apr_table_addn #define ap_table_do apr_table_do #else #include "ap_alloc.h" #define apr_pool_t pool #define apr_table_t table #endif /* STANDARD20_MODULE_STUFF */ /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ #ifdef STANDARD20_MODULE_STUFF module AP_MODULE_DECLARE_DATA parser3_module; static int is_threaded = 0; #else module MODULE_VAR_EXPORT parser3_module; #endif /* * Locate our directory configuration record for the current request. */ static Parser_module_config *our_dconfig(request_rec *r) { return (Parser_module_config *) ap_get_module_config(r->per_dir_config, &parser3_module); } static const char* cmd_parser_config(cmd_parms *cmd, void *mconfig, const char *file_spec) { Parser_module_config *cfg = (Parser_module_config *) mconfig; cfg->parser_config_filespec=file_spec; return NULL; } /* * Now let's declare routines for each of the callback phase in order. */ static int parser_handler(request_rec *r) { #ifdef STANDARD20_MODULE_STUFF if(strcmp(r->handler, PARSER3_HANDLER)) return DECLINED; if(is_threaded){ const char *message="Parser3 module requires apache2-mpm-prefork"; r->status=HTTP_INTERNAL_SERVER_ERROR; r->content_type="text/plain"; ap_rwrite(message, strlen(message), r); return OK; } #endif // we setup module here to avoid GPF on init with php5-xsl installed pa_setup_module_cells(); { // converting to parser version pa_request_rec pr={ r, r->pool, r->header_only, &r->status, r->method, r->headers_out, r->subprocess_env, &r->content_type, r->uri, r->filename, r->path_info, r->args, #ifdef STANDARD20_MODULE_STUFF r->finfo.filetype == 0 #else r->finfo.st_mode == 0 #endif }; return pa_parser_handler(&pr, our_dconfig(r)); } } /* * This function is called during process initialisation. */ #ifdef STANDARD20_MODULE_STUFF static void parser_child_init(apr_pool_t *p, server_rec *s) { #else static void parser_module_init(server_rec *s, apr_pool_t *p) { #endif // ap_log_perror(APLOG_MARK, APLOG_EMERG, 0, p, "parser inited %d", getpid()); } /* * All our process-death routine does is add its trace to the log. */ static void parser_module_done(server_rec *s, apr_pool_t *p) { pa_destroy_module_cells(); } /* * This function gets called to create a per-directory configuration record. */ static void *parser_create_dir_config(apr_pool_t *p, char *dirspec) { Parser_module_config *cfg= ap_pcalloc(p, sizeof(Parser_module_config)); cfg->parser_config_filespec=NULL; return cfg; } /* * This function gets called to create a per-server configuration record. */ static void *parser_create_server_config(apr_pool_t *p, server_rec *s) { Parser_module_config *cfg= ap_pcalloc(p, sizeof(Parser_module_config)); cfg->parser_config_filespec=NULL; return cfg; } /* * List of directives specific to our module. */ static const command_rec parser_cmds[] = { {"ParserConfig", (const char *(*)())cmd_parser_config, 0, OR_OPTIONS, TAKE1, "Parser config filespec"}, {NULL} }; /*--------------------------------------------------------------------------*/ /* Now the list of content handlers available from this module. */ /*--------------------------------------------------------------------------*/ #ifndef STANDARD20_MODULE_STUFF static const handler_rec parser_handlers[] = { {PARSER3_HANDLER, parser_handler}, {NULL} }; #endif /*--------------------------------------------------------------------------*/ /* Finally, the list of callback routines and data structures that */ /* provide the hooks into our module from the other parts of the server. */ /*--------------------------------------------------------------------------*/ #ifdef STANDARD20_MODULE_STUFF /* * register hooks. */ static void parser_register_hooks(apr_pool_t* pool) { int mpm_query_info; is_threaded = ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info) == APR_SUCCESS && mpm_query_info != AP_MPMQ_NOT_SUPPORTED; ap_hook_handler(parser_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(parser_child_init, NULL, NULL, APR_HOOK_MIDDLE); }; module AP_MODULE_DECLARE_DATA parser3_module = { STANDARD20_MODULE_STUFF, #else module MODULE_VAR_EXPORT parser3_module = { STANDARD_MODULE_STUFF, parser_module_init, /* module initializer */ #endif parser_create_dir_config, /* per-directory config creator */ 0, /* dir config merger */ parser_create_server_config, /* server config creator */ 0, /* server config merger */ parser_cmds, /* command apr_table_t */ #ifdef STANDARD20_MODULE_STUFF parser_register_hooks /* register hooks */ #else parser_handlers, /* [9] list of handlers */ 0, /* [2] filename-to-URI translation */ 0, /* [5] check/validate user_id */ 0, /* [6] check user_id is valid *here* */ 0, /* [4] check access by host address */ 0, /* [7] MIME type checker/setter */ 0, /* [8] fixups */ 0, /* [10] logger */ 0, /* [3] header parser */ 0, /* process initializer */ parser_module_done /* process exit/cleanup */ #endif // STANDARD20_MODULE_STUFF }; #if defined(_MSC_VER) # define APACHE_WIN32_SRC "../../../../win32/apache22/" # ifdef _DEBUG # pragma comment(lib, APACHE_WIN32_SRC "srclib/apr/Debug/libapr-1.lib") # pragma comment(lib, APACHE_WIN32_SRC "Debug/libhttpd.lib") # else # pragma comment(lib, APACHE_WIN32_SRC "srclib/apr/Release/libapr-1.lib") # pragma comment(lib, APACHE_WIN32_SRC "Release/libhttpd.lib") # endif #endif // interface to C++ void pa_ap_log_rerror(const char *file, int line, int level, const pa_request_rec *s, const char *fmt, ...) { const char* str; va_list l; va_start(l, fmt); str=va_arg(l, const char*); va_end(l); ap_log_rerror(file, line, #if (AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER >= 4) APLOG_MODULE_INDEX, #endif level, #ifdef STANDARD20_MODULE_STUFF 0, #endif (request_rec*)s->real_request_rec, "%s", str); } void pa_ap_log_error(const char *file, int line, int level, const pa_server_rec *s, const char *fmt, ...) { const char* str; va_list l; va_start(l, fmt); str=va_arg(l, const char*); va_end(l); ap_log_error(file, line, #if (AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER >= 4) APLOG_MODULE_INDEX, #endif level, #ifdef STANDARD20_MODULE_STUFF 0, #endif (server_rec*)s, "%s", str); } // ap_alloc.h const char* pa_ap_table_get(const pa_table *t, const char *name) { return ap_table_get((const apr_table_t*)t, name); } void pa_ap_table_addn(pa_table *t, const char *name, const char *val) { ap_table_addn((apr_table_t*)t, name, val); } int pa_ap_table_size(const pa_table *t) { return ap_table_elts((const apr_table_t*)t)->nelts; } void pa_ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const pa_table *t, ...) { ap_table_do(comp, rec, (apr_table_t*)t, NULL); } char * pa_ap_pstrdup(pa_pool *p, const char *s) { return ap_pstrdup((apr_pool_t*)p, s); } // http_protocol.h int pa_ap_setup_client_block(pa_request_rec *r, int read_policy) { return ap_setup_client_block((request_rec*)r->real_request_rec, read_policy); } int pa_ap_should_client_block(pa_request_rec *r) { return ap_should_client_block((request_rec*)r->real_request_rec); } long pa_ap_get_client_block(pa_request_rec *r, char *buffer, int bufsiz) { return ap_get_client_block((request_rec*)r->real_request_rec, buffer, bufsiz); } void pa_ap_send_http_header(pa_request_rec *r) { // Apache2 send headers before body automatically #ifndef STANDARD20_MODULE_STUFF ap_send_http_header((request_rec*)r->real_request_rec); #endif } int pa_ap_rwrite(const void *buf, int nbyte, pa_request_rec *r) { return ap_rwrite(buf, nbyte, (request_rec*)r->real_request_rec); } // http_main.h void pa_ap_hard_timeout(const char *s, pa_request_rec *r) { // Apache 2 uses non-blocking I/O #ifndef STANDARD20_MODULE_STUFF ap_hard_timeout((char *)s, (request_rec*)r->real_request_rec); #endif } void pa_ap_reset_timeout(pa_request_rec *r) { #ifndef STANDARD20_MODULE_STUFF ap_reset_timeout((request_rec*)r->real_request_rec); #endif } void pa_ap_kill_timeout(pa_request_rec *r) { #ifndef STANDARD20_MODULE_STUFF ap_kill_timeout((request_rec*)r->real_request_rec); #endif } // util_script.h void pa_ap_add_cgi_vars(pa_request_rec *r) { ap_add_cgi_vars((request_rec*)r->real_request_rec); } void pa_ap_add_common_vars(pa_request_rec *r) { ap_add_common_vars((request_rec*)r->real_request_rec); } // signal.h void (*pa_signal (int sig, void (*disp)(int)))(int) { #ifndef _MSC_VER if(sig==PA_SIGPIPE && disp==PA_SIG_IGN) return signal(SIGPIPE, SIG_IGN); #endif return 0; } parser-3.4.3/src/targets/apache/Makefile.am000644 000000 000000 00000001707 11773052135 020642 0ustar00rootwheel000000 000000 PA_LIBS = ../../classes/libclasses.la ../../types/libtypes.la ../../main/libmain.la ../../lib/gd/libgd.la ../../lib/cord/libcord.la \ ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la ../../lib/smtp/libsmtp.la ../../lib/json/libjson.la ../../lib/memcached/libmemcached.la INCLUDES = $(APACHE_INC) -I./ -I../../classes -I../../types -I../../lib/gc/include -I../../lib/cord/include @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS mod_parser3_la_LINK = $(LIBTOOL) --tag=CXX --tag=disable-static --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(mod_parser3_la_LDFLAGS) $(LDFLAGS) -o $@ noinst_HEADERS = pa_httpd.h lib_LTLIBRARIES = mod_parser3.la mod_parser3_la_SOURCES = pa_threads.C mod_parser3_core.C mod_parser3.c mod_parser3_la_DEPENDENCIES = Makefile $(PA_LIBS) mod_parser3_la_LDFLAGS = -module -avoid-version mod_parser3_la_CFLAGS = $(APACHE_CFLAGS) mod_parser3_la_LIBADD = $(PA_LIBS) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ $(LIBLTDL) parser-3.4.3/src/targets/apache/pa_threads.C000644 000000 000000 00000001762 11770434202 021021 0ustar00rootwheel000000 000000 /** @file Parser: Mutex realization class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_threads.h" volatile const char * IDENT_PA_THREADS_C="$Id: pa_threads.C,v 1.3 2012/06/20 20:54:26 moko Exp $" IDENT_PA_THREADS_H; Mutex global_mutex; #ifdef WIN32 #include const bool parser_multithreaded=true; pa_thread_t pa_get_thread_id() { return GetCurrentThreadId(); } Mutex::Mutex() : handle(reinterpret_cast(CreateMutex(NULL, FALSE, 0))) { } Mutex::~Mutex() { CloseHandle(reinterpret_cast(handle)); } void Mutex::acquire() { WaitForSingleObject(reinterpret_cast(handle), INFINITE); } void Mutex::release() { ReleaseMutex(reinterpret_cast(handle)); } #else const bool parser_multithreaded=false; pa_thread_t pa_get_thread_id() { return 1; } Mutex::Mutex() {} Mutex::~Mutex() {} void Mutex::acquire() {} void Mutex::release() {} #endif parser-3.4.3/src/targets/apache/mod_parser3_core.C000644 000000 000000 00000022370 12174045357 022143 0ustar00rootwheel000000 000000 /** @file Parser: apache 1.3/2.X module, part, compiled by parser3project. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ volatile const char * IDENT_MOD_PARSER3_CORE_C="$Id: mod_parser3_core.C,v 1.10 2013/07/24 21:45:19 moko Exp $"; #include "pa_config_includes.h" #include "pa_globals.h" #include "pa_httpd.h" #include "pa_common.h" #include "pa_sapi.h" #include "classes.h" #include "pa_request.h" #include "pa_socks.h" #if _MSC_VER && !defined(_DEBUG) # include # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif // generals static bool globals_inited=false; void pa_setup_module_cells() { if(globals_inited) return; globals_inited=true; /// no trying to __try here [yet] try { // init socks pa_socks_init(); // init global variables pa_globals_init(); } catch(const Exception& e) { // global problem SAPI::abort("setup_module_cells failed: %s", e.comment()); } } void pa_destroy_module_cells() { if(!globals_inited) return; pa_globals_done(); pa_socks_done(); } //@{ /// SAPI func decl class SAPI_Info { public: pa_request_rec* r; }; void SAPI::log(SAPI_Info& SAPI_info, const char* fmt, ...) { va_list args; va_start(args,fmt); char buf[MAX_LOG_STRING]; size_t size=vsnprintf(buf, MAX_LOG_STRING, fmt, args); size=remove_crlf(buf, buf+size); pa_ap_log_rerror(0, 0, PA_APLOG_ERR | PA_APLOG_NOERRNO, SAPI_info.r, "%s", buf); va_end(args); } static void die_or_abort(const char* fmt, va_list args, bool write_core) { char buf[MAX_LOG_STRING]; size_t size=vsnprintf(buf, MAX_LOG_STRING, fmt, args); size=remove_crlf(buf, buf+size); pa_ap_log_error(PA_APLOG_MARK, PA_APLOG_EMERG, 0, "%s", buf); // exit & try to produce core dump if(write_core) abort(); else exit(1); } void SAPI::die(const char* fmt, ...) { va_list args; va_start(args, fmt); die_or_abort(fmt, args, false/*write core?*/); va_end(args); } void SAPI::abort(const char* fmt, ...) { va_list args; va_start(args, fmt); die_or_abort(fmt, args, true/*write core?*/); va_end(args); } char* SAPI::get_env(SAPI_Info& SAPI_info, const char* name) { const char* dont_return_me=pa_ap_table_get(SAPI_info.r->subprocess_env, name); return dont_return_me?pa_strdup(dont_return_me):0; } #ifndef DOXYGEN struct SAPI_environment_append_info { const char** cur; }; #endif static const char* mk_env_pair(const char* key, const char* value) { char *result=new(PointerFreeGC) char[strlen(key)+1/*=*/+strlen(value)+1/*0*/]; strcpy(result, key); strcat(result, "="); strcat(result, value); return result; } static int SAPI_environment_append(void *d, const char* k, const char* val) { if( k && val ) { SAPI_environment_append_info& info= *static_cast(d); *info.cur++=mk_env_pair(k, val); } return 1/*true*/; } const char* const* SAPI::environment(SAPI_Info& SAPI_info) { const pa_table *t=SAPI_info.r->subprocess_env; const char** result=new(UseGC) const char*[pa_ap_table_size(t)+1/*0*/]; SAPI_environment_append_info info={result}; pa_ap_table_do(SAPI_environment_append, &info, t, 0); *info.cur=0; // mark EOE return result; } size_t SAPI::read_post(SAPI_Info& SAPI_info, char *buf, size_t max_bytes) { /* pa_ap_log_error(PA_APLOG_MARK, PA_APLOG_DEBUG, SAPI_info.r->server, "mod_parser3: SAPI::read_post(max=%u)", max_bytes); */ int retval; if((retval = pa_ap_setup_client_block(SAPI_info.r, PA_REQUEST_CHUNKED_ERROR))) return 0; if(!pa_ap_should_client_block(SAPI_info.r)) return 0; uint total_read_bytes=0; void (*handler)(int)=pa_signal(PA_SIGPIPE, PA_SIG_IGN); while (total_read_bytesstatus=302; if(strcasecmp(dont_store_key, HTTP_CONTENT_TYPE)==0) { /* r->content_type, *not* r->headers_out("Content-type"). If you don't * set it, it will be filled in with the server's default type (typically * "text/plain"). You *must* also ensure that r->content_type is lower * case. */ *SAPI_info.r->content_type = pa_ap_pstrdup(SAPI_info.r->pool, dont_store_value); } else if(strcasecmp(dont_store_key, HTTP_STATUS)==0) *SAPI_info.r->status=atoi(dont_store_value); else pa_ap_table_addn(SAPI_info.r->headers_out, pa_ap_pstrdup(SAPI_info.r->pool, capitalize(dont_store_key)), pa_ap_pstrdup(SAPI_info.r->pool, dont_store_value)); } void SAPI::send_header(SAPI_Info& SAPI_info) { pa_ap_hard_timeout("Send header", SAPI_info.r); pa_ap_send_http_header(SAPI_info.r); pa_ap_kill_timeout(SAPI_info.r); } size_t SAPI::send_body(SAPI_Info& SAPI_info, const void *buf, size_t size) { pa_ap_hard_timeout("Send body", SAPI_info.r); size = (size_t)pa_ap_rwrite(buf, size, SAPI_info.r); pa_ap_kill_timeout(SAPI_info.r); return size; } //@} #ifndef PA_DEBUG_DISABLE_GC #ifndef _MSC_VER extern long GC_large_alloc_warn_suppressed; #endif #endif /** main workhorse @todo intelligent cache-control */ static void real_parser_handler(SAPI_Info& SAPI_info, Parser_module_config *dcfg) { // collect garbage from prev request #ifndef PA_DEBUG_DISABLE_GC GC_dont_gc=0; GC_gcollect(); GC_dont_gc=1; #ifndef _MSC_VER GC_large_alloc_warn_suppressed=0; #endif #endif // populate env pa_ap_add_common_vars(SAPI_info.r); pa_ap_add_cgi_vars(SAPI_info.r); // Request info Request_info request_info; memset(&request_info, 0, sizeof(request_info)); request_info.document_root=SAPI::get_env(SAPI_info, "DOCUMENT_ROOT"); request_info.path_translated=SAPI_info.r->filename; request_info.method=SAPI_info.r->method; request_info.query_string=SAPI_info.r->args; request_info.uri=SAPI::get_env(SAPI_info, "REQUEST_URI"); request_info.content_type=SAPI::get_env(SAPI_info, "CONTENT_TYPE"); const char* content_length=SAPI::get_env(SAPI_info, "CONTENT_LENGTH"); request_info.content_length=content_length?atoi(content_length):0; request_info.cookie=SAPI::get_env(SAPI_info, "HTTP_COOKIE"); request_info.mail_received=false; // prepare to process request Request request( SAPI_info, request_info, String::Language(String::L_HTML|String::L_OPTIMIZE_BIT) ); // process the request request.core( dcfg->parser_config_filespec, true, // /path/to/config SAPI_info.r->header_only!=0); } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION static const Exception call_real_parser_handler__do_PEH_return_it( SAPI_Info& SAPI_info, Parser_module_config *dcfg) { try { real_parser_handler(SAPI_info, dcfg); } catch(const Exception& e) { return e; } return Exception(); } static void call_real_parser_handler__supress_system_exception( SAPI_Info& SAPI_info, Parser_module_config *dcfg) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { parser_exception=call_real_parser_handler__do_PEH_return_it( SAPI_info, dcfg); } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else throw Exception("system", 0, ""); else throw Exception("system", 0, ""); } if(parser_exception) throw Exception(parser_exception); } #endif /// @test r->finfo.st_mode check seems to work only on win32 int pa_parser_handler(pa_request_rec *r, Parser_module_config *dcfg) { // SAPI info SAPI_Info SAPI_info; SAPI_info.r=r; if(r->file_not_found ) return PA_HTTP_NOT_FOUND; try { // global try #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION call_real_parser_handler__supress_system_exception( #else real_parser_handler( #endif SAPI_info, dcfg); // successful finish } catch(const Exception& e) { // global problem // don't allocate anything on pool here: // possible pool' exception not catch-ed now // and there could be out-of-memory exception char buf[MAX_STRING]; snprintf(buf, MAX_STRING, "Unhandled exception %s", e.comment()); // log it SAPI::log(SAPI_info, "%s", buf); // int content_length=strlen(buf); // prepare header // capitalized headers are used for preventing malloc during capitalization SAPI::add_header_attribute(SAPI_info, HTTP_CONTENT_TYPE_CAPITALIZED, "text/plain"); // don't use 'format' function because it calls malloc char content_length_cstr[MAX_NUMBER]; snprintf(content_length_cstr, MAX_NUMBER, "%u", content_length); SAPI::add_header_attribute(SAPI_info, HTTP_CONTENT_LENGTH_CAPITALIZED, content_length_cstr); // send header SAPI::send_header(SAPI_info); // send body if(!r->header_only) SAPI::send_body(SAPI_info, buf, content_length); // unsuccessful finish } /* * We did what we wanted to do, so tell the rest of the server we * succeeded. */ return PA_OK; } parser-3.4.3/src/targets/apache/pa_httpd.h000644 000000 000000 00000007621 11730603277 020565 0ustar00rootwheel000000 000000 /** @file Parser: http wrapper. Copyright (c) 2003-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_HTTPD_H #define PA_HTTPD_H #define IDENT_PA_HTTPD_H "$Id: pa_httpd.h,v 1.5 2012/03/16 09:24:15 moko Exp $"; #ifdef __cplusplus extern "C" { #endif // import from c to c++ typedef void pa_pool; typedef void pa_server_rec; typedef void pa_table; typedef struct pa_request_rec_tag { void* real_request_rec; pa_pool* pool; int header_only; /* HEAD request, as opposed to GET */ int* status; const char *method; /* GET, HEAD, POST, etc. */ pa_table *headers_out; void* subprocess_env; const char ** content_type; char *uri; /* the path portion of the URI */ char *filename; /* filename if found, otherwise NULL */ char *path_info; char *args; /* QUERY_ARGS, if any */ int file_not_found; /* non-zero if no such file */ } pa_request_rec; /// apache parser module configuration [httpd.conf + .htaccess-es] typedef struct Parser_module_config_tag { const char* parser_config_filespec; ///< filespec of site's config file } Parser_module_config; void pa_setup_module_cells(); void pa_destroy_module_cells(); int pa_parser_handler(pa_request_rec*, Parser_module_config*); // export from c to c++ // http_log.h #define PA_APLOG_EMERG 0 /* system is unusable */ #define PA_APLOG_ALERT 1 /* action must be taken immediately */ #define PA_APLOG_CRIT 2 /* critical conditions */ #define PA_APLOG_ERR 3 /* error conditions */ #define PA_APLOG_WARNING 4 /* warning conditions */ #define PA_APLOG_NOTICE 5 /* normal but significant condition */ #define PA_APLOG_INFO 6 /* informational */ #define PA_APLOG_DEBUG 7 /* debug-level messages */ #define PA_APLOG_LEVELMASK 7 /* mask off the level value */ #define PA_APLOG_NOERRNO (PA_APLOG_LEVELMASK + 1) #define PA_APLOG_MARK __FILE__,__LINE__ void pa_ap_log_rerror(const char *file, int line, int level, const pa_request_rec *s, const char *fmt, ...); void pa_ap_log_error(const char *file, int line, int level, const pa_server_rec *s, const char *fmt, ...); // ap_alloc.h const char * pa_ap_table_get(const pa_table *, const char *); void pa_ap_table_addn(pa_table *, const char *name, const char *val); int pa_ap_table_size(const pa_table *); void pa_ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const pa_table *t,...); char * pa_ap_pstrdup(pa_pool *, const char *s); // http_protocol.h /* Possible values for request_rec.read_body (set by handling module): * REQUEST_NO_BODY Send 413 error if message has any body * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me. * REQUEST_CHUNKED_PASS Pass the chunks to me without removal. */ #define PA_REQUEST_NO_BODY 0 #define PA_REQUEST_CHUNKED_ERROR 1 #define PA_REQUEST_CHUNKED_DECHUNK 2 #define PA_REQUEST_CHUNKED_PASS 3 int pa_ap_setup_client_block(pa_request_rec *r, int read_policy); int pa_ap_should_client_block(pa_request_rec *r); long pa_ap_get_client_block(pa_request_rec *r, char *buffer, int bufsiz); void pa_ap_send_http_header(pa_request_rec *l); int pa_ap_rwrite(const void *buf, int nbyte, pa_request_rec *r); // http_main.h void pa_ap_hard_timeout(const char *, pa_request_rec *); void pa_ap_reset_timeout(pa_request_rec *); void pa_ap_kill_timeout(pa_request_rec *); // util_script.h void pa_ap_add_cgi_vars(pa_request_rec *r); void pa_ap_add_common_vars(pa_request_rec *r); // httpd.h #define PA_HTTP_NOT_FOUND 404 #define PA_OK 0 /* Module has handled this stage. */ // signal.h #define PA_SIGPIPE 1 /* must translate to real one */ #define PA_SIG_IGN (void (*)(int))1 /* must translate to real one */ void (*pa_signal (int sig, void (*disp)(int)))(int); #ifdef __cplusplus } #endif #endif parser-3.4.3/src/targets/isapi/Makefile.in000644 000000 000000 00000024756 11766635216 020561 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ #do not automake, desined to be compiled with MSVC only VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/targets/isapi DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = pa_threads.C parser3isapi.C parser3isapi.def parser3isapi.vcproj all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/isapi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/isapi/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: parser-3.4.3/src/targets/isapi/Makefile.am000644 000000 000000 00000000207 07746126661 020533 0ustar00rootwheel000000 000000 #do not automake, desined to be compiled with MSVC only EXTRA_DIST = pa_threads.C parser3isapi.C parser3isapi.def parser3isapi.vcproj parser-3.4.3/src/targets/isapi/pa_threads.C000644 000000 000000 00000001455 11770434202 020704 0ustar00rootwheel000000 000000 /** @file Parser: zero Mutex realization class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_threads.h" volatile const char * IDENT_PA_THREADS_C="$Id: pa_threads.C,v 1.20 2012/06/20 20:54:26 moko Exp $" IDENT_PA_THREADS_H; #include const bool parser_multithreaded=true; pa_thread_t pa_get_thread_id() { return GetCurrentThreadId(); } Mutex global_mutex; Mutex::Mutex() : handle(reinterpret_cast(CreateMutex(NULL, FALSE, 0))) { } Mutex::~Mutex() { CloseHandle(reinterpret_cast(handle)); } void Mutex::acquire() { WaitForSingleObject(reinterpret_cast(handle), INFINITE); } void Mutex::release() { ReleaseMutex(reinterpret_cast(handle)); } parser-3.4.3/src/targets/isapi/parser3isapi.C000644 000000 000000 00000035376 11770434202 021210 0ustar00rootwheel000000 000000 /** @file Parser: IIS extension. Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ volatile const char * IDENT_PARSER3ISAPI_C="$Id: parser3isapi.C,v 1.106 2012/06/20 20:54:26 moko Exp $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] #endif #include "pa_config_includes.h" #include "pa_sapi.h" #include "pa_globals.h" #include "pa_request.h" #include "pa_version.h" #include "pa_socks.h" #include #include #include // defines #if _MSC_VER && !defined(_DEBUG) # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif #define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION") // consts const char* IIS51vars[]={ "APPL_MD_PATH", "APPL_PHYSICAL_PATH", "AUTH_PASSWORD", "AUTH_TYPE", "AUTH_USER", "CERT_COOKIE", "CERT_FLAGS", "CERT_ISSUER", "CERT_KEYSIZE", "CERT_SECRETKEYSIZE", "CERT_SERIALNUMBER", "CERT_SERVER_ISSUER", "CERT_SERVER_SUBJECT", "CERT_SUBJECT", "CONTENT_LENGTH", "CONTENT_TYPE", "LOGON_USER", "HTTPS", "HTTPS_KEYSIZE", "HTTPS_SECRETKEYSIZE", "HTTPS_SERVER_ISSUER", "HTTPS_SERVER_SUBJECT", "INSTANCE_ID", "INSTANCE_META_PATH", "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING", "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_USER", "REQUEST_METHOD", "SCRIPT_NAME", "SERVER_NAME", "SERVER_PORT", "SERVER_PORT_SECURE", "SERVER_PROTOCOL", "SERVER_SOFTWARE", "URL", }; const int IIS51var_count=sizeof(IIS51vars)/sizeof(*IIS51vars); // globals char argv0[MAX_STRING]=""; // SAPI #ifndef DOXYGEN /* ISAPI SAPI functions receive this context information. see Pool::set_context */ class SAPI_Info { public: LPEXTENSION_CONTROL_BLOCK lpECB; String *header; DWORD http_response_code; }; #endif // goes to 'cs-uri-query' log file field. webmaster: switch it ON[default OFF]. void SAPI::log(SAPI_Info& SAPI_info, const char* fmt, ...) { va_list args; va_start(args,fmt); char buf[MAX_LOG_STRING]; const char* prefix="PARSER_ERROR:"; strcpy(buf, prefix); char *start=buf+strlen(prefix); DWORD size=vsnprintf(start, MAX_LOG_STRING-strlen(prefix), fmt, args); size=remove_crlf(start, start+size); SAPI_info.lpECB->ServerSupportFunction(SAPI_info.lpECB->ConnID, HSE_APPEND_LOG_PARAMETER, buf, &size, 0); } /// @todo event log static void abort(const char* fmt, va_list args) { if(FILE *log=fopen("c:\\parser3die.log", "at")) { vfprintf(log, fmt, args); fclose(log); } // exit & try to produce core dump abort(); } void SAPI::die(const char* fmt, ...) { va_list args; va_start(args, fmt); ::abort(fmt, args); // va_end(args); } void SAPI::abort(const char* fmt, ...) { va_list args; va_start(args, fmt); ::abort(fmt, args); // va_end(args); } char* SAPI::get_env(SAPI_Info& SAPI_info, const char* name) { char *variable_buf=new(PointerFreeGC) char[MAX_STRING]; DWORD variable_len = MAX_STRING-1; if(SAPI_info.lpECB->GetServerVariable(SAPI_info.lpECB->ConnID, const_cast(name), variable_buf, &variable_len)) { if(*variable_buf) { // saw returning len=1 && *buf=0 :( variable_buf[variable_len]=0; return variable_buf; } } else if (GetLastError()==ERROR_INSUFFICIENT_BUFFER) { variable_buf=new(PointerFreeGC) char[variable_len+1]; if(SAPI_info.lpECB->GetServerVariable(SAPI_info.lpECB->ConnID, const_cast(name), variable_buf, &variable_len)) { if(*variable_buf) { variable_buf[variable_len]=0; return variable_buf; } } } return 0; } static int grep_char(const char* s, char c) { int result=0; if(s) { while(s=strchr(s, c)) { s++; // skip found c result++; } } return result; } static const char* mk_env_pair(const char* key, const char* value) { char *result=new(PointerFreeGC) char[strlen(key)+1/*=*/+strlen(value)+1/*0*/]; strcpy(result, key); strcat(result, "="); strcat(result, value); return result; } const char* const *SAPI::environment(SAPI_Info& info) { // we know this buf is writable char* all_http_vars=SAPI::get_env(info, "ALL_HTTP"); const int http_var_count=grep_char(all_http_vars, '\n')+1/*\n for theoretical(never saw) this \0*/; const char* *result=new(PointerFreeGC) const char*[IIS51var_count+http_var_count+1/*0*/]; const char* *cur=result; // IIS5.1 vars for(int i=0; icbAvailable, max_bytes); memcpy(buf, SAPI_info.lpECB->lpbData, read_from_buf); total_read+=read_from_buf; if(read_from_bufcbTotalBytes) { DWORD cbRead=0, cbSize; read_from_input=min(max_bytes-read_from_buf, SAPI_info.lpECB->cbTotalBytes-read_from_buf); while(cbRead < read_from_input) { cbSize=read_from_input - cbRead; if(!SAPI_info.lpECB->ReadClient(SAPI_info.lpECB->ConnID, buf+read_from_buf+cbRead, &cbSize) || cbSize==0) break; cbRead+=cbSize; } total_read+=cbRead; } return total_read; } void SAPI::add_header_attribute(SAPI_Info& SAPI_info, const char* dont_store_key, const char* dont_store_value) { if(strcasecmp(dont_store_key, "location")==0) SAPI_info.http_response_code=302; if(strcasecmp(dont_store_key, HTTP_STATUS)==0) SAPI_info.http_response_code=atoi(dont_store_value); else (*SAPI_info.header) << capitalize(dont_store_key) << ": " << pa_strdup(dont_store_value) << "\r\n"; } /// @todo intelligent cache-control void SAPI::send_header(SAPI_Info& SAPI_info) { HSE_SEND_HEADER_EX_INFO header_info; char status_buf[MAX_STATUS_LENGTH]; switch(SAPI_info.http_response_code) { case 200: header_info.pszStatus="200 OK"; break; case 302: header_info.pszStatus="302 Moved Temporarily"; break; case 401:// useless untill parser auth mech header_info.pszStatus="401 Authorization Required"; break; default: snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed", SAPI_info.http_response_code); header_info.pszStatus=status_buf; break; } header_info.cchStatus=strlen(header_info.pszStatus); *SAPI_info.header << "\r\n"; // ISAPI v<5 did quite well without it header_info.pszHeader=SAPI_info.header->cstr(); header_info.cchHeader=SAPI_info.header->length(); header_info.fKeepConn=true; SAPI_info.lpECB->dwHttpStatusCode=SAPI_info.http_response_code; SAPI_info.lpECB->ServerSupportFunction(SAPI_info.lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); } size_t SAPI::send_body(SAPI_Info& SAPI_info, const void *buf, size_t size) { DWORD num_bytes=size; if(!SAPI_info.lpECB->WriteClient(SAPI_info.lpECB->ConnID, const_cast(buf), &num_bytes, HSE_IO_SYNC)) return 0; return (size_t)num_bytes; } static bool parser_init() { static bool globals_inited=false; if(globals_inited) return true; globals_inited=true; try { // init socks pa_socks_init(); // init global variables pa_globals_init(); // successful finish return true; } catch(.../*const Exception& e*/) { // global problem //const char* body=e.comment(); // unsuccessful finish return false; } } static void parser_done() { // finalize global variables pa_globals_done(); // pa_socks_done(); } /// ISAPI // BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) { pVer->dwExtensionVersion = HSE_VERSION; strncpy(pVer->lpszExtensionDesc, "Parser "PARSER_VERSION, HSE_MAX_EXT_DLL_NAME_LEN-1); pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1]=0; return parser_init(); } // dwFlags & HSE_TERM_MUST_UNLOAD means we can't return false BOOL WINAPI TerminateExtension( DWORD /*dwFlags*/ ) { parser_done(); return TRUE; } /** ISAPI // main workhorse @todo IIS: remove trailing default-document[index.html] from $request.uri. to do that we need to consult metabase, wich is tested&works but seems slow runtime and not could-be-quickly-implemented if prepared. @test PARSER_VERSION from outside */ void real_parser_handler(SAPI_Info& SAPI_info, bool header_only) { // collect garbage from prev request #ifndef PA_DEBUG_DISABLE_GC { int saved=GC_dont_gc; GC_dont_gc=0; GC_gcollect(); GC_dont_gc=saved; } #endif SAPI_info.header=new String; LPEXTENSION_CONTROL_BLOCK lpECB=SAPI_info.lpECB; // Request info Request_info request_info; memset(&request_info, 0, sizeof(request_info)); size_t path_translated_buf_size=strlen(lpECB->lpszPathTranslated)+1; char *filespec_to_process=pa_strdup(lpECB->lpszPathTranslated, path_translated_buf_size); #ifdef WIN32 back_slashes_to_slashes(filespec_to_process); #endif if(const char* path_info=SAPI::get_env(SAPI_info, "PATH_INFO")) { // IIS size_t len=strlen(filespec_to_process)-strlen(path_info); char *buf=new(PointerFreeGC) char[len+1]; strncpy(buf, filespec_to_process, len); buf[len]=0; request_info.document_root=buf; } else throw Exception(PARSER_RUNTIME, 0, "ISAPI: no PATH_INFO defined (in reinventing DOCUMENT_ROOT)"); request_info.path_translated=filespec_to_process; request_info.method=lpECB->lpszMethod; request_info.query_string=lpECB->lpszQueryString; if(lpECB->lpszQueryString && *lpECB->lpszQueryString) { char *reconstructed_uri=new(PointerFreeGC) char[ strlen(lpECB->lpszPathInfo)+1/*'?'*/+ strlen(lpECB->lpszQueryString)+1/*0*/]; strcpy(reconstructed_uri, lpECB->lpszPathInfo); strcat(reconstructed_uri, "?"); strcat(reconstructed_uri, lpECB->lpszQueryString); request_info.uri=reconstructed_uri; } else request_info.uri=lpECB->lpszPathInfo; request_info.content_type=lpECB->lpszContentType; request_info.content_length=lpECB->cbTotalBytes; request_info.cookie=SAPI::get_env(SAPI_info, "HTTP_COOKIE"); request_info.mail_received=false; // prepare to process request Request request(SAPI_info, request_info, String::Language(String::L_HTML|String::L_OPTIMIZE_BIT)); // beside by binary static char beside_binary_path[MAX_STRING]; strncpy(beside_binary_path, argv0, MAX_STRING-1); beside_binary_path[MAX_STRING-1]=0; // filespec of my binary if(!( rsplit(beside_binary_path, '/') || rsplit(beside_binary_path, '\\'))) { // strip filename // no path, just filename beside_binary_path[0]='.'; beside_binary_path[1]=0; } char config_filespec[MAX_STRING]; snprintf(config_filespec, MAX_STRING, "%s/%s", beside_binary_path, AUTO_FILE_NAME); bool fail_on_config_read_problem=entry_exists(config_filespec); // process the request request.core( config_filespec, fail_on_config_read_problem, // /path/to/first/auto.p header_only); } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION static const Exception call_real_parser_handler__do_PEH_return_it( SAPI_Info& SAPI_info, bool header_only) { try { real_parser_handler(SAPI_info, header_only); } catch(const Exception& e) { return e; } return Exception(); } static void call_real_parser_handler__supress_system_exception( SAPI_Info& SAPI_info, bool header_only) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { parser_exception=call_real_parser_handler__do_PEH_return_it( SAPI_info, header_only); } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else throw Exception("system", 0, ""); else throw Exception("system", 0, ""); } if(parser_exception) throw Exception(parser_exception); } #endif DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { //_asm int 3; SAPI_Info SAPI_info={ lpECB, 0, // filling later: so that if there would be error pool would have SAPI_info 200 // default http_response_code [lpECB->dwHttpStatusCode seems to be always 0, even on 404 redirect to /404.html] }; bool header_only=strcasecmp(lpECB->lpszMethod, "HEAD")==0; try { // global try #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION call_real_parser_handler__supress_system_exception( #else real_parser_handler( #endif SAPI_info, header_only); // successful finish } catch(const Exception& e) { // global problem // don't allocate anything on pool here: // possible pool' exception not catch-ed now // and there could be out-of-memory exception const char* body=e.comment(); // log it SAPI::log(SAPI_info, "exception in request exception handler: %s", body); // int content_length=strlen(body); // prepare header // not using SAPI func wich allocates on pool char header_buf[MAX_STRING]; int header_len=snprintf(header_buf, MAX_STRING, HTTP_CONTENT_TYPE_CAPITALIZED ": text/plain\r\n" HTTP_CONTENT_LENGTH_CAPITALIZED ": %u\r\n" // "expires: Fri, 23 Mar 2001 09:32:23 GMT\r\n" "\r\n", content_length); HSE_SEND_HEADER_EX_INFO header_info; header_info.pszStatus="200 OK"; header_info.cchStatus=strlen(header_info.pszStatus); header_info.pszHeader=header_buf; header_info.cchHeader=header_len; header_info.fKeepConn=true; // send header lpECB->dwHttpStatusCode=200; lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); // send body if(!header_only) SAPI::send_body(SAPI_info, body, content_length); // unsuccessful finish } /* const char* body="test"; // int content_length=strlen(body); // prepare header // not using SAPI func wich allocates on pool char header_buf[MAX_STRING]; int header_len=snprintf(header_buf, MAX_STRING, HTTP_CONTENT_TYPE_CAPITALIZED ": text/plain\r\n" HTTP_CONTENT_LENGTH_CAPITALIZED ": %u\r\n" "expires: Fri, 23 Mar 2001 09:32:23 GMT\r\n" "\r\n", content_length); HSE_SEND_HEADER_EX_INFO header_info; header_info.pszStatus="200 OK"; header_info.cchStatus=strlen(header_info.pszStatus); header_info.pszHeader=header_buf; header_info.cchHeader=header_len; header_info.fKeepConn=true; // send header lpECB->dwHttpStatusCode=200; lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); // send body DWORD num_bytes=content_length; lpECB->WriteClient(lpECB->ConnID, (void *)body, &num_bytes, HSE_IO_SYNC); */ return HSE_STATUS_SUCCESS_AND_KEEP_CONN; } BOOL WINAPI DllMain( HINSTANCE hinstDLL, // handle to the DLL module DWORD /*fdwReason*/, // reason for calling function LPVOID /*lpvReserved*/ // reserved ) { GetModuleFileName( hinstDLL, // handle to module argv0, // file name of module sizeof(argv0) // size of buffer ); return TRUE; }parser-3.4.3/src/targets/isapi/parser3isapi.def000644 000000 000000 00000000100 10033000172 021517 0ustar00rootwheel000000 000000 EXPORTS HttpExtensionProc GetExtensionVersion TerminateExtensionparser-3.4.3/src/targets/isapi/parser3isapi.vcproj000644 000000 000000 00000015316 12230131504 022310 0ustar00rootwheel000000 000000 parser-3.4.3/src/targets/cgi/Makefile.in000644 000000 000000 00000042657 12173026044 020200 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = parser3$(EXEEXT) subdir = src/targets/cgi DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_parser3_OBJECTS = pa_threads.$(OBJEXT) parser3.$(OBJEXT) parser3_OBJECTS = $(am_parser3_OBJECTS) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) SOURCES = $(parser3_SOURCES) DIST_SOURCES = $(parser3_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Parser has circular library dependencies, thus libmain.a is linked twice and --preserve-dup-deps libtool option is used PA_LIBS = ../../main/.libs/libmain.a ../../classes/.libs/libclasses.a ../../types/.libs/libtypes.a ../../main/.libs/libmain.a \ ../../lib/gd/libgd.la ../../lib/cord/libcord.la ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la \ ../../lib/smtp/libsmtp.la ../../lib/json/libjson.la ../../lib/memcached/libmemcached.la INCLUDES = -I../../classes -I../../types -I../../lib/gc/include -I../../lib/cord/include @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS CXXLINK = $(LIBTOOL) --preserve-dup-deps --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ parser3_DEPENDENCIES = Makefile $(PA_LIBS) parser3_SOURCES = pa_threads.C parser3.C parser3_LDADD = $(PA_LIBS) $(LIBLTDL) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ EXTRA_DIST = parser3.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/cgi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/cgi/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list parser3$(EXEEXT): $(parser3_OBJECTS) $(parser3_DEPENDENCIES) @rm -f parser3$(EXEEXT) $(CXXLINK) $(parser3_OBJECTS) $(parser3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_threads.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser3.Po@am__quote@ .C.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # 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: parser-3.4.3/src/targets/cgi/Makefile.am000644 000000 000000 00000001656 12173025601 020157 0ustar00rootwheel000000 000000 # Parser has circular library dependencies, thus libmain.a is linked twice and --preserve-dup-deps libtool option is used PA_LIBS = ../../main/.libs/libmain.a ../../classes/.libs/libclasses.a ../../types/.libs/libtypes.a ../../main/.libs/libmain.a \ ../../lib/gd/libgd.la ../../lib/cord/libcord.la ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la \ ../../lib/smtp/libsmtp.la ../../lib/json/libjson.la ../../lib/memcached/libmemcached.la INCLUDES = -I../../classes -I../../types -I../../lib/gc/include -I../../lib/cord/include @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS CXXLINK = $(LIBTOOL) --preserve-dup-deps --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ bin_PROGRAMS = parser3 parser3_DEPENDENCIES=Makefile $(PA_LIBS) parser3_SOURCES = pa_threads.C parser3.C parser3_LDADD = $(PA_LIBS) $(LIBLTDL) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ EXTRA_DIST = parser3.vcproj parser-3.4.3/src/targets/cgi/pa_threads.C000644 000000 000000 00000001034 11730603277 020340 0ustar00rootwheel000000 000000 /** @file Parser: zero Mutex realization class. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #include "pa_threads.h" volatile const char * IDENT_PA_THREADS_C="$Id: pa_threads.C,v 1.17 2012/03/16 09:24:15 moko Exp $" IDENT_PA_THREADS_H; const bool parser_multithreaded=false; pa_thread_t pa_get_thread_id() { return 1; } Mutex global_mutex; Mutex::Mutex() { } Mutex::~Mutex() { } void Mutex::acquire() { } void Mutex::release() { } parser-3.4.3/src/targets/cgi/parser3.vcproj000644 000000 000000 00000011560 12230131504 020714 0ustar00rootwheel000000 000000 parser-3.4.3/src/targets/cgi/parser3.C000644 000000 000000 00000050005 12231305110 017565 0ustar00rootwheel000000 000000 /** @file Parser: scripting and CGI main. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.266 2013/10/21 20:10:48 moko Exp $"; #include "pa_config_includes.h" #include "pa_sapi.h" #include "classes.h" #include "pa_common.h" #include "pa_request.h" #include "pa_socks.h" #include "pa_version.h" #include "pa_vconsole.h" #ifdef _MSC_VER #include #include #include #endif // defines // comment remove me after debugging //#define PA_DEBUG_CGI_ENTRY_EXIT "c:\\parser\\debug-parser3.log" #if _MSC_VER && !defined(_DEBUG) # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif //#define DEBUG_MAILRECEIVE "mailreceive.eml" // consts #define REDIRECT_PREFIX "REDIRECT_" #define PARSER_CONFIG_ENV_NAME "CGI_PARSER_CONFIG" #define PARSER_LOG_ENV_NAME "CGI_PARSER_LOG" /// IIS refuses to read bigger chunks const size_t READ_POST_CHUNK_SIZE=0x400*0x400; // 1M static const char* argv0; static const char* config_filespec_cstr=0; static bool fail_on_config_read_problem=true; static int args_skip=1; static char** argv_all = NULL; static bool cgi; ///< we were started as CGI? static bool mail_received=false; ///< we were started with -m option? [asked to parse incoming message to $mail:received] // for signal handlers Request *request=0; Request_info *request_info=0; bool execution_canceled=false; // SAPI class SAPI_Info{} SAPI_info; static void log(const char* fmt, va_list args) { bool opened=false; FILE *f=0; const char* log_by_env=getenv(PARSER_LOG_ENV_NAME); if(!log_by_env) log_by_env=getenv(REDIRECT_PREFIX PARSER_LOG_ENV_NAME); if(log_by_env) { f=fopen(log_by_env, "at"); opened=f!=0; } #ifdef PA_DEBUG_CGI_ENTRY_EXIT f=fopen(PA_DEBUG_CGI_ENTRY_EXIT, "at"); opened=f!=0; #endif if(!opened && config_filespec_cstr) { char beside_config_path[MAX_STRING]; strncpy(beside_config_path, config_filespec_cstr, MAX_STRING-1); beside_config_path[MAX_STRING-1]=0; if(!( rsplit(beside_config_path, '/') || rsplit(beside_config_path, '\\'))) { // strip filename // no path, just filename beside_config_path[0]='.'; beside_config_path[1]=0; } char file_spec[MAX_STRING]; snprintf(file_spec, MAX_STRING, "%s/parser3.log", beside_config_path); f=fopen(file_spec, "at"); opened=f!=0; } // fallback to stderr if(!opened) f=stderr; // use no memory [so that we could log out-of-memory error] setbuf(f, 0); // stderr stream is unbuffered by default, but still... // prefix time_t t=time(0); if(const char* stamp=ctime(&t)) { // never saw that if(size_t len=strlen(stamp)) // saw once stamp being ="" fprintf(f, "[%.*s] [%u] ", (int)len-1, stamp, (unsigned int)getpid() ); } // message char buf[MAX_LOG_STRING]; size_t size=vsnprintf(buf, MAX_LOG_STRING, fmt, args); size=remove_crlf(buf, buf+size); fwrite(buf, size, 1, f); if(request_info) fprintf(f, " [uri=%s, method=%s, cl=%lu]", request_info->uri? request_info->uri: "", request_info->method? request_info->method: "", request_info->content_length); else fputs(" [no request info]", f); // newline fputs("\n", f); if(opened) fclose(f); else fflush(f); } #ifdef PA_DEBUG_CGI_ENTRY_EXIT static void log(const char* fmt, ...) { va_list args; va_start(args,fmt); log(fmt, args); va_end(args); } #endif // appends to parser3.log located beside my binary if openable, to stderr otherwize void SAPI::log(SAPI_Info&, const char* fmt, ...) { va_list args; va_start(args,fmt); ::log(fmt, args); va_end(args); } static void die_or_abort(const char* fmt, va_list args, bool write_core) { // inform user char body[MAX_STRING]; int content_length=vsnprintf(body, MAX_STRING, fmt, args); // prepare header // let's be honest, that's bad we couldn't produce valid output // capitalized headers passed for preventing malloc during capitalization SAPI::add_header_attribute(SAPI_info, HTTP_STATUS_CAPITALIZED, "500"); SAPI::add_header_attribute(SAPI_info, HTTP_CONTENT_TYPE_CAPITALIZED, "text/plain"); // don't use 'format' function because it calls malloc char content_length_cstr[MAX_NUMBER]; snprintf(content_length_cstr, sizeof(content_length_cstr), "%u", content_length); SAPI::add_header_attribute(SAPI_info, HTTP_CONTENT_LENGTH_CAPITALIZED, content_length_cstr); // send header SAPI::send_header(SAPI_info); // body SAPI::send_body(SAPI_info, body, content_length); // exit & try to produce core dump[unix] or invoke debugger[Win32 Debug version] if(write_core) { #ifdef WIN32 // IIS with abort failes to show STDOUT, it just barks "abnormal program termination" exit(1); #else abort(); #endif } else exit(1); } void SAPI::die(const char* fmt, ...) { va_list args; // logging first, can't log inside die_or_abort due to vsnprintf (bug #106) va_start(args,fmt); ::log(fmt, args); va_end(args); va_start(args, fmt); die_or_abort(fmt, args, false /*write core?*/); // va_end(args); } void SAPI::abort(const char* fmt, ...) { va_list args; // logging first, can't log inside die_or_abort due to vsnprintf (bug #106) va_start(args,fmt); ::log(fmt, args); va_end(args); va_start(args, fmt); die_or_abort(fmt, args, true /*write core?*/); // va_end(args); } char* SAPI::get_env(SAPI_Info& , const char* name) { if(char *local=getenv(name)) return pa_strdup(local); else return 0; } const char* const *SAPI::environment(SAPI_Info&) { #ifdef _MSC_VER extern char **_environ; return _environ; #else extern char **environ; return environ; #endif } size_t SAPI::read_post(SAPI_Info& , char *buf, size_t max_bytes) { size_t read_size=0; do { ssize_t chunk_size=read(fileno(stdin), buf+read_size, min(READ_POST_CHUNK_SIZE, max_bytes-read_size)); if(chunk_size<=0) break; read_size+=chunk_size; } while(read_sizeconsole.was_used()) ) printf("%s: %s\n", capitalize(dont_store_key), dont_store_value); } /// @todo intelligent cache-control void SAPI::send_header(SAPI_Info& ) { if(cgi) { // puts("expires: Fri, 23 Mar 2001 09:32:23 GMT"); // header | body delimiter puts(""); } } size_t SAPI::send_body(SAPI_Info& , const void *buf, size_t size) { return stdout_write(buf, size); } // static void full_file_spec(const char* file_name, char *buf, size_t buf_size) { if(file_name) if(file_name[0]=='/' #ifdef WIN32 || file_name[0] && file_name[1]==':' #endif ) strncpy(buf, file_name, buf_size); else { char cwd[MAX_STRING]; snprintf(buf, buf_size, "%s/%s", getcwd(cwd, MAX_STRING) ? cwd : "", file_name); } else buf[0]=0; #ifdef WIN32 back_slashes_to_slashes(buf); #endif } static void log_signal(const char* signal_name) { if(request_info) SAPI::log(SAPI_info, "%s received while %s. uri=%s, method=%s, cl=%u", signal_name, request?"executing code":"reading data", request_info->uri, request_info->method, request_info->content_length); else SAPI::log(SAPI_info, "%s received before or after processing request", signal_name); } #ifdef SIGUSR1 static void SIGUSR1_handler(int /*sig*/){ log_signal("SIGUSR1"); } #endif #ifdef SIGPIPE #define SIGPIPE_NAME "SIGPIPE" static const String sigpipe_name(SIGPIPE_NAME); static void SIGPIPE_handler(int /*sig*/){ Value* sigpipe=0; if(request) sigpipe=request->main_class.get_element(sigpipe_name); if(sigpipe && sigpipe->as_bool()) log_signal(SIGPIPE_NAME); execution_canceled=true; if(request) request->set_interrupted(true); } #endif #ifdef WIN32 const char* maybe_reconstruct_IIS_status_in_qs(const char* original) { // 404;http://servername/page[?param=value...] // ';' should be urlencoded by HTTP standard, so we shouldn't get it from browser // and can consider that as an indication that this is IIS way to report errors if(original && isdigit((unsigned char)original[0]) && isdigit((unsigned char)original[1]) && isdigit((unsigned char)original[2]) && original[3]==';') { size_t original_len=strlen(original); char* reconstructed=new(PointerFreeGC) char[original_len +12/*IIS-STATUS=&*/ +14/*IIS-DOCUMENT=&*/ +1]; char* cur=reconstructed; memcpy(cur, "IIS-STATUS=", 11); cur+=11; memcpy(cur, original, 3); cur+=3; *cur++='&'; const char* qmark_at=strchr(original, '?'); memcpy(cur, "IIS-DOCUMENT=", 13); cur+=13; { size_t value_len=(qmark_at? qmark_at-original: original_len)-4; memcpy(cur, original+4, value_len); cur+=value_len; } if(qmark_at) { *cur++='&'; strcpy(cur, qmark_at+1/*skip ? itself*/); } else *cur=0; return reconstructed; } return original; } #endif class RequestController { public: RequestController(Request* r){ ::request=r; } ~RequestController(){ ::request=0; } }; /** main workhorse @todo IIS: remove trailing default-document[index.html] from $request.uri. to do that we need to consult metabase, wich is tested but seems slow. */ static void real_parser_handler(const char* filespec_to_process, const char* request_method, bool header_only) { // init socks pa_socks_init(); // init global variables pa_globals_init(); if(!filespec_to_process || !*filespec_to_process) SAPI::die("Parser/%s" #ifdef PA_DEBUG_CGI_ENTRY_EXIT " with entry/exit tracing" #endif , PARSER_VERSION); // Request info Request_info request_info; memset(&request_info, 0, sizeof(request_info)); char document_root_buf[MAX_STRING]; if(cgi) { if(const char* env_document_root=getenv("DOCUMENT_ROOT")) request_info.document_root=env_document_root; else if(const char* path_info=getenv("PATH_INFO")) { // IIS size_t len=min(sizeof(document_root_buf)-1, strlen(filespec_to_process)-strlen(path_info)); memcpy(document_root_buf, filespec_to_process, len); document_root_buf[len]=0; request_info.document_root=document_root_buf; } else throw Exception(PARSER_RUNTIME, 0, "CGI: no PATH_INFO defined(in reinventing DOCUMENT_ROOT)"); } else { full_file_spec("", document_root_buf, sizeof(document_root_buf)); request_info.document_root=document_root_buf; } request_info.path_translated=filespec_to_process; request_info.method=request_method ? request_method : "GET"; const char* query_string= #ifdef WIN32 maybe_reconstruct_IIS_status_in_qs #endif (getenv("QUERY_STRING")); request_info.query_string=query_string; if(cgi) { // few absolute obligatory const char* path_info=getenv("PATH_INFO"); if(!path_info) SAPI::die("CGI: illegal call (missing PATH_INFO)"); const char* script_name=getenv("SCRIPT_NAME"); if(!script_name) SAPI::die("CGI: illegal call (missing SCRIPT_NAME)"); const char* env_request_uri=getenv("REQUEST_URI"); if(env_request_uri) request_info.uri=env_request_uri; else if(query_string) { char* reconstructed_uri=new(PointerFreeGC) char[ strlen(path_info)+1/*'?'*/+ strlen(query_string)+1/*0*/]; strcpy(reconstructed_uri, path_info); strcat(reconstructed_uri, "?"); strcat(reconstructed_uri, query_string); request_info.uri=reconstructed_uri; } else request_info.uri=path_info; if(env_request_uri) { // apache & others stuck to standards /* http://parser3/env.html?123 =OK $request:uri=/env.html?123 REQUEST_URI='/env.html?123' SCRIPT_NAME='/cgi-bin/parser3' PATH_INFO='/env.html' http://parser3/cgi-bin/parser3/env.html?123 =ERROR $request:uri=/cgi-bin/parser3/env.html?123 REQUEST_URI='/cgi-bin/parser3/env.html?123' SCRIPT_NAME='/cgi-bin/parser3' PATH_INFO='/env.html' */ size_t script_name_len=strlen(script_name); size_t uri_len=strlen(env_request_uri); if(strncmp(env_request_uri, script_name, script_name_len)==0 && script_name_len != uri_len) // under IIS they are the same SAPI::die("CGI: illegal call (1)"); } else { // seen on IIS5 /* http://nestle/env.html?123 =OK $request:uri=/env.html?123 REQUEST_URI='' SCRIPT_NAME='/env.html' PATH_INFO='/env.html' http://nestle/cgi-bin/parser3.exe/env.html =ERROR $request:uri=/env.html REQUEST_URI='' SCRIPT_NAME='/cgi-bin/parser3.exe' PATH_INFO='/env.html' */ if(strcmp(script_name, path_info)!=0) SAPI::die("CGI: illegal call (2)"); } } else request_info.uri=""; request_info.content_type=getenv("CONTENT_TYPE"); const char* content_length=getenv("CONTENT_LENGTH"); request_info.content_length=(content_length?atoi(content_length):0); request_info.cookie=getenv("HTTP_COOKIE"); request_info.mail_received=mail_received; request_info.argv=argv_all; request_info.args_skip=args_skip; // get request_info ptr for signal handlers ::request_info=&request_info; if(execution_canceled) SAPI::die("Execution canceled"); #ifdef PA_DEBUG_CGI_ENTRY_EXIT log("request_info: method=%s, uri=%s, q=%s, dr=%s, pt=%s, cookies=%s, cl=%u", request_info.method, request_info.uri, request_info.query_string, request_info.document_root, request_info.path_translated, request_info.cookie, request_info.content_length); #endif // prepare to process request Request request(SAPI_info, request_info, cgi ? String::Language(String::L_HTML|String::L_OPTIMIZE_BIT) : String::L_AS_IS); { // get ::request ptr for signal handlers RequestController rc(&request); char config_filespec_buf[MAX_STRING]; if(!config_filespec_cstr) { const char* config_by_env=getenv(PARSER_CONFIG_ENV_NAME); if(!config_by_env) config_by_env=getenv(REDIRECT_PREFIX PARSER_CONFIG_ENV_NAME); if(config_by_env) config_filespec_cstr=config_by_env; else { // beside by binary char beside_binary_path[MAX_STRING]; strncpy(beside_binary_path, argv0, MAX_STRING-1); beside_binary_path[MAX_STRING-1]=0; // filespec of my binary if(!( rsplit(beside_binary_path, '/') || rsplit(beside_binary_path, '\\'))) { // strip filename // no path, just filename // @todo full path, not ./! beside_binary_path[0]='.'; beside_binary_path[1]=0; } snprintf(config_filespec_buf, MAX_STRING, "%s/%s", beside_binary_path, AUTO_FILE_NAME); config_filespec_cstr=config_filespec_buf; fail_on_config_read_problem=entry_exists(config_filespec_cstr); } } // process the request request.core( config_filespec_cstr, fail_on_config_read_problem, header_only); // ::request cleared in RequestController desctructor to prevent signal handlers from accessing invalid memory } // finalize global variables pa_globals_done(); // pa_socks_done(); } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION static const Exception call_real_parser_handler__do_PEH_return_it( const char* filespec_to_process, const char* request_method, bool header_only) { try { real_parser_handler( filespec_to_process, request_method, header_only); } catch(const Exception& e) { return e; } return Exception(); } static void call_real_parser_handler__supress_system_exception( const char* filespec_to_process, const char* request_method, bool header_only) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { parser_exception=call_real_parser_handler__do_PEH_return_it( filespec_to_process, request_method, header_only); } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else throw Exception("system", 0, ""); else throw Exception("system", 0, ""); } if(parser_exception) throw Exception(parser_exception); } #endif static void usage(const char* program) { printf( "Parser/%s\n" "Copyright (c) 2001-2013 Art. Lebedev Studio (http://www.artlebedev.com)\n" "Author: Alexandr Petrosian (http://paf.design.ru)\n" "\n" "Usage: %s [options] file\n" "Options are:\n" #ifdef WITH_MAILRECEIVE " -m Parse mail, put received letter to $mail:received\n" #endif " -f config_file Use this config file (/path/to/auto.p)\n" " -h Display usage information (this message)\n" , PARSER_VERSION, program); exit(EINVAL); } int main(int argc, char *argv[]) { #ifdef PA_DEBUG_CGI_ENTRY_EXIT log("main: entry"); #endif #ifndef PA_DEBUG_DISABLE_GC GC_java_finalization=0; // Dont collect unless explicitly requested // this is quicker (~30% ), but less memory-efficient(~8%) // so deciding for speed GC_dont_gc=1; #endif #ifdef SIGUSR1 if(signal(SIGUSR1, SIGUSR1_handler)==SIG_ERR) SAPI::die("Can not set handler for SIGUSR1"); #endif #ifdef SIGPIPE if(signal(SIGPIPE, SIGPIPE_handler)==SIG_ERR) SAPI::die("Can not set handler for SIGPIPE"); #endif #ifdef DEBUG_MAILRECEIVE if(FILE *fake_in=fopen(DEBUG_MAILRECEIVE, "rt")) { dup2(fake_in->_file, 0/*STDIN_FILENO*/); } #endif argv_all=argv; argv0=argv[0]; umask(2); // were we started as CGI? cgi= ( getenv("SERVER_SOFTWARE") || getenv("SERVER_NAME") || getenv("GATEWAY_INTERFACE") || getenv("REQUEST_METHOD") ) && !getenv("PARSER_VERSION"); char *raw_filespec_to_process; if(cgi) { raw_filespec_to_process=getenv("PATH_TRANSLATED"); if(raw_filespec_to_process && !*raw_filespec_to_process) raw_filespec_to_process=0; } else { int optind=1; while(optind < argc){ char *carg = argv[optind]; if(carg[0] != '-') break; for(size_t k = 1; k < strlen(carg); k++){ char c = carg[k]; switch (c) { case 'h': usage(argv[0]); break; case 'f': if(optind < argc - 1){ optind++; config_filespec_cstr=argv[optind]; } break; #ifdef WITH_MAILRECEIVE case 'm': mail_received=true; break; #endif default: fprintf(stderr, "%s: invalid option '%c'\n", argv[0], c); usage(argv[0]); break; } } optind++; } if (optind > argc - 1) { fprintf(stderr, "%s: file not specified\n", argv[0]); usage(argv[0]); } raw_filespec_to_process=argv[optind]; args_skip=optind; } #ifdef _MSC_VER setmode(fileno(stdin), _O_BINARY); setmode(fileno(stdout), _O_BINARY); setmode(fileno(stderr), _O_BINARY); #endif #if defined(_MSC_VER) && defined(_DEBUG) // Get current flag int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); // Turn on leak-checking bit tmpFlag |= _CRTDBG_LEAK_CHECK_DF; // Set flag to the new value _CrtSetDbgFlag( tmpFlag ); _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); #endif char filespec_to_process[MAX_STRING]; full_file_spec(raw_filespec_to_process, filespec_to_process, sizeof(filespec_to_process)); const char* request_method=getenv("REQUEST_METHOD"); bool header_only=request_method && strcasecmp(request_method, "HEAD")==0; try { // global try #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION call_real_parser_handler__supress_system_exception( #else real_parser_handler( #endif filespec_to_process, request_method, header_only); } catch(const Exception& e) { // global problem // don't allocate anything on pool here: // possible pool' exception not catch-ed now // and there could be out-of-memory exception char buf[MAX_STRING]; snprintf(buf, MAX_STRING, "Unhandled exception %s", e.comment()); // log it SAPI::log(SAPI_info, "%s", buf); // int content_length=strlen(buf); // prepare header // capitalized headers are used for preventing malloc during capitalization SAPI::add_header_attribute(SAPI_info, HTTP_CONTENT_TYPE_CAPITALIZED, "text/plain"); // don't use 'format' function because it calls malloc char content_length_cstr[MAX_NUMBER]; snprintf(content_length_cstr, MAX_NUMBER, "%u", content_length); SAPI::add_header_attribute(SAPI_info, HTTP_CONTENT_LENGTH_CAPITALIZED, content_length_cstr); // send header SAPI::send_header(SAPI_info); // send body if(!header_only) SAPI::send_body(SAPI_info, buf, content_length); // unsuccessful finish } #ifdef PA_DEBUG_CGI_ENTRY_EXIT log("main: successful return"); #endif return 0; } parser-3.4.3/src/sql/Makefile.in000644 000000 000000 00000034170 11766635216 016571 0ustar00rootwheel000000 000000 # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/sql DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ include_HEADERS = pa_sql_driver.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/sql/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/sql/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS # 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: parser-3.4.3/src/sql/Makefile.am000644 000000 000000 00000000042 11766060553 016543 0ustar00rootwheel000000 000000 include_HEADERS = pa_sql_driver.h parser-3.4.3/src/sql/pa_sql_driver.h000644 000000 000000 00000011463 11730603277 017520 0ustar00rootwheel000000 000000 /** @file Parser: sql driver interface. Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) driver dynamic library must look like this: @code class X_SQL_Driver: public SQL_Driver { public: X_SQL_Driver() : SQL_driver() {} int api_version() { return SQL_DRIVER_API_VERSION; } //... }; extern "C" SQL_Driver *create() { return new X_SQL_Driver(); } @endcode */ #ifndef PA_SQL_DRIVER_H #define PA_SQL_DRIVER_H #define IDENT_PA_SQL_DRIVER_H "$Id: pa_sql_driver.h,v 1.46 2012/03/16 09:24:15 moko Exp $" #include #include #include #include /* 1..8 not logged 9 introducing placeholders 10 limit fixed (default: SQL_NO_LIMIT [ULONG_MAX]), path to document_root added */ #define SQL_DRIVER_API_VERSION 10 //#define SQL_DRIVER_API_VERSION 9 #define SQL_DRIVER_CREATE create /* used in driver implementation */ #define SQL_DRIVER_CREATE_NAME "create" /* could not figure out how to # it :( */ #define SQL_NO_LIMIT ULONG_MAX //#define SQL_NO_LIMIT 0 /// fields are freed elsewhere class SQL_Error { bool fdefined; const char* ftype; const char* fcomment; public: SQL_Error(): fdefined(false) {} SQL_Error( const char* atype, const char* acomment): fdefined(true), ftype(atype), fcomment(acomment) {} SQL_Error(const char* acomment): fdefined(true), ftype(0), fcomment(acomment) {} SQL_Error& operator =(const SQL_Error& src) { fdefined=src.fdefined; ftype=src.ftype; fcomment=src.fcomment; return *this; } bool defined() const { return fdefined; } const char* type() const { return ftype; } const char* comment() const { return fcomment; } }; /// service functions for SQL driver to use class SQL_Driver_services { public: /// allocates some bytes virtual void *malloc(size_t size) =0; /// allocates some bytes, user promises: no pointers inside virtual void *malloc_atomic(size_t size) =0; /// reallocates bytes virtual void *realloc(void *ptr, size_t size) =0; /// $request:charset virtual const char* request_charset() =0; /// $request:document-root virtual const char* request_document_root() =0; /// transcoder. /// WARNING: can store pointers to charset names to speedup name-to-instance resolving /// so do NOT pass pointers to local vars and change those vars after that virtual void transcode(const char* src, size_t src_length, const char*& dst, size_t& dst_length, const char* charset_from_name, const char* charset_to_name ) =0; /// prepare throw exception virtual void _throw(const SQL_Error& e) =0; /// throw C++ exception from prepared virtual void propagate_exception() =0; /// helper func void _throw(const char* comment) { _throw(SQL_Error("sql.connect", comment)); } public: /// regretrully public, because can't make stack frames: "nowhere to return to" jmp_buf mark; }; /** events, occuring when SQL_Driver::query()-ing. when OK must return false. must NOT throw exceptions, must store them to error & return true. */ class SQL_Driver_query_event_handlers { public: virtual bool add_column(SQL_Error& error, const char* str, size_t length) =0; virtual bool before_rows(SQL_Error& error) =0; virtual bool add_row(SQL_Error& error) =0; virtual bool add_row_cell(SQL_Error& error, const char* str, size_t length) =0; }; /// SQL driver API class SQL_Driver { public: /// @todo can be optimized to contain type information, /// to pass IN and OUT int/double NOT in string format struct Placeholder { const char* name; const char* value; bool is_null; bool were_updated; }; /** allocated using our allocator, @todo never freed */ static void *operator new(size_t size) { void *result=::malloc(size); if(!result) abort(); return result; } /// get api version virtual int api_version() =0; /// initialize driver by loading sql dynamic link library virtual const char* initialize(char *dlopen_file_spec) =0; /** connect to sql database using @param url_cstr format is driver specific @returns true+'connection' on success. 'error' on failure */ virtual void connect(char *url_cstr, SQL_Driver_services& services, void **connection) =0; virtual void disconnect(void *connection) =0; virtual void commit(void *connection) =0; virtual void rollback(void *connection) =0; /// @returns true to indicate that connection still alive virtual bool ping(void *connection) =0; /// encodes the string in 'from' to an escaped SQL string virtual const char* quote(void *connection, const char* str, unsigned int length) =0; virtual void query(void *connection, const char* statement, size_t placeholders_count, Placeholder* placeholders, unsigned long offset, unsigned long limit, SQL_Driver_query_event_handlers& handlers) =0; }; typedef SQL_Driver *(*SQL_Driver_create_func)(); #endif